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
[BUG] Module-tree subset ordering violates data flow in 6 definitions: a consumer is quantized in the same subset as, or before, its producer (LongCat-Flash, Kimi-Linear, Nemotron-H, LFM2-MoE, bailing_hybrid MLA, DeepSeek-VL2 MLA) #4372
Severity: medium. These do not crash. Sequential replay feeds non-quantized activations to the affected consumers, which lowers GPTQ/AWQ quality, and in the AWQ case also affects the scale grouping. Kind: new bugs of the same class as #4041. That audit fixed deepseek_v2/v3/v32/v4, lfm2, falcon_mamba, minimax and jamba; those fixes were re-verified as correct here.
How this was found (CPU, def6e61)
Plan check.simple_layer_modules was resolved the way the looper does it. The models were meta-built from real config.json files in the local model store, and the real checkpoint tensor names were compared against each plan.
Data-flow check. About 100 tiny random native models were built (tests/test_awq_scaling_groups.py::_tiny_config). Noise was added to each Linear's output, and the test recorded which Linears' inputs changed. A violation means a consumer's subset index is ≤ its producer's.
Findings
Definition
Problem
Data-flow evidence
Expected
longcat_flash.py:27-35
Both attention sub-blocks run before both MLPs, but the forward order is attn0 → mlps.0 → attn1 → mlps.1. MLA q_a/q_b and kv_a/kv_b also share a subset.
mlps.0.{gate,up,down}_proj → self_attn.1.{q_a,q_b,kv_a,kv_b,o_proj}: the consumer is quantized 2–3 subsets before its producer. Also q_a_proj[0] → q_b_proj[0] and kv_a_proj_with_mqa[0] → kv_b_proj[0].
o_proj:1 shares subset 1 with g_b_proj, forget_gate.f_b_proj, q_b_proj and kv_b_proj. This is the native path that Kimi-Linear-48B-A3B-Instruct dispatches to.
g_b_proj[1] → o_proj[1] and f_b_proj[1] → o_proj[1] (KDA layers); q_b_proj[1] → o_proj[1] and kv_b_proj[1] → o_proj[1] (MLA layers)
o_proj:2
nemotron_h.py:35 (and the NemotronOmniQModel copy, #4355)
Mamba2 mixer "in_proj:2", "out_proj:2"
mixer.in_proj[2] → mixer.out_proj[2]. The real NVIDIA-Nemotron-3-Nano-30B-A3B plan has a ['mixer.in_proj','mixer.out_proj'] subset.
out_proj:3 (each layer has a single mixer type, so the extra index is free)
lfm2_moe.py:29
"conv": ("in_proj", "out_proj") has no subset digits. Incomplete fix of #4041, which fixed lfm2.py but not this file.
Data-flow side: build AutoModelForCausalLM.from_config(_tiny_config("longcat_flash")) and add noise to the output of mlps.0.down_proj. The input of self_attn.1.q_a_proj changes.
Suggestion: a generic data-flow test like the one above, run in CI over every native definition, would stop this class of bug from coming back.
Found during an AI-assisted review (Claude Code, round 12) of def6e61; repros were run at that commit (A/B against 842d666 where noted) on RTX 4090/5090 (CUDA 13) and/or Radeon AI PRO R9700 (ROCm) unless marked static/suspected.
Taking this. I'll investigate against current main, add a targeted regression test, and open a PR. Will report back here if the claim turns out to be invalid or already fixed.
Activity
Qubitium commentedon Nov 16, 2026
Taking this. I'll investigate against current
main, add a targeted regression test, and open a PR. Will report back here if the claim turns out to be invalid or already fixed.fix(module-tree): quantize consumers after producers in six definitio…
fix: restore base modules and re-pick CPU kernels after weight-only q…