Skip to content

fix(qwen2_5_omni): place thinker prefix inside base_model.model on PEFT saves - #3700

Open
taran-dev4u wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
taran-dev4u:feat/qwen2-5-omni-peft-thinker-prefix
Open

fix(qwen2_5_omni): place thinker prefix inside base_model.model on PEFT saves#3700
taran-dev4u wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
taran-dev4u:feat/qwen2-5-omni-peft-thinker-prefix

Conversation

@taran-dev4u

Copy link
Copy Markdown
Contributor

Fixes #3655.

Problem

When saving LoRA adapters for \qwen2_5_omni, parameter keys already start with the PEFT prefix \�ase_model.model..
\Qwen2_5OmniStateDictAdapter.to_hf\ previously prepended \ hinker.\ directly to the entire key, producing:
\\ ext
thinker.base_model.model.model.layers.0.self_attn.q_proj.lora_A.weight
\
instead of the expected Hugging Face PEFT format:
\\ ext
base_model.model.thinker.model.layers.0.self_attn.q_proj.lora_A.weight
\
This prevented external Hugging Face PEFT from loading saved adapters and broke bidirectional conversion in \ rom_hf.

Solution

  1. In \ o_hf: Check for \�ase_model.model.\ prefix and place \ hinker.\ inside it (\�ase_model.model.thinker...).
  2. In \ rom_hf: Strip \ hinker.\ when nested inside \�ase_model.model., preserving the PEFT prefix.
  3. In \convert_single_tensor_to_hf: Apply identical prefix nesting logic for single tensor conversions.
  4. Added comprehensive unit tests for PEFT LoRA key conversion, bidirectional round-trip serialization, and single-tensor export.

Testing

  • Passed 13/13 unit tests in \ ests/unit_tests/models/qwen2_5_omni/test_qwen2_5_omni_state_dict_adapter.py.

…FT saves

Signed-off-by: Taran Mamidala <mamidalataran6333@gmail.com>
@taran-dev4u
taran-dev4u requested a review from a team as a code owner August 27, 2026 09:21
@copy-pr-bot

copy-pr-bot Bot commented Aug 27, 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