Repository navigation
fix(definitions): declare untagged decoder linears (#4374) - #4422
Merged
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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=falsecheckpoints instantiateLlamaAttention, soself_attn.k_proj/v_projare checkpoint-owned decoder Linears next to the denseq_proj/o_proj. Addedk_proj:0,v_proj:0to theself_attnspec. 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_sizeset)The native forward is
experts(fc1_latent_proj(x))followed byfc2_latent_proj, so addedmixer.fc1_latent_proj:5before the routed experts andmixer.fc2_latent_proj:6after them. Distinct group ids keep these blocks out of the Mamba/attention groups.NemotronOmniQModelsharesNEMOTRON_H_LAYER_MODULES, so its plan/fixture is covered by the same change.3.
qwen4_exp/qwen4_exp_text— PLE and hyper-connectionsAdded explicit
"ple:!","attn_hyper_connection:!"and"mlp_hyper_connection:!"in forward order. These are intentionally dense (PLE'skey_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.jsonwas deliberately refreshed for exactly the five affected cases (DeepSeekVLV2QModel,NemotronHQModel,NemotronOmniQModel,Qwen4ExpQModel,Qwen4ExpTextQModel).Tests
New
tests/module_tree/test_untagged_decoder_linears_4374.pyusesstate_dict()-based ownership per AGENTS.md, plustests/module_tree/test_registry_leaf_coverage.pyconfig 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:
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;ruff checkon all changed files → clean.The full
tests/module_tree/run has 481 pre-existing environment failures (MarlinCUDA_HOME, missingtorchvision,defuser 0.0.29 < 0.0.31); the failure set is identical to a clean baseline, so this change adds none.Residual risk
deepseek_vl_v2is not inCONFIG_MAPPING, its remote code needstimm, and nodeepseek-vl2-tinycheckpoint is available locally. Coverage uses a fixture whosestate_dict()keys mirror the real checkpoint, plus the MLA branch.k_proj/v_projmoves the last module of thedeepseek_vl_v2qkv block tov_proj, which AWQ uses as the next block'sprev_op. That definition has no shape-dependent AWQ skip, soo_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.:!blocks act as AWQ fold barriers, so affected groups fall back to plain quantization; validated on a tiny model, not a full checkpoint.NemotronOmniQModelnow publishes latent-projection specs its current test config does not instantiate;layer_modules_strict=Falsetolerates the misses, and the shared inventory stays identical.