Skip to content

fix(qwen3.5-moe): sanitize renames stacked experts to w1/w2/w3 but SparseMoeBlock now loads gate_proj/up_proj/down_proj (load regression since #588) #670

Closed

Description

@inureyes

Summary

Every qwen3.5-MoE / qwen3.6-MoE checkpoint fails to load with Missing weight: model.layers.0.mlp.switch_mlp.gate_proj. Found by the 2026-07-06 full benchmark sweep: qwen3.5-35b-a3b-4bit and qwen3.6-35b-a3b-4bit benched fine on 2026-06-12 (70 and 67 tok/s decode) and are FAIL:bench now.

Root cause

Fix

Align qwen3_5::sanitize_weights with the post-#588 block naming: stack experts.{e}.w1/w2/w3 into switch_mlp.gate_proj/down_proj/up_proj (w1 to gate, w2 to down, w3 to up), keep pre-stacked switch_mlp.{gate,up,down}_proj untouched, REVERSE step 8 to rename legacy stacked w1/w2/w3 into the gate/up/down names, and retarget the #587 per-expert pass at the gate/up/down slots. Update the #587 tests to the new expected keys, and add the missing gate: a test that runs sanitize + Qwen35Model::from_weights end to end on tiny synthetic MoE weights in each naming convention (pre-stacked gate/up/down, pre-stacked w1/w2/w3, per-expert w1/w2/w3, per-expert gate/up/down).

Acceptance Criteria

  • qwen3_5::sanitize_weights produces switch_mlp.gate_proj/up_proj/down_proj for all four input naming conventions (pre-stacked gate/up/down, pre-stacked w1/w2/w3, per-expert w1/w2/w3, per-expert gate/up/down).
  • New end-to-end test runs sanitize + Qwen35Model::from_weights on tiny synthetic MoE weights for each convention; fix(qwen3.5-moe): stack per-expert gate_proj/up_proj/down_proj weight names #587 unit tests updated to the new expected keys.
  • Real-checkpoint load + generate succeeds on models/qwen3.5-35b-a3b-4bit and models/qwen3.6-35b-a3b-4bit (both are VLM exports with language_model.* nesting, routed through load_qwen3_5_moe_vlm).
  • Dense qwen3.5 regression check passes (e.g. qwen3.5-4b-4bit).
  • Both MoE models re-added to the 2026-07-06 benchmark CSV.

Activity

  1. added
    status:ready
    type:bug
    priority:high
    area:models
    on Jul 6, 2026
  2. self-assigned this
    on Aug 31, 2026
  3. added
    status:done
    and removed
    status:ready
    on Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:modelspriority:highstatus:donetype:bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions