-
Notifications
You must be signed in to change notification settings - Fork 316
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
[PPO] feat: Add LoRA support for PPO #205
base: main
Are you sure you want to change the base?
Conversation
Relevant thread |
|
||
if isinstance(self.module._fsdp_wrapped_module, PeftModel): | ||
# the model to sync weights to is a vLLM model (not a peft model), so we need to merge the adapters | ||
with FSDP.summon_full_params(self.module): |
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.
Summon full params may cause OOM. @PeterSH6 Is there a better approach, that can merge lora weights in sharded form, or at least, one parameter after another to support large models?
if isinstance(self.module._fsdp_wrapped_module, PeftModel): | ||
# the model to sync weights to is a vLLM model (not a peft model), so we need to merge the adapters | ||
with FSDP.summon_full_params(self.module): | ||
self.module.merge_adapter() |
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.
The merge_adapter is not releasing the same original model structure as before. Is there any other way to merge and get the original base model structure?
This PR adds LoRA (Low-Rank Adaptation) support for PPO (#159)
Changes
Features
Some known issues:
params = OrderedDict((k.replace(".base_layer.", "."), v) for k, v in params.items() if not ".lora_" in k)