fix(qwen2_5_omni): put the thinker prefix inside the peft prefix on lora saves - #3672
Open
stanley1208 wants to merge 1 commit into
Open
fix(qwen2_5_omni): put the thinker prefix inside the peft prefix on lora saves#3672stanley1208 wants to merge 1 commit into
stanley1208 wants to merge 1 commit into
Conversation
…ora saves Fixes NVIDIA-NeMo#3655. Same bug NVIDIA-NeMo#3630 fixes for qwen3_omni_moe: on peft saves the adapter prepended "thinker." to every key, including ones already carrying the "base_model.model." outer prefix, so the exported adapter had keys HF PEFT can't attach. It also broke imports of correctly named external adapters, which passed through from_hf unchanged. The thinker namespace now goes inside the peft prefix on save, from_hf strips it from either position and drops talker/token2wav keys in either position too, and old malformed saves still resume through the leading-strip fallback. The adapter also overrides map_peft_target_module_to_hf so adapter_config.json target_modules carry the thinker namespace, keeping peft's suffix matching off the talker's structurally identical submodules. Signed-off-by: stanley1208 <stanley.mei08@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3655. same bug #3630 fixes for qwen3_omni_moe, just in this adapter.
when you train a lora and save it, every weight gets a name. this adapter added
thinker.to the start of every name, but peft names must start withbase_model.model.. withthinker.in front, hf peft doesn't recognize any of the names, so the saved adapter can't be used. loading adapters made outside automodel failed for the same reason.what changed:
thinker.now goes in the right spot, afterbase_model.model.instead of before it. loading understands both the new and the old naming, so existing saves still workadded cpu tests for all of the above.