Improve information about group offloading and layerwise casting#11101
Merged
Conversation
a-r-r-o-w
commented
Mar 18, 2025
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
DN6
reviewed
Mar 18, 2025
DN6
reviewed
Mar 18, 2025
DN6
reviewed
Mar 18, 2025
|
|
||
| <Tip> | ||
|
|
||
| - Layerwise casting may not work with all models out-of-the-box. Sometimes, the forward implementations of the model contain weight-dependent typecasting of inputs. Such implementations are not supported due to the currently simplistic implementation of layerwise casting, which assumes that the forward pass is independent of the weight precision and that the input dtypes are always in `compute_dtype`. An example of an incompatible implementation can be found [here](https://github.com/huggingface/transformers/blob/7f5077e53682ca855afc826162b204ebf809f1f9/src/transformers/models/t5/modeling_t5.py#L294-L299). |
Collaborator
There was a problem hiding this comment.
Should also mention that it can be disabled on modules with the skip patterns.
DN6
reviewed
Mar 18, 2025
|
|
||
| <Tip> | ||
|
|
||
| - Group offloading may not work with all models out-of-the-box. If the forward implementations of the model contain weight-dependent device-casting of inputs, it may clash with the offloading mechanism's handling of device-casting. |
Collaborator
There was a problem hiding this comment.
Should also mention that it can be disabled on modules with the skip patterns.
Contributor
Author
There was a problem hiding this comment.
We don't support skipping in group offloading. Will mention for layerwise casting though
Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com>
DN6
approved these changes
Mar 24, 2025
Contributor
Author
|
Failing test looks unrelated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.