Repository navigation
refactor(exl3): drop the unwired completed-checkpoint-tree restore API - #6399
Merged
Merged
Conversation
f293733 (#3601) carried a completed-checkpoint-tree restore layer from the ds4rt working fork into EXL3Processor. The later looper and model layers that were meant to call it never landed. Nothing in gptqmodel/, scripts/, docs/ or tools/ calls it; only tests/test_exl3_projection_resume.py did. Removed from gptqmodel/looper/exllamav3_processor.py: - completed_layer_checkpoint_entries, _completed_checkpoint_tree_entries - restore_completed_checkpoint_tree_if_complete (built a processor with cls.__new__ and skipped __init__) - restore_completed_layer_checkpoints, defer_completed_layer_checkpoints, offload_restored_layer_checkpoints - release_host_memory and its only helper _malloc_trim, and discard_capture_frontiers_through - the seven imports that only these methods used Also removed: the seven tests that called these methods, the release_host_memory tail of the capture-memory-summary test (the summary assertions stay), and the "completed checkpoint-tree publication" phrase in docs/exl3-durable-execution.md. This does not touch the live EXL3 paths: projection-checkpoint hits in _process_on_slot, capture frontiers, batch spool, inline mixed tiers, zero-route recovery, remote slots and deferred runtime weights. The quantization_layer_boundary_checkpoint protocol is also left alone; it moves into LoopExtensions in a separate PR. In-tree runtime behaviour does not change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Qubitium
marked this pull request as ready for review
November 29, 2026 14:23
Qubitium
pushed a commit
that referenced
this pull request
Nov 29, 2026
This was referenced Nov 29, 2026
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 removes the EXL3 completed-checkpoint-tree restore API from
EXL3Processor. Nothing in the tree calls it. It was carried in from the ds4rt working fork in f293733 (#3601), and the looper and model layers that were meant to call it never landed (docs/exl3-durable-execution.md: "Standalone store/policy APIs are connected by the later processor, looper and model layers"). The only callers were tests intests/test_exl3_projection_resume.py. The maintainer approved removing it instead of wiring it throughLoopExtensions.Net diff: 3 files changed, 4 insertions(+), 1309 deletions(-). In-tree runtime behaviour, numerics, checkpoint format and every live EXL3 path are unchanged.
What Changed
gptqmodel/looper/exllamav3_processor.py(-746): theseEXL3Processormethods are removed:completed_layer_checkpoint_entries,_completed_checkpoint_tree_entriesrestore_completed_checkpoint_tree_if_complete, a classmethod that built a processor withcls.__new__and skipped__init__restore_completed_layer_checkpoints,defer_completed_layer_checkpoints,offload_restored_layer_checkpointsrelease_host_memoryand_malloc_trim, which only it used, plusdiscard_capture_frontiers_throughgc,PROJECTION_ORDER,projection_score,malloc_trim,recurse_setattr,offload_to_disk,offload_to_safetensors_referencetests/test_exl3_projection_resume.py(-562 net): the seven tests that called the removed methods are deleted:test_completed_layer_deferral_replaces_packed_storage_with_meta_shelltest_completed_layer_deferral_normalizes_disk_offloaded_meta_shelltest_restore_completed_layer_installs_packed_modules_without_hessiantest_restore_completed_layer_rejects_duplicate_existing_historytest_complete_inline_mixed_mtp_tree_restores_without_replaytest_partial_inline_mixed_mtp_tree_does_not_mutate_modeltest_corrupt_inline_mixed_tier_plan_is_not_replayedThe
_inline_mtp_restore_fixturehelper goes with them.test_capture_memory_summary_attributes_cache_model_and_heap_releaseloses only itsrelease_host_memorytail and is renamedtest_capture_memory_summary_attributes_cache_and_model. Itscapture_memory_summaryassertions are unchanged. The tier-plan validation thattest_corrupt_inline_mixed_tier_plan_is_not_replayedreached is still covered directly bytests/test_exl3_inline_mixed.py::test_tier_plan_store_load_authenticates_complete_contract.docs/exl3-durable-execution.md: the "completed checkpoint-tree publication" phrase is removed.No public API change for in-tree callers. Out-of-tree ds4rt drivers that called these public methods would stop working; the maintainer approved this.
Zero-caller check. On origin/main, each removed name was grepped across
gptqmodel/ scripts/ docs/ tools/ tests/and the root*.mdfiles. There is noexamples/directory. There are no hits outsideexllamav3_processor.pyitself andtests/test_exl3_projection_resume.py. That includesgetattrstring probes instage_layer.py,stage_subset.py,module_looper.pyandforward_executor.py.DeepseekV4callsEXL3CaptureFrontierStore.discard_throughdirectly, notdiscard_capture_frontiers_through.Out of scope, intentionally:
The
quantization_layer_boundary_checkpointprotocol instage_layer.pyandmodule_looper.pyis not touched. A follow-up PR folds it intoLoopExtensions.The utils-layer APIs these methods used stay. Each has its own tests and docs page, and after this PR none has a production caller:
gptqmodel/utils/offload.py::offload_to_safetensors_reference, withdocs/safetensors-reference-offload.md, and the EXL3 notes indocs/in-session-model-after-offload.mdanddocs/offload-run-directories.mdEXL3ProjectionCheckpointStore.committed_tensor_pathInlineMixedTierPlanStore.loadThese are candidates for a separate cleanup.
The debloat map also suggests folding the three
build_projection_record(...)calls in_process_on_slotinto one closure. That touches a live path, so it is left for a separate change to keep this PR a pure removal.Tests
The same command was run on origin/main (1615acc) and on this branch, on one NVIDIA GPU.
gptqmodel.__file__was printed to prove which tree was imported:The selection is every
tests/test_exl3_*andtests/test_exllamav3*file, every test that importsEXL3Processororexllamav3_processor, and the host-memory and offload suites behind the removed imports. These are the CUDA and CPU EXL3 tests.The 13 skips are identical on both trees. Here is what each leaves unverified:
test_exl3_dispatch_concurrency.py:151(x2),:364,test_exl3_workspace.py:342: these need a free-threadedPYTHON_GIL=0build, so concurrent native dispatch under GIL=0 is not exercised here.test_exl3_moe_dp_hessian_owner_5093.py:335,373,test_exl3_workspace.py:138: these need two CUDA devices, so the multi-GPU data-parallel Hessian owner and thecuda:1workspace are unverified.test_exl3_moe_owner_hessian_order_5518.py:130: the owner=False reduction runs on the capture-source CUDA devices and is skipped in this layout.test_exl3_rng_isolation.py:13: reports "CUDA device unavailable" under this device mask.test_exllamav3.py:366(x2): ROCm only.test_exllamav3_cpu.py:260(x2): BF16 takes the native EXL3 path when CUDA is present, so the CPU BF16 path is not exercised here.None of the skipped tests touch the removed code. After the rebase onto 382721e (no touched file changed),
tests/test_exl3_projection_resume.py tests/test_exl3_route_evidence.py tests/test_exl3_capture_frontier.py tests/test_qwen4_exp_exl3_contracts.py tests/test_exl3_inline_mixed.pygave 37 passed.Lint:
ruff check gptqmodel gptqmodel/models/ports/native/auto/__init__.py gptqmodel/models/ports/native/auto/_registry.py docs/eora tests setup.pyreportsAll checks passed!with ruff 0.14.2. This is the same commandformat/check.shruns. On this host the script's ownpip install ruff==0.14.2step stops on PEP 668, so the lint step was run directly.Structural A/B
The script hashes
inspect.getsourceof everyEXL3Processormember and every module-level object ofgptqmodel.looper.exllamav3_processor, on origin/main and on the branch:Only the intended names are gone. All 70 remaining members and 128 module objects have byte-identical source.
__firstlineno__moves because lines were removed above the class body.GPU A/B (EXL3 quantize, save, compare)
Qwen/Qwen2.5-0.5B-Instruct was quantized with
EXL3Config(bits=4, offload_to_disk=X)for both X=True (the default) and X=False. Both trees used bf16, seed 0, the first 64 wikitext-2 train rows longer than 200 characters as calibration, andbatch_size=4. Peak CUDA allocation was 891 MiB. Every saved tensor was then compared bit-for-bit.model.safetensors, all 794 tensors (168 trellis)config.json,quantize_config.json,generation_config.json, tokenizer filesquant_log.csv(layer, module, loss, loss_kind, samples, damp)timecolumnds4rt-exl3-error-ledger.jsonl(168 records)duration_seconds, and therecord_sha256and manifestledger_sha256derived from itMeasured Impact
Not applicable: dead code is removed and nothing in-tree runs differently. The GPU A/B above shows identical output.
Model Support / Module Plan
Not applicable: no model definitions, aliases or module plans change.
AWQ onboarding safety
Not applicable: AWQ is not touched.
Logic Flow Documentation
Diagram summary: not applicable. The removed methods were not reachable from any in-tree entry point, so no live control flow, selection order or tensor lifecycle changes. The structural A/B shows that every remaining member is source-identical.
Review Requirements
Kernel Accuracy Requirements
Not applicable: no kernel, dispatch or fusion code changes. Saved EXL3 tensors are bit-identical, as shown above.
Notes
EXL3Processor.restore_completed_checkpoint_tree_if_complete,restore_completed_layer_checkpoints,defer_completed_layer_checkpoints,offload_restored_layer_checkpoints,release_host_memoryordiscard_capture_frontiers_throughwould break. The maintainer approved removing them.getattrhooks into base methods, so that change does not need defaults for these methods.🤖 Generated with Claude Code