Skip to content

fix(definitions): declare untagged decoder linears (#4374) - #4422

Merged
Qubitium merged 1 commit into
mainfrom
fix/untagged-linears-4374
Nov 16, 2026
Merged

Qubitium merged 1 commit into
mainfrom
fix/untagged-linears-4374

Conversation

@Qubitium

Copy link
Copy Markdown
Collaborator

Fixes #4374.

Problem

Three decoder Linears were silently left unquantized because their module-tree specs were missing or untagged. An undeclared Linear is not an error (layer_modules_strict=False), so each of these stayed BF16 with no warning.

Fixes

1. deepseek_vl_v2 — non-MLA checkpoints (deepseek-vl2-tiny)
use_mla=false checkpoints instantiate LlamaAttention, so self_attn.k_proj/v_proj are checkpoint-owned decoder Linears next to the dense q_proj/o_proj. Added k_proj:0, v_proj:0 to the self_attn spec. MLA checkpoints keep the q_a/q_b and kv_a/kv_b low-rank path; the extra specs simply miss on those, matching the existing variant pattern.

2. nemotron_h — latent-MoE (moe_latent_size set)
The native forward is experts(fc1_latent_proj(x)) followed by fc2_latent_proj, so added mixer.fc1_latent_proj:5 before the routed experts and mixer.fc2_latent_proj:6 after them. Distinct group ids keep these blocks out of the Mamba/attention groups. NemotronOmniQModel shares NEMOTRON_H_LAYER_MODULES, so its plan/fixture is covered by the same change.

3. qwen4_exp / qwen4_exp_text — PLE and hyper-connections
Added explicit "ple:!", "attn_hyper_connection:!" and "mlp_hyper_connection:!" in forward order. These are intentionally dense (PLE's key_proj/value_proj/conv1d/ngram embedding, and the gated low-rank residual mixers), so the tag now distinguishes a deliberate exclusion from a coverage gap. :? was not used because these are not capture-only modules.

tests/module_tree/fixtures/registered_module_plans.json was deliberately refreshed for exactly the five affected cases (DeepSeekVLV2QModel, NemotronHQModel, NemotronOmniQModel, Qwen4ExpQModel, Qwen4ExpTextQModel).

Tests

New tests/module_tree/test_untagged_decoder_linears_4374.py uses state_dict()-based ownership per AGENTS.md, plus tests/module_tree/test_registry_leaf_coverage.py config overrides for the new cases.

Pre-fix: 4 failed (deepseek k/v, nemotron fc1/fc2_latent_proj, qwen4 ple + hyper-connections) and 3 failed in test_registry_leaf_coverage -k "qwen4 or nemotron_h".

Post-fix:

  • new file → 4 passed; test_registry_leaf_coverage → 116 passed, 14 skipped, 5 xfailed;
  • test_registered_module_plans → 419 passed; test_moe_tags → 76 passed; test_subset_plan → 13 passed;
  • combined run of the new + plan + tags + subset suites → 512 passed;
  • ruff check on all changed files → clean.

The full tests/module_tree/ run has 481 pre-existing environment failures (Marlin CUDA_HOME, missing torchvision, defuser 0.0.29 < 0.0.31); the failure set is identical to a clean baseline, so this change adds none.

Residual risk

  • DeepSeek-VL2's real checkpoint could not be exercised: deepseek_vl_v2 is not in CONFIG_MAPPING, its remote code needs timm, and no deepseek-vl2-tiny checkpoint is available locally. Coverage uses a fixture whose state_dict() keys mirror the real checkpoint, plus the MLA branch.
  • Adding k_proj/v_proj moves the last module of the deepseek_vl_v2 qkv block to v_proj, which AWQ uses as the next block's prev_op. That definition has no shape-dependent AWQ skip, so o_proj's fold source is an attention-input projection rather than its true input — a pre-existing AWQ ordering concern tracked by [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, not the coverage bug fixed here.
  • The new qwen4_exp :! blocks act as AWQ fold barriers, so affected groups fall back to plain quantization; validated on a tiny model, not a full checkpoint.
  • NemotronOmniQModel now publishes latent-projection specs its current test config does not instantiate; layer_modules_strict=False tolerates the misses, and the shared inventory stays identical.

- deepseek_vl_v2: add k_proj/v_proj for non-MLA (LlamaAttention) checkpoints
- nemotron_h: declare fc1_latent_proj/fc2_latent_proj in fc1 -> experts -> fc2 order
- qwen4_exp: tag PLE and hyper-connection subtrees as excluded (:!)
- add state_dict-based ownership regressions and cover the layouts in the
  registry leaf sweep; refresh the explicit plan fixture
@Qubitium
Qubitium merged commit efac288 into main Nov 16, 2026
9 checks passed
@Qubitium
Qubitium deleted the fix/untagged-linears-4374 branch November 16, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant