Repository navigation
chore(ds4rt): delete plumbing left without callers - #6660
Merged
Merged
Conversation
Remove the ds4rt paths that no longer have a caller on main: - Drop the DS4/GLM `configure_base_replay_store` and `create_quantization_layer_output_writer` model hooks and the generic `ForwardExecutor` hook dispatch. `CalibrationConfig.spill_path` (G2) is the only output-collection path now. - Drop GLM5's `_prune_glm5_next_replay_frontier`, reachable only from the deleted hook. - Drop the never-written `distributed_quant_device` state read in `build_subset_plan`. - Retire `EXL3Config.module_include`: old checkpoints still load and warn once, but quantization now raises with a `dynamic` negative-rule example instead of silently quantizing every module; `to_dict()` stops emitting it. The test-only `offload_to_safetensors_reference` fixture, the #3585 shard-reuse probe and LazyTurtle remain because they still have callers or nothing is left in tree. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Qubitium
force-pushed
the
refactor/ds4rt-x1-dead-plumbing
branch
from
December 1, 2026 15:03
0728943 to
c08da01
Compare
Qubitium
marked this pull request as ready for review
December 1, 2026 17:39
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
Delete the ds4rt plumbing that no longer has a caller on current
main: the DS4/GLM base-replay model hooks, the never-writtendistributed_quant_deviceread, and the retiredEXL3Config.module_includeallowlist.module_includestays accepted so existingquantize_config.jsonfiles still load; it warns once on load, quantization rejects it with aValueError, and re-saving drops it. The items that still have live callers (the test-only safetensors-reference fixture, the #3585 shard-reuse probe, LazyTurtle) are left alone and listed below.What Changed
configure_base_replay_store/create_quantization_layer_output_writerfromDeepSeekV4QModel,GlmMoeDsaQModelandGlm5NextQModel, and removed the generic model-hook dispatch inForwardExecutor._output_collection.CalibrationConfig.spill_path(G2, feat(calibration): CalibrationConfig.spill_path streams layer inputs to disk for every processor #6656) is now the only output-collection path._prune_glm5_next_replay_frontier; it was reachable only through the deleted writer hook (and its dedicated test).named_module.state["distributed_quant_device"]read inbuild_subset_plan; no production code ever wrote the key.EXL3Config.module_include: the field is still accepted for checkpoint compatibility and warns once, butEXL3Processorsetup andclone_exllamav3_config_for_module(the DeepSeek V4.1 flash projection path) now reject it with aValueErrorinstead of silently quantizing every module.to_dict()no longer emits it. The replacement isdynamicnegative rules.tests/test_stage_modules.py::test_forward_executor_run_single_streams_outputs_through_model_writer,::test_forward_executor_run_single_skips_durable_output_batch,tests/test_deepseek_v4_support.py::test_deepseek_v4_configures_base_replay_store_with_resolved_path,tests/test_glm5_next_support.py::test_replay_frontier_prunes_only_older_exact_layer_directories, andtests/test_subset_plan.py::test_build_subset_plan_preserves_distributed_family_device_assignment. The twomodule_includeallowlist tests were replaced by three tests: load/warn/re-save, quantize-time rejection, and thedynamicnegative-rule equivalent.Item-by-item audit (all checked on
origin/main=f442095e2)offload_to_safetensors_referencegit grepfinds no definition ingptqmodel/; the only definition is the test fixturetests/offload_test_utils.py:68, called from 6 tests intests/test_offload_files.py(:495,2291,2355,2389,2424,2496).get_state_dict_for_save/_module_source_reference_index); deleting it would drop that coverage, not dead production code._existing_shard_matchesis defined atgptqmodel/utils/model.py:6123and called at:6341insidestreaming_state_dict_to_shards, whichwriter.py:2331,3088and the DeepSeek V4.1 flash writer still call.git grepfinds no class, method orconfigure_active_source_stagingingptqmodel/; only four historical docstrings inweight_loader/mention the name (they describe whatCheckpointSourcereplaced).EXL3Config.module_include_OUTPUT_FIELDSentry, validated in__post_init__, used bymodule_is_included()and the processor filter.git grepfound no production setter after the earlier ds4rt removals.gptqmodel/quantization/config.py+17/−39,gptqmodel/looper/exllamav3_processor.py+13/−3; tests +67/−18). Old configs load and warn once; re-saving drops the key; quantization raisesValueErrorwith thedynamic-negative-rule example. A test pins that the example rule excludes exactly the modules the old allowlist excluded.configure_base_replay_store/create_quantization_layer_output_writerForwardExecutor._output_collection(agetattrstring lookup) and twotests/test_stage_modules.pytests that installed a fake. G2 #6656 replaced the path withCalibrationConfig.spill_path. An AST scan for the names as attributes /getattrstrings / subscripts now returns 0 hits.deepseek_v4.py,glm_moe_dsa.py,glm5_next.py,forward_executor.py; 193 lines deleted, 1 added net of imports). The GLM5-only prune helper and its test went with it.named_module.state["distributed_quant_device"]stage_subset.py:595; the only writer anywhere wastests/test_subset_plan.py:244inside the dedicated test. AST scan for the string returns 0 hits.stage_subset.pyread and the dedicated test; -56 lines).git grepof every deleted symbol indocs/returns no hits. The 9docs/exl3-*.mdpages anddocs/looper-causal-replay.mddocument EXL3/looper code that E1 has not deleted, so they are not pages that document X1-deleted code.tests/test_docs_contract_refs.pypasses (267 passed).Tests
CPU,
python -P, clone first onPYTHONPATH,CUDA_VISIBLE_DEVICES=(the host has no usable NVIDIA driver):E2 (the 486-file
e2_files.txtlist used by the previous wave), one pytest process per file, 32-way, 1200 s per file, basef442095e2vs this branch (run before the final rebase onto0127a0313; #6657 only touches AWQ fold code and its tests, none of the files here):{0: 462, 1: 13, 5: 8, 124: 3}vs branch{0: 463, 1: 13, 5: 8, 124: 2}.pass -> absent, oneabsent -> pass) andtests/test_checkpoint_quantization.py: it hit the 1200 s per-file cap on base under the 32-way load, then passed alone with a 1800 s cap (54 passed, 4 skipped in 915 s); the branch passed it in the E2 run (54 passed, 4 skipped in 1044 s).test_cohere_compass,test_deepseek_vl,test_deepseek_vl_v2,test_openvla,test_config_numeric_validation_5437,test_local_model_loading,test_local_model_paths,test_model,test_norm_teacher_loading,test_quantization_lifecycle_contracts,test_smolvlm_support,test_zdtaichu5_support(network/HF-cache/known config failures), plustests/kernels/test_intel_cpu_xpu.py(network).tests/models/test_solar_open.pyandtests/models/test_solar_open2.pytime out (exit 124) on both sides; unchanged.tests/kernels/test_exllamav3_quantize_tiles.pyis CUDA-gated and skipped on this host; its only change is removing the retiredmodule_includekwarg.No save/writer/offload production code changed, so the bytewise save A/B is not applicable; the shard-reuse and reference-offload code paths are untouched (kept, as shown above).
Measured Impact
Not applicable: dead-code deletion plus a fail-closed retirement. The only behaviour change is that a legacy
EXL3Config(module_include=...)now loads with a warning but raises at quantize time instead of silently filtering modules; the new tests cover that transition.Model Support / Module Plan
Not applicable: no new model, alias or definition, and
awq_fold_inventory.py --checkreportschanged: none.AWQ onboarding safety
Not applicable: no AWQ grouping, search, replay or fold code changed.
Logic Flow Documentation
Not applicable: the change deletes unreachable branches rather than replacing a decision mechanism. The one retired decision (
module_include) is documented in the Notes and covered by the threemodule_includetests intests/test_exllamav3.py; no new Mermaid flow is warranted for deleting dead branches.Review Requirements
Kernel Accuracy Requirements
Not applicable: no kernel, dispatch, pack or fusion code changed.
Notes
quantize_config.jsoncontainingmodule_includestill loads;EXL3Config.__post_init__logs one warning and keeps the field so the quantize-time guard can reject it.to_dict()stops re-emitting it, so a re-save cleans the checkpoint. Quantizing withmodule_includeraises:EXL3Config.module_include was retired; express the allowlist withdynamicnegative rules, e.g. {'-:^(?!model\.layers\.\d+\.mlp\.experts\.).*': {}}. The testtest_exllamav3_dynamic_negative_rule_replaces_module_include_allowlistverifies that rule againstdynamic_getandresolve_module_config(...).excluded.offload_to_safetensors_referencefixture,_existing_shard_matches(the final save still calls it), LazyTurtle (already gone; docstrings only), and the ds4rt docs pages that describe still-live E1 code.docs/safetensors-reference-offload.mdstill diagrams theoffload_to_safetensors_referencefunction that R5 removed from production. That page also documents live reference-index/export-guard behaviour, so it is not an X1 deletion; fixing it belongs with the R5 docs cleanup.0127a0313(fix(awq): keep a declared fold whose first reader captured nothing #6657). After the rebase the targeted suites were rerun (279 passed, 8 skipped),format/check.shpassed, and the docs/inventory checks were rerun; the E2 table above is from the pre-rebase base because fix(awq): keep a declared fold whose first reader captured nothing #6657 does not overlap this change./dev/nvidia*absent), so the CUDA-marked tests were skipped and no GPU A/B was run; the touched default paths are CPU-covered above.🤖 Generated with Claude Code