Skip to content

fix(qwen2_5_omni): put the thinker prefix inside the peft prefix on lora saves - #3672

Open
stanley1208 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
stanley1208:fix/qwen2-5-omni-thinker-prefix
Open

fix(qwen2_5_omni): put the thinker prefix inside the peft prefix on lora saves#3672
stanley1208 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
stanley1208:fix/qwen2-5-omni-thinker-prefix

Conversation

@stanley1208

Copy link
Copy Markdown
Contributor

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 with base_model.model.. with thinker. 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, after base_model.model. instead of before it. loading understands both the new and the old naming, so existing saves still work
  • weights belonging to the talker (the part of the model we don't train) are now filtered out no matter which naming they use
  • the adapter config file now uses the same names as the weights, so peft connects the adapter to the right parts of the model

added cpu tests for all of the above.

…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>
@stanley1208
stanley1208 requested a review from a team as a code owner August 25, 2026 19:09
@copy-pr-bot

copy-pr-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

qwen2_5_omni peft save puts the thinker. prefix outside base_model.model.

1 participant