You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tools: moe_expert_chunks.py gate --proj down crashes instead of emitting the down gate (it uses the hidden-state row for a 768-wide contraction) #1083
tools: moe_expert_chunks.py gate --proj down crashes instead of emitting the down gate (it uses the hidden-state row for a 768-wide contraction)
gate builds A from the layer's MoE input row (h, hidden 2048 on Qwen3-Coder-30B-A3B) and then does codes.T @ a8. For --proj down the contraction is K = 768 (each expert's SwiGLU width), and down is
the one projection that does not share one A across experts: its input is each expert's own silu(gate·x) * (up·x). --proj down is in the CLI's choices, so the path is advertised; it dies with a raw
numpy shape error after the full forward has already run:
File "tools/moe_expert_chunks.py", line 299, in gate
exact = codes.astype(np.int32).T @ a8.astype(np.int32) # [N]
ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0,
(size 2048 is different from 768)
So the one gate artifact the docs name for a decode layer (docs/npu.md, "Routed expert stacks" — down is
the projection whose A cannot be shared) cannot be produced by the tool that is supposed to produce it, and a
run wastes the whole forward (minutes on this model) before failing.
Fix in the PR that references this: per-expert A (and per-expert ascale, since a different row has a different
maximum), plus the M=16 A matrix the chunk-list dispatch actually takes with expert j's row in row j
(docs/npu.md: "A chunk-list dispatch shares ONE A across its chunks"). The existing gate/up artifact is
unchanged — checked field by field against the frozen oracle ~/evidence/tmoe-npu/gate-L0-gate_proj-pad1024.json.
Activity