[fix] configure Qwen3.5 MoE aux loss#10636
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for the 'qwen3_5_moe' model type in the MoE configuration utility and includes a corresponding unit test to verify the correct application of auxiliary loss and router logits settings. I have no feedback to provide as there are no review comments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Additional Docker proof from a bounded one-shot container using the existing local LLaMA-Factory image: docker run --rm --name codex-llamafactory-qwen35-proof --cpus=2 --memory=6g \
-e DISABLE_VERSION_CHECK=1 -e PYTHONPATH=/workspace/src \
-v "E:\Industry Codebases\oss-contributions\LLaMA-Factory:/workspace" \
-w /workspace --entrypoint bash hiyouga/llamafactory:latest -lc "python --version && python -m pip install --no-cache-dir pytest ruff >/tmp/pip-proof.log && python -m pytest tests/model/model_utils/test_moe.py -q && python -m ruff check src/llamafactory/model/model_utils/moe.py tests/model/model_utils/test_moe.py && python -m ruff format --check src/llamafactory/model/model_utils/moe.py tests/model/model_utils/test_moe.py"Result:
Note: |
What\n\nAdds qwen3_5_moe to the MoE aux-loss configuration path so training enables router logits and propagates moe_aux_loss_coef for Qwen3.5 MoE configs.\n\nFixes #10302.\n\n## Why\n\nQwen3.5 MoE is already handled in related model utility paths, including ZeRO-3 leaf-module setup, but configure_moe omitted it from the router-logit and aux-loss model type lists.\n\n## Test\n\n- uv run --python 3.11 --with pytest --with torch --with transformers --with packaging --with pyyaml --with pydantic --with-editable . pytest tests/model/model_utils/test_moe.py -q\n- uv run --python 3.11 --with ruff ruff check src/llamafactory/model/model_utils/moe.py tests/model/model_utils/test_moe.py\n- uv run --python 3.11 --with ruff ruff format --check src/llamafactory/model/model_utils/moe.py tests/model/model_utils/test_moe.py\n- git diff --check