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 accelerate example for DDP and FSDP in sequence classification fo… #358

Merged
merged 1 commit into from
May 10, 2023

Conversation

sywangyi
Copy link
Contributor

…r non-lora case

@sywangyi
Copy link
Contributor Author

@pacman100 please help review.

…r non-lora case

Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
@sywangyi sywangyi force-pushed the sequence_accelerate branch from 56425e1 to 1fb3e54 Compare April 28, 2023 06:33
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented May 3, 2023

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

Copy link
Contributor

@pacman100 pacman100 left a comment

Choose a reason for hiding this comment

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

Thank you @sywangyi for adding this example for non-lora methods, is FSDP resulting in decrease in memory usage, for me the last time I checked it wasn't the case

@sywangyi
Copy link
Contributor Author

sywangyi commented May 4, 2023

yes, @pacman100 I see memory decrease in FSDP. I finetune llama 7b with 2-GPUs (RTX8000) using p-tuning, if FSDP is not used, DDP will be crashed because of OOM if training batch size is set to 8, while no crash with fsdp. and if cpu offload is used, the memory will decrease more comparing with no cpu offload in FSDP. but you should apply 352 to use cpu offload in fsdp.

Copy link
Contributor

@pacman100 pacman100 left a comment

Choose a reason for hiding this comment

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

Thank you @sywangyi for adding this example and confirming that using FSDP leads to memory savings with non LoRA methods, LGTM! 🤗

@pacman100 pacman100 merged commit 5ed95f4 into huggingface:main May 10, 2023
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.

3 participants