-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Officially support naive PP for quantized models + PEFT #1523
Conversation
- relax check - add test
The documentation is not available anymore as the PR was closed or merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LG2M :)
this feature is only in main, is there any plan to put into a new release so that I can use pip to install? |
What does this PR do?
Fixes #1515
Naive Pipeline Parallelism should be supported by accelerate and should work, if we properly educate users on how to use it.
What is NPP?
It is the simplest paradigm for running a model across multiple GPUs. It tries to evenly fit the model across all available GPUs (e.g.
device_map="auto"
)When to use it and when not to use it?
Initially I added that check because I was afraid users will train 8bit models that are loaded across multiple GPUs and under multi-GPU distributed regime. In that case the model will be converted to DDP (which is fine if the model fits in a single GPU and duplicated across multiple GPUs (Data Parallelism)) - which can lead to many breaking behaviours such as huggingface/peft#269 (comment) .
The fix is to relax the check constraint and to also check if we are under multi GPU distributed regime (expects to use DDP).
In TRL library, it is possible to use the
PPOTrainer
(that callsaccelerator.prepare
under the hood) to apply Naive Pipeline Parallelism: https://huggingface.co/docs/trl/main/en/lora_tuning_peft#naive-pipeline-parallelism-npp-for-large-models-60b-models to train 60B+ scale models using RLHF. The error was never raised there because I forgot to store the attributehf_device_map
inside the model class we use in TRL.To reproduce (you need PEFT and run this script in a multi-GPU env):
cc @sgugger @muellerzr