feat: Support PEFT weight mapping and merge LoRA adapters when export to hf#1310
feat: Support PEFT weight mapping and merge LoRA adapters when export to hf#1310cuichenx merged 4 commits intoNVIDIA-NeMo:mainfrom HollowMan6:lora_merge
Conversation
|
@HollowMan6 : we have a plan to do this in 2 steps. We are going to provide a merging script, then you can use regular export to export the merged weights. |
@yaoyu-33 Yes, in RL training, it’s better to do it in a single step so that merged model weights can be updated to rollout engines in a streaming manner without any hassle. Please check verl-project/verl#4063 (comment) |
|
@HollowMan6 : we understand the need now, can help you merge this. |
cuichenx
left a comment
There was a problem hiding this comment.
Thanks for your contribution! The overall logic and structure look good to me. Some comments below. Could you also add a unit test that covers the newly added code in model bridge?
… to hf Signed-off-by: Hollow Man <hollowman@opensuse.org>
|
/ok to test 01599fc |
|
/ok to test 33eeac6 |
… to hf (#1310) Signed-off-by: Hollow Man <hollowman@opensuse.org> Signed-off-by: Chen Cui <chcui@nvidia.com> Co-authored-by: Chen Cui <chcui@nvidia.com> Signed-off-by: NeMo Bot <nemo-bot@nvidia.com>
… to hf (NVIDIA-NeMo#1310) Signed-off-by: Hollow Man <hollowman@opensuse.org> Signed-off-by: Chen Cui <chcui@nvidia.com> Co-authored-by: Chen Cui <chcui@nvidia.com>
What does this PR do ?
Now we support PEFT weight mapping (
to_warp), and ignore those adapters export for now, but merge LoRA adapters to the base weights when export to hf. Thelinear_intensors for LoRA adapters needs to be gathered before we merge lora using the transformation.Changelog
GitHub Actions CI
See the CI sectionin the Contributing doc for how to trigger the CI. A Nvidia developer will need to approve and trigger the CI for external contributors.
Before your PR is "Ready for review"
Pre checks:
If you haven't finished some of the above items you can still open "Draft" PR.
Additional Information
load_hf_weightsandexport_hf_weightsfor PEFT/LoRA enabled models #1272✨ Presented to you with Mind Lab - A Lab for Experiential Intelligence.