Skip to content

feat(mtp): add Qwen3.6-35B-A3B native MoE MTP recipe - #73

Open
hereisaway wants to merge 2 commits into
inclusionAI:mainfrom
hereisaway:feat/moe-mtp-train
Open

hereisaway wants to merge 2 commits into
inclusionAI:mainfrom
hereisaway:feat/moe-mtp-train

Conversation

@hereisaway

@hereisaway hereisaway commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Depends on #70 (merged)

#70 added the native MoE MTP model/loader and is now merged into main (0429713). This PR is rebased on that merge and contains only the PR2 changes.

Summary

This is the recipe/trainer/resume increment for #59. It wires the Qwen3.6-35B-A3B native MoE MTP predictor into a runnable recipe and validates exact recovery.

Scope is recipe/trainer/resume only. Export/stitch and decode acceptance remain follow-ups.

Changes

  • configs/recipes/qwen3_6_35b_a3b_mtp.yaml: 2 Target GPUs (TP2) + 1 Draft GPU, SDPA, CP1, non-packing, mtp_steps=3, mooncake.hidden_dim=2048.
  • tools/recipe_catalog.json: new native-mtp-moe entry (3 GPUs: 2 Target + 1 Draft).
  • tests/cpu/test_release_recipes.py: catalog entry count updated for the new recipe.
  • docs/user-guide/recipes.md, docs/user-guide/algorithms.md, docs/support.md: recipe/support updates; MoE export/stitch marked as follow-up.
  • tests/test_native_mtp_moe_recipe.py: recipe/Plan/model identity/catalog contract.
  • tests/cpu/test_native_mtp_moe.py: trainer feature-status regression and native MoE structure tests.
  • aspec/training/mtp_trainer.py: MTPTrainer.get_feature_contract_status() uses the generic Trainer status plus MTP fields. Previously it inherited the EAGLE status path and cleanup failed on DDPMTPModel.loss_gradient_checkpointing.
  • aspec/config/draft_structure.py: describes the native MoE predictor with routed/shared expert fields (ffn_type=native_mtp_moe).
  • aspec/planning.py: the model-only fail-closed from feat(mtp): add Qwen3.5-MoE native predictor support #70 is relaxed for valid native_mtp_moe structures; invalid expert settings still fail.

Validation

  • tests/cpu + tests/source: 1497 passed.
  • ruff check aspec tests tools setup.py, python -m tools.check_docs, git diff --check: pass.
  • Real Qwen3.6-35B-A3B bounded GPU run (Target TP2 on 2xH100, Draft on 1xH100):
    • 4-step run: losses 1.840292 / 1.251354 / 0.731200 / 0.226630; eval loss=0.9515, sim_acc_len=2.21.
    • Resume 4 -> 8: step 4-7 losses 0.201892 / 0.103003 / 1.274404 / 1.172917; eval loss=0.8092, sim_acc_len=2.29.
    • Fresh 8-step baseline matches the resumed run exactly on loss and eval.
    • Model / optimizer / LR-scheduler .distcp payloads are byte-identical between resumed and fresh checkpoints; RNG tensors are element-wise identical; final metrics identical.
    • All runs report completed / healthy / cleanup completed with 9/9 capabilities and 0 fallbacks.
  • Local run used mooncake.protocol=tcp because the selected GPUs are not all NVLink-connected; the release recipe keeps transfer_engine/nvlink_intra.

Follow-ups

  • Export/stitch MoE validation and bounded acceptance (next PR).
  • Ling-3.1-flash remains blocked on its 574GB checkpoint and 8x140GiB resources.

Part of #59.

@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0429713 and e32d0d5.

Files selected for processing: 11

  • aspec/config/draft_structure.py
  • aspec/planning.py
  • aspec/training/mtp_trainer.py
  • configs/recipes/qwen3_6_35b_a3b_mtp.yaml
  • docs/support.md
  • docs/user-guide/algorithms.md
  • docs/user-guide/recipes.md
  • tests/cpu/test_native_mtp_moe.py
  • tests/cpu/test_release_recipes.py
  • tests/test_native_mtp_moe_recipe.py
  • tools/recipe_catalog.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@hereisaway
hereisaway marked this pull request as ready for review December 4, 2026 16:16
@hereisaway

Copy link
Copy Markdown
Contributor Author

@zhouaihui this PR is ready for review now.

Since the draft was opened, #70 (native MoE MTP model/loader) has been merged, so I rebased this branch onto the new main (0429713) and dropped the duplicated PR1 commit. The branch now contains only the PR2 changes.

What changed in this update:

  • aspec/config/draft_structure.py: added a native_mtp_moe draft structure that records the routed and shared expert fields (num_experts, num_experts_per_tok, moe_intermediate_size, shared_expert_intermediate_size) for the native MoE MTP predictor, with fail-closed validation of expert settings.
  • aspec/planning.py: relaxed the model-only fail-closed from feat(mtp): add Qwen3.5-MoE native predictor support #70 so a valid native_mtp_moe structure can be planned; invalid expert settings are still rejected.
  • tests/cpu/test_native_mtp_moe.py: replaced the fail-closed regression with structure and plan-identity tests.
  • tests/cpu/test_release_recipes.py: catalog count updated (the new recipe plus the Ling-3.0-tiny DFlash recipe merged in the meantime).

Validation after rebase: tests/cpu + tests/source 1497 passed; ruff, check_docs and diff-check pass. The previous GPU train/resume evidence remains in the PR description.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant