Skip to content

Conversation

@a-r-r-o-w
Copy link
Contributor

No description provided.

@a-r-r-o-w a-r-r-o-w requested a review from DN6 March 18, 2025 06:42
@HuggingFaceDocBuilderDev

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.


<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).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also mention that it can be disabled on modules with the skip patterns.


<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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also mention that it can be disabled on modules with the skip patterns.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't support skipping in group offloading. Will mention for layerwise casting though

@a-r-r-o-w a-r-r-o-w requested a review from DN6 March 18, 2025 09:11
@a-r-r-o-w
Copy link
Contributor Author

Failing test looks unrelated

@a-r-r-o-w a-r-r-o-w merged commit 1ddf3f3 into main Mar 24, 2025
14 of 15 checks passed
@a-r-r-o-w a-r-r-o-w deleted the improve-info-layerwise-and-group branch March 24, 2025 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants