Repository navigation
chore(exl3): delete remote workers and inline mixed tiers - #6413
Merged
Merged
Conversation
ds4rt is deprecated. This removes two of its EXL3-only features that have no in-tree enabler and were never validated on a real model: - Remote workers (utils/exl3_remote.py). The HTTP client, HMAC tensor envelopes, file-locked slot-assignment store and pipelined slot leases shipped quantize_exl3 requests to external workers. No worker server exists in the repository; execute_remote_projection had no caller. The only switch was meta.ds4rt_error_ledger.run.remote_workers plus a token env var. - Inline mixed tiers (utils/exl3_inline_mixed.py). Quantize every routed projection at K, score it, then requantize per-layer quota winners at K+1 from a retained Hessian. It was switched on only by meta.ds4rt_inline_mixed / ds4rt_inline_mixed_by_namespace and needed the projection-checkpoint and capture-frontier stores. The Hessian diagnostics that the default EXL3 path still uses (exl3_quantization_failure_message, validate_exl3_hessian_metrics, EXL3_HESSIAN_CAPTURE_CONTRACT) move verbatim to utils/exl3_diagnostics.py, and the processor and the deepseek_v41_flash port import them from there. EXL3Processor.process now quantizes directly. The slot lease, the remote branch, the candidate/selected tier passes, _publish_inline_candidate, _requantize_inline_selected and prepare_layer_replay are gone. The looper's prepare_layer_replay hook had no other implementer, so its LoopProcessor no-op and the stage_layer call go too. EXL3ProjectionCheckpointStore loses the inline tier reservation keys and prune(), whose only caller was the remote worker. The retired meta keys warn instead of silently changing behaviour. _RETIRED_META_KEYS in quantization/config.py follows the _RETIRED_KERNEL_ENV_VARS pattern. _normalize_meta, now shared by BaseQuantizeConfig and EXL3Config, warns once per key. to_dict() drops the keys, so re-saving cleans a config. A dotted key names a nested entry, and later ds4rt retirements can extend the table. With the keys absent, which is the only in-tree state, the remaining code is the path that already ran: EXL3 quantize of Qwen2.5-0.5B-Instruct with EXL3Config() defaults is byte-identical in model.safetensors and every json for offload_to_disk True and False. Two always-None stat columns (exl3_execution_contract, exl3_inline_mixed) leave the processor log rows. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Qubitium
marked this pull request as ready for review
November 29, 2026 15:23
Qubitium
pushed a commit
that referenced
this pull request
Nov 29, 2026
One conflict, gptqmodel/looper/loop_processor.py: #6413 deleted ``LoopProcessor.prepare_layer_replay`` along with the remote-worker and inline-mixed-tier machinery, while this branch had inserted its new ``publish`` / ``dispatch_inline`` / ``on_inline_source_replaced`` methods immediately before it. Keep the three fusion methods and drop ``prepare_layer_replay``: it has no remaining caller in the merged tree (only the unrelated ``prepare_layer_replay_kwargs`` survives), so keeping it would resurrect a method main deliberately removed.
Qubitium
added a commit
that referenced
this pull request
Nov 29, 2026
…ish tail (#6429) GPTQ (and GPTAQ/FOEM through it), QQQ, VPTQ, MACaQ, Paro and the weight-only processors each carried their own copy of three blocks: - the per-module log row: identity columns, loss/samples/damp/time/fwd_time, optional extras and the `dynamic` column, the locked durations/avg_losses/ module_names/log appends, and `log_new_row`; - the 15-keyword `create_quant_module(..., register_buffers=False, install=False)` call derived from the processor's config, wrapped in the `create_quant_module` timing block; - the #5089 publish tail: `install_quant_module` under the parent module lock, then `unregister_parameter("weight")`. LoopProcessor now owns `record_stat_row`, `build_quant_module` and `publish_quant_module`. Each call site passes only what varies today: its damp string, extra columns (GPTQ's memory and workspace columns, Paro's memory column), `dynamic=False` for Paro, `backend`/`init_kwargs`/`dtype`, MACaQ's raw `format`, Paro's resolved `format` and per-module `init_kwargs`, and the weight-only processor's active config. Key order, and therefore the console table and quant_log column order, is unchanged. The `result_pop(module.full_name)` calls in the GPTQ, QQQ, VPTQ and MACaQ publish tails are dropped: those processors never call `result_save`, so the pops always missed (only EoRA stores results). EXL3 (journal lock, deferred inline-candidate stats, open #6413 rewrites this block), EoRA (no loss columns), the weight-only stat row (untracked, no dynamic column) and AWQ (different columns and config source) keep their own code. No numerics, checkpoint-format or public-API change. Co-authored-by: Claude Opus 5.5 <[email protected]>
12 tasks done
Qubitium
added a commit
that referenced
this pull request
Dec 1, 2026
…nly and exl3 (#6677) PR #6429 added `LoopProcessor.record_stat_row`, `build_quant_module` and `publish_quant_module` and moved GPTQ (GPTAQ/FOEM), QQQ, VPTQ, MACaQ, Paro, NVFP4, TETRA and TWLA onto them. It left four stat-row copies behind: EoRA (no loss columns), the weight-only processor (untracked rows, no dynamic column), EXL3 (private stats lock, extra workspace columns) and AWQ (different columns and config source; out of scope). Finish the three non-AWQ copies: - `record_stat_row` gains `include_loss=False` (EoRA rows describe adapter fitting and have no loss/samples/damp columns) and `track=False` (weight-only rows are published without appending to durations, avg_losses or module_names), and returns the row it published (EXL3 returns its stat). - EoRA passes the measured `(v)ram` as `extra` with `include_loss=False`. - Weight-only passes `(v)ram`/`lifecycle` as `extra` with `track=False` and `dynamic=False`. - EXL3 builds its `(v)ram`, `loss_kind`, `exl3_*` and optional workspace columns into one ordered `extra` dict and appends the row under the shared `self.lock` instead of `_stats_lock`; every other reader and writer of the row state already uses `self.lock`. The two `__new__` test fixtures that call `process` get a lock. The map's EXL3 `defer_stats` branch no longer exists (removed by #6413), so there is no deferred path to keep. Key order, row values (except time and the live memory measurement), `durations` length, `module_names` and the installed/saved state are unchanged. The CPU A/B covers weight-only RTN, EoRA plus the GPTQ control and an EXL3 stubbed-quantizer run; the GPU 4 A/B on Llama-3.2-1B GPTQ, QQQ and MACaQ is bit-identical and quant_log.csv is identical except the time column. 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
ds4rt is deprecated. Its generic features are moving into method-agnostic code, and its unvalidated, unreachable pieces are being deleted. This PR deletes two EXL3-only ds4rt features that nothing in the repository can switch on (PR D2 of the ds4rt deprecation plan):
gptqmodel/utils/exl3_remote.py, 1,359 lines). An HTTP (http://only) client with HMAC tensor envelopes, a file-locked, hard-link-published slot-assignment store, and pipelined slot leases that shippedquantize_exl3requests to external workers. No worker server exists in-tree.execute_remote_projectionhad no caller, and the only switch wasmeta.ds4rt_error_ledger.run.remote_workersplus a token env var named in that meta.gptqmodel/utils/exl3_inline_mixed.py, 566 lines). Quantize every routedw1/w2/w3projection at K, score it, pick exact per-layer quotas, and requantize the winners at K+1 from a retained Hessian. It was switched on only bymeta.ds4rt_inline_mixed/meta.ds4rt_inline_mixed_by_namespace, and it required the projection-checkpoint and capture-frontier stores.Net diff: 26 files, +756 / -4,280 (net -3,524). Production code is about -2,000 lines.
With these keys absent, which is the only state any in-tree caller produces, the code that remains is exactly the path that already ran. A user who sets a removed key now gets a once-per-key warning, and the run does not silently change.
What Changed
exl3_quantization_failure_message,validate_exl3_hessian_metrics, their private helpers andEXL3_HESSIAN_CAPTURE_CONTRACTmove to the newgptqmodel/utils/exl3_diagnostics.py. The default EXL3 path uses them. An AST check confirms every moved function body is identical to its origin/main source. Their importers are updated:exllamav3_processor.pyandports/deepseek_v41_flash/gptq.py:140.EXL3Processor.process()now quantizes directly. The oldprocess→_process_on_slotslot-lease wrapper is folded into it.preprocess,_remote_client_for_run,_projection_assignment_key, the candidate/selected tier passes,_inline_mixed_policy,_publish_inline_candidate,_requantize_inline_selected,prepare_layer_replay, the inline Hessian demotion incommit_subset_capture_frontier,_hydrate_capture_frontier(retain_for_inline=),_build_quant_args(bits_override=)andinline_mixed_candidate_journal_path.LoopProcessor.prepare_layer_replayand itsstage_layer.pycall are removed. Inline tiers were the only implementer.prepare_layer_post_quantize(EXL3, MACaQ) andprepare_layer_replay_keep_mask(g2ptq) are separate hooks and stay.EXL3ProjectionCheckpointStore. It loses the inline-tier reservation keys (_module_request_key) andprune(). The remote worker wasprune()'s only caller; its docstring already said "Coordinator stores never call this method". Reservation is now one request digest per module, which is exactly what uniform requests already got. The stored result keeps"execution_contract": None, so the result schema is unchanged.quantization/config.py). The design follows_RETIRED_KERNEL_ENV_VARS:_RETIRED_META_KEYSlistsds4rt_error_ledger.run.remote_workers,ds4rt_inline_mixedandds4rt_inline_mixed_by_namespace. A dotted key names a nested entry. Later ds4rt PRs extend this table._normalize_metareplaces the identical meta-validation block thatBaseQuantizeConfig.__post_init__andEXL3Config.__post_init__each had. It warns once per retired key: "meta.<key>is retired and has no effect; the feature was removed."to_dict()drops retired keys, so re-saving a config cleans it. Sibling provenance such asrun.projection_checkpointstays.docs/exl3-remote-workers.mdanddocs/exl3-inline-mixed-tiers.mdand their index links.docs/looper-checkpoint-redesign.md.docs/exl3-durable-execution.md.pytorch_gil_0_compat.mdpoints at the moved diagnostics.tests/test_exl3_inline_mixed.py.tests/test_exl3_diagnostics.py.TestRemoteContract(4995) keeps its two non-remote cases asTestUncalibratedContract.tests/test_exllamav3.py::test_retired_ds4rt_meta_keys_warn_once_and_are_not_saved[exl3|gptq].Behaviour visible to users who set none of these keys. Two stat keys were always
Nonewithout remote/inline:exl3_execution_contractandexl3_inline_mixed. They leave the EXL3 stat rows, the console table and the processor's temp JSON log.quant_log.csvhas fixed columns and is unchanged.Out of scope, left for later ds4rt PRs.
ds4rt_hessian_owner_policy: PR E2._distributed_local_quant_lockkeeps its name, because tests reference it.Tests
Every run uses
/root/venv/bin/python -Pwith the tree first onPYTHONPATH, andgptqmodel.__file__was printed for each tree. Base is origin/main7a4b26852; the branch was then rebased onto407298ad2. #6395 touches none of this PR's files.EXL3 CPU families, both trees, CUDA hidden (
CUDA_VISIBLE_DEVICES="").TestUncalibratedContractcases and 2 new retired-key tests.tests/module_tree/test_deepseek_v41_flash.py(TypeError: Unsupported DeepSeek V4.1 Flash load arguments: tokenizer), which this PR does not change. They are not caused by this PR.Touched families with CUDA (RTX 4090, GPU 3), both trees.
CUDA_VISIBLE_DEVICES=3 pytest -q -rs tests/test_exl3_zero_sample_fallback_4995.py tests/test_exl3_projection_checkpoint.py \ tests/test_exl3_projection_resume.py tests/test_exl3_cancelled_run_5083.py tests/test_exl3_workspace_release.py \ tests/test_exllamav3.py tests/test_exl3_capture_frontier.py tests/test_exl3_diagnostics.py tests/test_qwen4_exp_exl3_contracts.py \ tests/test_quantize_config_offload_tempdir.py tests/test_exl3_hessian_symmetry.py tests/test_exl3_native_half_rounding.py \ tests/test_exl3_fractional_bits.py tests/test_exl3_head_bits_tied_6347.py tests/test_stage_modules.py # (+ remote/inline files on base)test_exllamav3_torch_rocm_forward_runs_and_matches_oracle[dtype0|dtype1]("ROCm GPU required"), so the ROCm path is not verified here.New test, red/green.
test_retired_ds4rt_meta_keys_warn_once_and_are_not_savedwas run against origin/main code: 2 failed atassert sorted(warned) == sorted(retired)([] == [...]; no warning was emitted). On this branch: 2 passed. It covers:__post_init__paths (EXL3Config and GPTQQuantizeConfig);to_dict()dropping exactly the retired keys while keeping nested siblings;Lint.
bash format/check.shwith a no-oppipshim, so the venv's ruff 0.14.2 is used:All checks passed!Measured Impact
GPU A/B on RTX 4090 (GPU 3): EXL3 quantize of
Qwen/Qwen2.5-0.5B-InstructwithEXL3Config()defaults (bits 3, codebook mcg). Both trees used the same 64 wikitext-2 rows and seed 0, and the runs were sequential.model.safetensors(sha256)40ac554a6813b64d…)102b029b1cd8ddcf…)config.json,quantize_config.json,generation_config.json,tokenizer*.jsonquant_log.csvlayer/module/loss/loss_kind/samples/damp (168 rows)ds4rt-exl3-error-ledger.jsonl(168 records, duration fields and therecord_sha256that hashes them removed)Two differences are expected, and both come from timing:
quant_log.csvrow order within a layer differs (thread completion order), along with the time column.ledger_sha256.Structural A/B (
structural_ab.py, run per tree):to_dict()is identical on both trees forEXL3Config(),EXL3Config(offload_to_disk=False),EXL3Config(bits=2.5, codebook="q4nx"), EXL3 withds4rt_error_ledgermeta, EXL3 withds4rt_hessian_owner_policymeta, GPTQ default, GPTQ with ledger meta, and AWQ default.EXL3Processor.processhas the same signature on both trees._inline_mixed_policy,_process_on_slot,_projection_assignment_key,_publish_inline_candidate,_remote_client_for_run,_requantize_inline_selectedandprepare_layer_replay.LoopProcessorlost onlyprepare_layer_replay.Model Support / Module Plan
Not applicable: no
MODEL_MAPentry, definition, module plan or fusion change.ports/deepseek_v41_flash/gptq.pychanges one import path only.Model test node IDs and results (or "not applicable"): not applicable.
tests/module_tree/test_deepseek_v41_flash.pygives the same results before and after (see Tests).AWQ onboarding safety
AWQ evidence and per-variant policy (or "not applicable" with a reason): not applicable. AWQ grouping, search, replay and folding are untouched. The structural A/B shows
AWQConfig.to_dict()is unchanged.Logic Flow Documentation
file:lineevidence.docs/repeats the diagrams, titled for the mechanism, and is linked fromREADME.md.The diagrams are repeated in
docs/exl3-durable-execution.md#per-projection-quantization(linked from README) anddocs/looper-checkpoint-redesign.md#retired-ds4rt-switches.New per-projection flow:
flowchart TD P["EXL3Processor.process"] --> H["_hydrate_capture_frontier<br/>then _hessian_for_module"] H --> S{"projection checkpoint store"} S -->|"none, the default"| Q["_distributed_local_quant_lock<br/>quantize_exl3"] S -->|"configured"| R{"store.load hit"} R -->|"miss"| Q R -->|"hit"| L["reuse packed tensors"] Q --> V["validate_exl3_hessian_metrics"] Q -->|"quantizer error"| X["RuntimeError with<br/>exl3_quantization_failure_message"] V -->|"contract mismatch"| X V --> C["store.commit if configured"] C --> J["append_exl3_error_journal"] L --> J J --> T["_stage_runtime_weight, stat row"] style X fill:#fee,stroke:#b22Retired meta switches:
flowchart LR A["QuantizeConfig(meta=...)<br/>or from_quant_config"] --> B["_normalize_meta"] B -->|"not a dict or non-str key"| X["ValueError"] B --> C{"_retired_meta_keys"} C -->|"present, first time"| W["log.warn once<br/>is retired and has no effect"] C -->|"none or already warned"| D["meta kept as passed"] W --> D D --> E["quantize: no reader"] D --> F["to_dict: _without_meta_key"] style X fill:#fee,stroke:#b22 style W fill:#ffd,stroke:#b80Removed mechanism (origin/main
7a4b26852) vs this PR:exllamav3_processor.py:1019_remote_client_for_run→exl3_remote.py:1236remote_client_from_provenance(readsrun.remote_workers, token env)config.py:7318_RETIRED_META_KEYS,:7350_normalize_meta)exllamav3_processor.py:2983processleases a slot and calls:3131_process_on_slot, then the remote branch at:3265exllamav3_processor.py:2723processquantizes on its device under_distributed_local_quant_lock(:2820)exl3_inline_mixed.py:176inline_mixed_policy, read atexllamav3_processor.py:977,1002,1499,2895,2997,3159exllamav3_processor.py:1500demotes live Hessians to lazy frontier recordsstage_layer.py:1293→EXL3Processor.prepare_layer_replay(exllamav3_processor.py:2877) →_requantize_inline_selected(:2782); base no-op atloop_processor.py:1699exl3_projection_checkpoint.py:238_module_request_key(uniform / candidate / selected roles)exl3_projection_checkpoint.py:236reserve_module_request: one digest per moduleexl3_projection_checkpoint.py:651prune, called only byexl3_remote.execute_remote_projectionquantize_config.jsonconfig.py:8440drops them into_dict()meta.ds4rt_inline_mixed*setmeta.ds4rt_error_ledger.run.remote_workerssetmixes uniform and inlineValueErrorReview Requirements
Kernel Accuracy Requirements
Notes
tests/module_tree/test_deepseek_v41_flash.pyhas 17 failures/errors (TypeError: Unsupported DeepSeek V4.1 Flash load arguments: tokenizer). They are identical on origin/main and on this branch.logs/*.exl3-error-ledger.jsonlbeside the log file, andlogs/is not gitignored for.jsonl. This is the map's always-on side effect D(1), handled by PR E1.🤖 Generated with Claude Code