Repository navigation
Conversation
Extract the existing working fork feature for first maintainer feedback. Preserve carried code and tests; limit validation to lightweight structural checks. See the linked mechanism reference for actual API/call and failure paths.
- _build_device_thread_pool hard-coded cuda:per=4 while the new telemetry test asserts GPTQMODEL_CUDA_WORKERS; add _default_cuda_workers() with the same invalid-value fallback as the CPU override. - forward_executor had an unused segment_start; remove it. - The calibration dummy model needs BaseQModel.prepare_layer_replay_keep_mask now that the executor calls it. - Skip the DeepSeek V4 MTP and prepare_exl3_hessian tests that depend on later stack layers; keep the shared-capture assertions. - Satisfy the ruff gate.
Qubitium
force-pushed
the
upstream/20-looper-causal-replay-20261108
branch
from
November 9, 2026 09:22
9bb8720 to
a884b37
Compare
Qubitium
reviewed
Nov 9, 2026
Qubitium
left a comment
Collaborator
There was a problem hiding this comment.
Review (layer 20)
Reviewed the incremental layer-20 commit (9bb8720bd, 16 files, +2726/−201) after rebasing onto current main. The causal replay contracts, shared Hessian state, and durable recovery callbacks are coherent. I pushed a fix commit (a884b3799).
Fixed
- CUDA worker env override was unimplemented. The new telemetry test asserts
GPTQMODEL_CUDA_WORKERS, but_build_device_thread_poolhard-codedcuda:per: 4. Added_default_cuda_workers()with the same invalid-value fallback as the CPU override. - Unused
segment_startinforward_executor(ruffF841). - Dummy model missed the new hook.
_DummyGPTQModelForLoopernow aliasesBaseQModel.prepare_layer_replay_keep_mask, which the executor calls;test_output_moved_to_input_device_in_single_modefailed without it. - Out-of-layer tests.
test_gptq_shared_hessian.pyimportsprepare_exl3_hessian, which lands later; the test that needs it is skipped and the shared-capture assertions are kept. - Ruff import ordering.
Verification
- Non-calibration suites: 96 passed, 1 skipped.
tests/test_calibration_data_device.py: 20 passed, 2 deselected — the twoTestCalibrationDataDeviceIntegrationcases require a homogeneous multi-GPU host and also fail on currentmainon this mixed sm_89/sm_120 machine.
Notes
- Running
tests/test_calibration_data_device.pybeforetest_gptq_hessian_pipeline.pyin one process inflates the shared-factor Cholesky probe count (thetest_balanced_mode_*cases patch the globalDEVICE_THREAD_POOL). The hessian test passes in its own file and in isolation; this looks like pre-existing cross-file test pollution rather than a layer-20 defect, but it is worth isolating. - The two mixed-GPU integration tests should be made capability-aware instead of assuming a uniform device map.
Qubitium
marked this pull request as ready for review
November 9, 2026 09:22
Qubitium
pushed a commit
that referenced
this pull request
Nov 12, 2026
All but one test in this file fail on main. Two changes since the file was last touched (#3572) moved the ground it stands on. The mocked processor auto-creates attributes, so the capture-frontier restore hook added in #3600 looks callable and returns a truthy mock, which makes `_run_single_subset_pass` skip the forward pass every assertion is about. A real processor without that hook returns None, so the fixture now says so explicitly. #3600 also added a causal replay pass: with `execution_config.fwd_replay_after_process` set, each chunk runs one capture forward and one replay forward, so `_run_forward_batches` is called twice per chunk instead of once. The expectations were doubled and the comments now say why, instead of just carrying a different number. The flush counts are unchanged: the replay pass does not call `torch_empty_cache`. tests/test_moe_expert_batching.py 9 passed Before this change the file reported 8 failed, 1 passed on main.
12 tasks done
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
Carry the existing layer/subset replay integration: input-capture hooks, output consumers, disk-backed boundaries, committed-batch callbacks, route recovery phases, bounded release, and shared Hessian ownership. Preserve the working control flow without a new looper abstraction.
This is layer 20/36, extracted from an already-used fork for initial maintainer feedback. It depends on #3599. Review only this feature; the cross-fork Files changed view is cumulative because the PR targets upstream
main.Incremental change: 16 files, +2726/−201 lines, including carried tests and the mechanism reference. No merge is automatic. Review value and API shape first; substantial rework can follow that feedback.
Flow and existing-code boundary
flowchart TD S0["ForwardExecutor"] M0_0["ForwardExecutor.__init__"] S1["StageInputsCapture"] M1_0["StageInputsCapture.__init__"] S2["GPTQ"] M2_0["GPTQ.__init__"] M2_1["GPTQ.validate_module"] M2_2["GPTQ.process_batch"] E["RuntimeError, TypeError, ValueError"] S0 -. "exposes" .-> M0_0 S0 -->|"raises on rejected input/state"| E S1 -. "exposes" .-> M1_0 S2 -. "exposes" .-> M2_0 S2 -. "exposes" .-> M2_1 S2 -. "exposes" .-> M2_2 S2 -->|"raises on rejected input/state"| E style E fill:#fee,stroke:#b22gptqmodel/looper/forward_executor.py:36gptqmodel/looper/forward_executor.py:36:ForwardExecutorgptqmodel/looper/stage_inputs_capture.py:47gptqmodel/looper/stage_inputs_capture.py:47:StageInputsCapturegptqmodel/quantization/gptq.py:292gptqmodel/quantization/gptq.py:328:GPTQCommitted reference: docs/looper-causal-replay.md, linked from README. Class entry points/calls and rejected-state paths describe code present in this branch, rather than planned integrations.
Validation
Carried test files:
tests/test_stage_modules.py,tests/test_stage_inputs_capture.py,tests/test_subset_plan.py,tests/test_gptq_hessian_pipeline.py,tests/test_gptq_shared_hessian.py,tests/test_calibration_data_device.py,tests/test_quant_telemetry.pyThis packaging pass checked Python parsing, whitespace, dependency order and balanced Mermaid blocks. The author reports successful prior use of these features. Per the requested resource limit and feedback-first scope, existing model quantization, GPU/ROCm tests, heavyweight CPU workloads and full model benchmarks were not rerun; no new performance or model-accuracy claim is made. Tests accompanying earlier stack layers retain their previously reported results.