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

Make fsdp ram efficient loading optional #2037

Conversation

pacman100
Copy link
Contributor

What does this PR do?

  1. Make fsdp ram efficient loading optional. Certain models are having issues when handling meta devices during pre-trained model loading. Fixes Error downloading wav2vec2 model when using accelerate launch with FSDP #1948 and NotImplementedError: Cannot copy out of meta tensor; no data! - while using FSDP [works with DDP and DeepSpeed] #2031 by making the ram efficient loading optional.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 6, 2023

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

@pacman100 pacman100 requested a review from muellerzr October 6, 2023 11:14
@pacman100 pacman100 marked this pull request as ready for review October 6, 2023 11:14
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.

Thanks for the fix! I added a few suggestions to try and make a few points more clear, let's see if we can improve it some :)

src/accelerate/commands/config/cluster.py Outdated Show resolved Hide resolved
src/accelerate/commands/launch.py Show resolved Hide resolved
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.

Thanks! cc @BenjaminBossan for a secondary :)

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.

Looks good, thanks Sourab. I only have two small nits, up to you if you want to address them.

src/accelerate/utils/launch.py Outdated Show resolved Hide resolved
docs/source/usage_guides/fsdp.md Outdated 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.

Great, thanks for enhancing the doc of the parameter.

@pacman100 pacman100 merged commit e6d96e5 into huggingface:main Oct 12, 2023
24 checks passed
@pacman100 pacman100 deleted the smangrul/make-fsdp-ram-efficient-loading-optional branch November 16, 2023 11:53
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.

Error downloading wav2vec2 model when using accelerate launch with FSDP
4 participants