Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logs offloading #2075

Merged
merged 3 commits into from
Oct 24, 2023
Merged

Add logs offloading #2075

merged 3 commits into from
Oct 24, 2023

Conversation

SunMarc
Copy link
Member

@SunMarc SunMarc commented Oct 23, 2023

What does this PR do ?

This PR adds a warning if there is any parameters on the meta device because of the offloading.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 23, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@muellerzr muellerzr left a comment

Choose a reason for hiding this comment

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

LG2M! Just a small nit. (Also would be nice if we could perhaps specify explicitly CPU or disk if offload let's us find that out :) )

src/accelerate/big_modeling.py Show resolved Hide resolved
Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Apart from Zach's comment, LGTM, thanks. I assume this is in response to #2074?

Only question for me is if the warning can be raised earlier already, e.g. line 386, or if it has to be at this point.

@SunMarc
Copy link
Member Author

SunMarc commented Oct 23, 2023

Apart from Zach's comment, LGTM, thanks. I assume this is in response to #2074?

Yes it is

Only question for me is if the warning can be raised earlier already, e.g. line 386, or if it has to be at this point.

The model is dispatched after attach_align_device_hook_on_blocks, so we can raise it after this function. I will do the modification.

@SunMarc SunMarc merged commit c3ec7ff into huggingface:main Oct 24, 2023
24 checks passed
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