Repository navigation
chore(deepseek_v4): delete the unreachable DeepSeek-V4 MTP calibration stack - #6435
Merged
Merged
Conversation
Qubitium
marked this pull request as ready for review
November 29, 2026 20:09
…n stack The DeepSeek-V4 integrated MTP (dSpark) calibration stack had no in-tree caller. Nothing in the definitions, the looper, the writer, scripts or the CLI calls build_mtp_quantization_model, from_target_model, from_auxiliary, attach_mtp_quantization_model, set_mtp_target_tap_sink or configure_mtp_activation_store, so a default quantize never built the MTP shell, never installed a target-tap sink and never attached a save overlay. Delete it from gptqmodel/models/definitions/deepseek_v4.py: - the MTP checkpoint-key contract, the auxiliary module tree and the reversed checkpoint mapping; - DeepSeekV4MTPAuxiliaryShell / DeepSeekV4MTPAuxiliary, the replay dataclasses, DeepSeekV4TargetAnchorResolver, DeepSeekV4MTPPrefixRuntime, DeepSeekV4MTPReplay and the per-block replay forward; - the DeepSeekV4QModel MTP entry points (build_mtp_*, the replay leaf materializer, attach_mtp_quantization_model, save_state_overlay, set_mtp_target_tap_sink and its quantization_layer_output_required / receive_quantization_layer_outputs overrides) and the mtp.* branch of exllamav3_checkpoint_module_candidates; - the lazy MTP dataset/input provider and every DeepSeekV4MTPQuantizationModel member except zero_route_recovery_context. Default quantize behaviour is unchanged. The target model never has an `mtp` module (the port ignores mtp.* on load), and out_of_model_tensors still republishes every source mtp.* tensor byte-for-byte, so MTP stays in its native checkpoint form as before. With no sink installed the deleted quantization_layer_output_required override returned False, which is what the BaseQModel default returns. Kept on purpose: - zero_route_recovery_context stays on DeepSeekV4MTPQuantizationModel, unchanged. DeepSeekV4QModel, Dots3NoteQModel, GlmMoeDsaQModel and Glm5NextQModel call it as an unbound method. Moving it belongs to the route-recovery refactor. - The MTP_CAPTURE_* input-capture hooks are live on every DSv4 quantize: they validate labels and add/pop capture metadata. - GLM5-Next layer 45 MTP is live (its loader appends the block and the normal traversal quantizes its routed experts), so glm5_next.py is not touched. The glm_moe_dsa and dots3_note MTP handling is only out_of_model_tensors passthrough/exclusion, so those files are not touched either. Tests for the deleted API are removed. A new CPU test pins the default behaviour: a quantize of a tiny V4 checkpoint republishes its mtp.* tensors byte-for-byte. docs/deepseek-v4-mtp-replay.md is removed, and three doc sentences that cited the deleted code are trimmed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Qubitium
force-pushed
the
refactor/drop-mtp-calibration-stack
branch
from
November 29, 2026 20:48
bd031c2 to
93ee0d8
Compare
This was referenced Nov 30, 2026
Qubitium
added a commit
that referenced
this pull request
Nov 30, 2026
…source, not per-model run_input_capture stashes (#6495) The capture stage passes the same moved example to begin_input_capture_example and run_input_capture. BaseQModel already keeps it as `_layer_type_replay_source` for exactly that span and clears it in end_input_capture_example. Four definitions kept a private copy of that example anyway: - solar_open2, zdtaichu5 and mimo_v2 overrode run_input_capture only to set and restore a `_<model>_capture_*_mask` attribute around super(). Their capture hooks now read `_layer_type_replay_source` instead (with the same 2-D filter for solar_open2/zdtaichu5), and the overrides and `_CAPTURE_*_ATTR` constants are gone. - glm5_next copied `input_ids` in its own begin/end pair. Its capture hook now reads and validates the source `input_ids`. The same RuntimeError/ValueError fire for a missing source or non-rank-2 ids; the ValueError is now raised in the layer-0 hook instead of before the forward. solar_open2 and zdtaichu5 also rebuilt the full-attention and linear-attention masks per layer in prepare_layer_replay_kwargs. Both configs declare `layer_types` (ZDTaichu5's `text_config` property already resolves to `llm_config`), so the base per-layer-type replay already built the same masks on main and the definition overrides only overwrote them with equal tensors. Their capture/replay mask code is deleted. Without a capture override, solar_open2 now qualifies for the GPTAQ/FOEM first-capture reuse (#5831); its checkpoints are bit-identical with and without the reuse. deepseek_v4's begin/end pair is unchanged: it validates labels and derives the MTP decode mask, which #6435 kept on purpose. Tests that set the removed private attributes now go through begin_input_capture_example, and a new solar_open2 test replays a left-padded capture through every layer and checks each mask against the removed builders and each output against the native forward. Co-authored-by: Claude Opus 5.5 <[email protected]>
5 tasks done
Qubitium
added a commit
that referenced
this pull request
Dec 1, 2026
… fold-declaration variants (batch B) Since #6480 a definition without `awq_groups_from_tree_order` plans its AWQ groups from `awq_fold_declarations(layer)`. Its config-conditional `awq_get_modules_for_scaling` post-filters become small variants of the derived folds: * llama: `awq_fold_declarations` returns `[]` for LongLLaMA, StableLM-Epoch, Yi and q/k-norm Cohere/StableLM, else `super()`. * telechat2: drops the two norm folds in post-layernorm residual mode. The `key_value` filter is moved into the tree as `key_value:0:nosrc` (the derived folds never use it: it has no `v` role). * hymba: drops a gateless (relu2) expert's `up_proj -> down_proj` and declares the input-norm fold's replay boundary as `mamba.in_proj` instead of rewriting `module2inspect`. * k2_horizon: drops the input-norm fold on MoVA layers. * gemma4, gemma4_unified (text and composite): `retarget_kv_shared_attention_groups(nodes)` becomes `kv_shared_attention_folds(layer, folds)`, which replays a KV-shared layer's input-norm fold on `self_attn.q_proj` alone. * ovis2_6_moe: deleted. It only called `BaseQModel.awq_get_modules_for_scaling` past Ovis2_5QModel, which no longer overrides it. `_awq_nodes_from_declarations` chose the empty-capture contract by class identity (`type(self).awq_fold_declarations is BaseQModel...`), so any variant would have moved a routed expert's empty `down` capture from the processor's starved-member fallback (#4675) to a skip (#5995). That would have changed Hymba's and Gemma 4's MoE layers, and it is why #6493 kept the K2-Horizon and Gemma 4 node filters. The contract is now the declared `awq_hand_declared_folds` flag, set by the two definitions that write their own folds (PanGu, Inkling); a filter of the derived folds keeps the derived contract. Kept, because removing them changes behaviour or needs a maintainer decision: bloom, chatglm, dbrx_converted, rw, ricursive and nemotron_h still plan from the tree tracker and have drop:width groups (leaving the tracker drops them); nanbeige stays on the tracker for its qk_layernorm tracker gap; kimi_k3's NotImplementedError is a fail-closed guard, not a group filter; cohere_compass re-prepares kwargs until PR 10. raon1_mini was converted in #6493 and the deepseek_v4 MTP override was removed with #6435. `tests/module_tree/awq_fold_inventory.py --check` reports no change for all 210 types; a stress and data-dependent A/B (MHA and coincident-width variants, unrouted experts, absent and empty captures) is equal on all 210 types, and a GPU AWQ A/B is bit-identical. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Qubitium
added a commit
that referenced
this pull request
Dec 1, 2026
… fold-declaration variants (batch B) (#6636) Since #6480 a definition without `awq_groups_from_tree_order` plans its AWQ groups from `awq_fold_declarations(layer)`. Its config-conditional `awq_get_modules_for_scaling` post-filters become small variants of the derived folds: * llama: `awq_fold_declarations` returns `[]` for LongLLaMA, StableLM-Epoch, Yi and q/k-norm Cohere/StableLM, else `super()`. * telechat2: drops the two norm folds in post-layernorm residual mode. The `key_value` filter is moved into the tree as `key_value:0:nosrc` (the derived folds never use it: it has no `v` role). * hymba: drops a gateless (relu2) expert's `up_proj -> down_proj` and declares the input-norm fold's replay boundary as `mamba.in_proj` instead of rewriting `module2inspect`. * k2_horizon: drops the input-norm fold on MoVA layers. * gemma4, gemma4_unified (text and composite): `retarget_kv_shared_attention_groups(nodes)` becomes `kv_shared_attention_folds(layer, folds)`, which replays a KV-shared layer's input-norm fold on `self_attn.q_proj` alone. * ovis2_6_moe: deleted. It only called `BaseQModel.awq_get_modules_for_scaling` past Ovis2_5QModel, which no longer overrides it. `_awq_nodes_from_declarations` chose the empty-capture contract by class identity (`type(self).awq_fold_declarations is BaseQModel...`), so any variant would have moved a routed expert's empty `down` capture from the processor's starved-member fallback (#4675) to a skip (#5995). That would have changed Hymba's and Gemma 4's MoE layers, and it is why #6493 kept the K2-Horizon and Gemma 4 node filters. The contract is now the declared `awq_hand_declared_folds` flag, set by the two definitions that write their own folds (PanGu, Inkling); a filter of the derived folds keeps the derived contract. Kept, because removing them changes behaviour or needs a maintainer decision: bloom, chatglm, dbrx_converted, rw, ricursive and nemotron_h still plan from the tree tracker and have drop:width groups (leaving the tracker drops them); nanbeige stays on the tracker for its qk_layernorm tracker gap; kimi_k3's NotImplementedError is a fail-closed guard, not a group filter; cohere_compass re-prepares kwargs until PR 10. raon1_mini was converted in #6493 and the deepseek_v4 MTP override was removed with #6435. `tests/module_tree/awq_fold_inventory.py --check` reports no change for all 210 types; a stress and data-dependent A/B (MHA and coincident-width variants, unrouted experts, absent and empty captures) is equal on all 210 types, and a GPU AWQ A/B is bit-identical. Co-authored-by: Claude Opus 5.5 <[email protected]>
7 tasks done
Qubitium
added a commit
that referenced
this pull request
Dec 1, 2026
…ranch (#6645) #6435 deleted the DSv4/GLM MTP calibration stack, leaving two mechanisms with no production reader: - The three MTP_CAPTURE_* keys were added to the first-layer capture and popped again at replay. Delete the constants and the metadata round trip; keep the label-shape validation in begin_input_capture_example. - zero_route_recovery_context's zero_route_recovery_uses_router_hooks opt-in is never set, so uses_router_hooks was exactly block_namespace == "base". The else branch installed _gptqmodel_mtp_zero_route_force and _gptqmodel_mtp_normal_mlp_capture_context on the layer module; only tests called them. Delete the branch, the attrs, prepare_router_candidates and pause_normal_mlp_capture; always install the router pre-hook. Every recovery definition resolves to a model.layers decoder block, so the deleted MTP path had no production caller. The recovery tests now drive the production router-hook path. Co-authored-by: Claude Opus 5.5 <[email protected]>
7 tasks done
Qubitium
added a commit
that referenced
this pull request
Dec 1, 2026
… since #6435) The save-state overlay was a hook for an attached auxiliary model to replace tensor prefixes during save. Its only implementer, DeepSeekV4QModel.save_state_overlay, was deleted with the unreachable DeepSeek-V4 MTP calibration stack in #6435; `git grep` plus an AST string/attribute scan over gptqmodel/ (including ports/), tests/, docs/ and examples/ finds no other provider, and the hook is not documented as an out-of-tree extension point. Delete the contract: the provider lookup, the three validators, the tensor-storage merge, the passthrough/state-dict application, and the tests that only exercised the overlay. The EXL3 publication guard and checkpoint passthrough (normal save paths) stay; save_quantized calls them without an overlay. The native-checkpoint-export reference page is updated accordingly. No behavior change: with no provider the removed calls were no-ops. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Qubitium
added a commit
that referenced
this pull request
Dec 1, 2026
… since #6435) (#6667) The save-state overlay was a hook for an attached auxiliary model to replace tensor prefixes during save. Its only implementer, DeepSeekV4QModel.save_state_overlay, was deleted with the unreachable DeepSeek-V4 MTP calibration stack in #6435; `git grep` plus an AST string/attribute scan over gptqmodel/ (including ports/), tests/, docs/ and examples/ finds no other provider, and the hook is not documented as an out-of-tree extension point. Delete the contract: the provider lookup, the three validators, the tensor-storage merge, the passthrough/state-dict application, and the tests that only exercised the overlay. The EXL3 publication guard and checkpoint passthrough (normal save paths) stay; save_quantized calls them without an overlay. The native-checkpoint-export reference page is updated accordingly. No behavior change: with no provider the removed calls were no-ops. Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Summary
This deletes the DeepSeek-V4 integrated MTP (dSpark) calibration stack from
gptqmodel/models/definitions/deepseek_v4.py. Nothing in the tree calls it. The maintainer approved the deletion; it came out of the debloat audit (ds4rt map, row 16).Nothing in the definitions, the looper, the writer,
scripts/or the CLI callsbuild_mtp_quantization_model,DeepSeekV4MTPQuantizationModel.from_target_model/from_auxiliary,attach_mtp_quantization_model,set_mtp_target_tap_sinkorconfigure_mtp_activation_store. Only tests did. So a default quantize never builds the MTP shell, never installs a target-tap sink and never attaches a save overlay.What happens to MTP modules is unchanged, and this is how it works today. The DeepSeek-V4 target model has no
mtpmodule: the port ignoresmtp.*on load through_keys_to_ignore_on_load_unexpected. Themtp.*checkpoint tensors are never quantized. The writer republishes them byte-for-byte throughDeepSeekV4QModel.out_of_model_tensors("prefixes": ["mtp", ...]), which this PR leaves alone. A new CPU test pins this, and the quantize A/B below shows it on a checkpoint that carriesmtp.*tensors.What Changed
Deleted from
deepseek_v4.py(about -2,320 lines of production code):expected_/validate_deepseek_v4_mtp_checkpoint_keys,deepseek_v4_mtp_target_layer_ids,MTP_BLOCK_COUNT),deepseek_v4_mtp_module_tree,deepseek_v4_mtp_checkpoint_mapping_reversed,MTP_ROUTED_EXPERT_MODULE_PATTERNand theMTP_REPLAY_*keys.DeepSeekV4MTPAuxiliaryShell/DeepSeekV4MTPAuxiliaryand their heads, theDeepSeekV4MTPReplay*dataclasses,DeepSeekV4MTPTargetTapEvent,DeepSeekV4TargetAnchorResolver,DeepSeekV4MTPPrefixRuntime,DeepSeekV4MTPReplayand the per-block replay forward.DeepSeekV4QModelmembers:mtp_auxiliary_module_tree;mtp.*branch ofexllamav3_checkpoint_module_candidates, plusdeepseek_v4_mtp_source_projection_prefix;attach_mtp_quantization_modelandsave_state_overlay;set_mtp_target_tap_sinkand itsquantization_layer_output_required/receive_quantization_layer_outputsoverrides;build_mtp_auxiliary,build_mtp_quant_source_module,build_mtp_prefix_runtime,build_mtp_quantization_modelandmaterialize_mtp_replay_submodule._DeepSeekV4MTPPreparedDataset/_DeepSeekV4MTPInputProvider/_DeepSeekV4MTPInputView, and every member ofDeepSeekV4MTPQuantizationModelexceptzero_route_recovery_context: class attributes, the AWQ no-op,after_model_load, the factories,configure_mtp_activation_store, the MTP output writer, input capture,prepare_dataset,build_quantization_input_cache,run_input_capture,pre_quantizeandpost_quantize.Why each deletion leaves live behavior unchanged:
quantization_layer_output_requiredoverride returnedFalse. That is exactly what theBaseQModeldefault (base.py:5762) returns, and the structural A/B shows the same answers on every layer.receive_quantization_layer_outputsis only called when that hook returnsTrue.mtp.*EXL3 modules, so the deletedmtp.*branch ofexllamav3_checkpoint_module_candidateswas only reachable through the attached-adapter overlay.save_state_overlayreturnedNoneunless an adapter was attached. The writer (writer.py:1576) treats a missing provider the same way.Kept on purpose. Each of these is live or out of scope:
zero_route_recovery_context(680 lines) stays onDeepSeekV4MTPQuantizationModel, byte-for-byte unchanged.DeepSeekV4QModel,Dots3NoteQModel,GlmMoeDsaQModelandGlm5NextQModelcall it as an unbound method, andlooper/stage_subset.pycalls it. Moving it belongs to the separate route-recovery refactor. Only the class docstring changes, to say the class now only hosts that method. Keeping the class name avoids touching the three trampolines.MTP_CAPTURE_*input-capture hooks (begin_input_capture_example,end_input_capture_example,capture_first_layer_input_kwargs,prepare_layer_replay_kwargs) run on every DSv4 quantize. They rejectlabelsthat do not matchinput_idswithValueError, and they add then pop capture metadata. That is live behavior, so they stay.glm5_next.py) integrated MTP is live and untouched.Glm5NextQuantizationLoaderalways appendsGlm5NextMTPDecoderLayeras layer 45, and the ordinary layer traversal quantizes its routed experts.glm_moe_dsa.py(layer 78 passthrough) anddots3_note.py(MTP excluded) only declareout_of_model_tensorsand have no calibration code, so they are untouched too. No step5 definition exists in-tree.configure_base_replay_storeand the target-layercreate_quantization_layer_output_writerare not MTP, so they stay.Docs and tests:
docs/deepseek-v4-mtp-replay.mdand its index line.multi_gpu_quantization.md,torch-compile-fallback.mdandvlm-calibration-input-normalization.md.tests/test_deepseek_v4_support.py, 1 intests/test_lazy_turtle_conversion_mapping.py, and 1 assertion intests/module_tree/test_deepseek_v4_local_port.py.test_lazy_turtle_conversion_mapping.pyused a module-leveltry/except ImportError: pytest.skip(...)around the MTP imports. It is now a plain import, so deleting those symbols cannot silently skip the whole file.No public API changes outside the deleted MTP symbols. No numerics or checkpoint-format changes.
Diff (
git diff --shortstat origin/main...HEAD):9 files changed, 160 insertions(+), 3383 deletions(-), of whichgptqmodel/is107 insertions(+), 2419 deletions(-). Git's default Myers diff mis-aligns two hunks. With--diff-algorithm=histogramthe totals are59 insertions(+), 3282 deletions(-), andgptqmodel/is6 insertions(+), 2318 deletions(-): the import trim plus the new docstring.Out of scope. These have no provider or caller in-tree after this PR, and each belongs to another refactor:
quantization_layer_output_required/receive_quantization_layer_outputsbase hooks and theirlooper/stage_layer.pycall sites (:951,:1083,:1387).writer.py:1576,_apply_save_state_overlay,_build_exllamav3_tensor_storage_for_save).EXL3CaptureFrontierStore.discard_through.EXL3Config.module_include, which is public config API and was set in-tree only by the deletedfrom_auxiliary.Tests
New test:
tests/test_deepseek_v4_support.py::test_default_quantize_keeps_integrated_mtp_tensors_native. It runs a CPU RTN quantize and save of a tiny V4 checkpoint that carriesmtp.*tensors. It asserts the model has nomtpmodule and that everymtp.*tensor is saved with the same dtype and values. It passes on bothorigin/mainand this branch.Pytest A/B, CPU,
CUDA_VISIBLE_DEVICES="",PYTHONPATH=<tree>,python -P;gptqmodel.__file__printed for each tree:After rebasing onto
a4471c53b, which touchedtest_lazy_turtle_conversion_mapping.py,utils/structure.pyand a docs index, the affected set was rerun:python -P -m pytest tests/test_deepseek_v4_support.py tests/test_lazy_turtle_conversion_mapping.py tests/test_docs_contract_refs.py \ tests/module_tree/test_deepseek_v4_local_port.py tests/test_deepseek_v4_local_port.py tests/test_model_port_policy.py \ tests/test_glm5_next_support.py tests/test_glm5_next_upstream_support.py tests/test_glm_moe_dsa_support.py \ tests/module_tree/test_dots3_note_fork_plan.py tests/module_tree/test_registered_module_plans.py \ tests/module_tree/test_flash_model_tree_consumption.py tests/test_writer_state_overlay.py tests/test_out_of_model_tensors.py \ tests/test_transformers_unpatched.py # origin/main a4471c53b: 929 passed; branch: 911 passed; 910 common nodes identical; -19 deleted, +1 new (passed)Opt-in coverage, A/B:
pytest tests/module_tree/test_moe_expert_coverage.py -m meta_coverage -k "deepseek_v4 or dots3_note or glm5_next or glm_moe_dsa". Both trees gave the same result: glm5_next passed, deepseek_v4 and glm_moe_dsa xfail (installed Defuser leaves the experts fused), and dots3_note skipped (same Defuser reason).bash format/check.sh:All checks passed!(ruff 0.14.2).Skips. They are the same 823 on both trees. All are CUDA/ROCm hardware gates, Marlin qualification, opt-in
meta_coverage, or the registry's "not constructible offline" entries. In the touched files the only skips are 5 DeepSeek-V4.1 CUDA/SM80 tests inmodule_tree/test_deepseek_v41_flash.py, so the V4.1 CUDA paths are not verified here. This PR does not touch V4.1.Structural A/B
The script (
structural_dump.py, run on each tree withPYTHONHASHSEED=0, then diffed) checks the following:gptqmodel.*module (1522). Import failures are identical (13, all from optional dependencies). The only module whose names change isdefinitions.deepseek_v4, which loses exactly the deleted symbols.MODEL_MAPis identical (210 entries).ModulePlan.from_tree(cls.module_tree).to_dict()is identical for all 186 MODEL_MAP definitions.BaseQModelsubclass graph is identical. That includesDeepSeekV4MTPQuantizationModel(DeepSeekV4QModel).DeepSeekV4QModeldiffers: the deleted members, the trimmedexllamav3_checkpoint_module_candidates, and the two output hooks now resolving toBaseQModel.Glm5NextQModel,GlmMoeDsaQModelandDots3NoteQModelare identical.module_plan().to_dict(),simple_layer_modules, the per-parameter plan owner/flags/roles, and the hook answers are identical. The hook answers checked:quantization_layer_output_requiredisFalseon every layer, the output writer isNone, the save overlay isNone, the target EXL3 candidates match, and there is nomtpmodule.Quantize A/B (CPU; no GPU needed, and no GPU was used)
The source is a tiny random DeepSeek-V4 checkpoint (3 layers, hidden 64, 3 routed experts) with 5 native
mtp.*tensors injected (BF16 and FP32). BothGPTQConfig(bits=4, group_size=-1, device="cpu")andRTNConfig(...)were run, each withGPTQModel.load→quantize(CalibrationConfig(4 fixed-seed rows))→save. The runs usedorigin/main(2fc316926, thena4471c53bafter the rebase) and this branch.mtp.*) are bit-identical.config.json,quantize_config.json,generation_config.jsonand the tokenizer files are identical. Thequant_log.csvrows (layer, module, loss, samples, damp) are identical. Row order and the time column differ run to run; two runs oforigin/mainagainst itself differ the same way.Measured Impact
Not applicable. This is a code deletion with bit-identical output.
Model Support / Module Plan
There are no new model types and no plan changes. Registry and model plans are proven identical by the structural A/B above, and
tests/module_tree(the full directory) passes with identical outcomes.Model test node IDs and results: see Tests.
tests/module_tree/test_registered_module_plans.py,tests/module_tree/test_deepseek_v4_local_port.pyandtests/module_tree/test_dots3_note_fork_plan.pyall passed on both trees.AWQ onboarding safety
Not applicable. No AWQ grouping, search, replay or fold changes. The deleted
DeepSeekV4MTPQuantizationModel.awq_get_modules_for_scalingreturned[]for an adapter nothing builds. The DSv4 target AWQ tests (test_awq_scale_folds_preserve_real_hyper_connected_layer_output,test_featureless_awq_quantizes_and_packs_all_supported_linears,tests/test_awq_deepseek_v4_*) passed on both trees.Logic Flow Documentation
Not applicable. It removes code no flow reaches and replaces no decision mechanism. The default DSv4 quantize flow (capture → layer loop → writer with
out_of_model_tensorspassthrough formtp.*) is unchanged.Review Requirements
Kernel Accuracy Requirements
Not applicable. No kernel changes.
Notes
DeepSeekV4MTPQuantizationModelstays only as the host ofzero_route_recovery_context, so this PR is pure deletion and does not move 680 lines. The route-recovery refactor can turn it into a plain function and drop the class.DeepSeekV4MTPAuxiliary,DeepSeekV4MTPAuxiliaryShell,DeepSeekV4MTPPrefixRuntime,DeepSeekV4MTPReplay*,DeepSeekV4MTPTargetTapEvent,DeepSeekV4TargetAnchorResolver,deepseek_v4_mtp_*,expected_/validate_deepseek_v4_mtp_checkpoint_keys,MTP_BLOCK_COUNT,MTP_REPLAY_*,MTP_ROUTED_EXPERT_MODULE_PATTERN, and theDeepSeekV4QModel.build_mtp_*/attach_mtp_quantization_model/set_mtp_target_tap_sink/save_state_overlaymethods.🤖 Generated with Claude Code