Skip to content

refactor(quantization): centralize lifecycle contracts - #3796

Merged
Qubitium merged 24 commits into
mainfrom
codex/quant-lifecycle-contracts
Nov 13, 2026
Merged

Qubitium merged 24 commits into
mainfrom
codex/quant-lifecycle-contracts

Conversation

@Qubitium

@Qubitium Qubitium commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add mutable ProcessorLifecycleConfig for forward, calibration, and checkpointing behavior.
  • Keep all forward behavior in immutable ForwardConfig; all dataset behavior in immutable CalibrationConfig.
  • Every calibrated processor accepts one complete CalibrationConfig and one optional ForwardConfig; individual calibration/forward arguments are removed.
  • Add immutable QuantizationRunPlan as the single processor-chain contract and one shared checkpoint admission predicate.
  • Add immutable ResolvedModuleConfig snapshots so one dynamic-rule result drives quantization and packing.
  • Add ModuleConstructorConfig as the single normalized constructor contract shared by packing, checkpoint capture, and checkpoint restore.
  • Make the LoopPlan the execution authority: run_layer_stage() iterates planned steps from the extension cursor and publishes those exact step objects.
  • Support checkpoint resume with dynamic overrides and runtime calibration exclusions.
  • Persist runtime calibration exclusions and per-module packing settings (bits, group size, symmetry, pack dtype, format, kernel, and method-specific options) in checkpoint schema v6.
  • Reject checkpoint capture if mutable quantization settings change mid-run.
  • Fix the EoRA finalize lock-order deadlock.
  • Apply AWQ dynamic formats consistently during staging, clip search, scale search, kernel selection, and GSQ packing.
  • Fix calibrated preprocessor construction and checkpoint capture when no quantization config is attached.
  • Deduplicate dynamic lookup, calibration construction, and checkpoint module metadata.
  • Document the lifecycle flow and extension points.

Contracts

Contract Owner Consumers
QuantizationRunPlan gptqmodel/models/quantization_run_plan.py preflight, BaseQModel, checkpoint admission, diagnostics
ProcessorLifecycleConfig gptqmodel/looper/loop_processor.py subset planning, layer replay, capture hooks, checkpoint adapter
ResolvedModuleConfig gptqmodel/quantization/config.py quantization, packing
ModuleConstructorConfig gptqmodel/quantization/module_config.py create_quant_module, checkpoint capture/restore
LoopPlan / LoopStep gptqmodel/looper/extension.py ModuleLooper, run_layer_stage, extensions

A lifecycle property is shared only when at least two processors or stages consume it. Method math, kernels, capture storage, and method-specific failure rules stay local to the owning processor.

Design flow

flowchart TD
    A["model.quantize(...)"] --> B["QuantizationRunPlan.build"]
    B --> C{"checkpoint requested?"}
    C -- yes --> D{"run_plan.checkpoint_supported"}
    D -- no --> X1["NotImplementedError<br/>unsupported processor chain"]
    D -- yes --> E["processor_class(step)"]
    C -- no --> E

    E --> F["ModuleLooper<br/>build LoopPlan"]
    F --> G["extensions.start(LoopContext(plan))<br/>returns resume cursor"]
    G --> H["run_layer_stage(plan, cursor)"]
    H --> I["iterate plan.steps[cursor:]<br/>plan is the step authority"]

    I --> J["ProcessorLifecycleConfig<br/>forward + calibration"]
    J --> K["QuantizeConfig.resolve_module_config"]
    K --> L{"first dynamic rule excluded?"}
    L -- yes --> X2["skip module<br/>record runtime exclusion"]
    L -- no --> M["ResolvedModuleConfig"]

    M --> N["resolve_module_constructor_config"]
    N --> O["ModuleConstructorConfig<br/>bits / group / sym / pack_dtype / format / options"]
    O --> P["create_quant_module<br/>pack once"]
    P --> Q["packed_module_config<br/>derive the same config"]
    Q --> R["checkpoint capture<br/>schema v6"]
    R --> S["restore_packed_module<br/>consume the same config"]

    I --> T["extensions.publish(planned step)"]
    T --> U["LoopExtension observers<br/>boundary equals plan"]

    classDef failure fill:#ffd6d6,stroke:#b42318,color:#7a271a;
    classDef contract fill:#dbeafe,stroke:#2563eb,color:#1e3a8a;
    class X1,X2 failure;
    class B,F,M,N,O contract;
Loading

The run plan is immutable after preflight. BaseQModel.quantization_run_plan exposes it for diagnostics. The resume cursor is a position in the plan, distinct from the model-layer index used by layer-boundary recovery.

Example

class GPTQProcessor(LoopProcessor):
    lifecycle = ProcessorLifecycleConfig(
        forward=ForwardConfig(
            required=True,
            replay_after_process=True,
            subset_early_stop=True,
        ),
        calibration=CalibrationTypes.EACH_MODULE_NEEDS_INPUT,
        checkpointing=CheckpointSupport.PRIMARY,
    )

    def __init__(self, ..., calibration: CalibrationConfig, forward: ForwardConfig | None = None):
        super().__init__(..., calibration=calibration, forward=forward)
from gptqmodel.quantization.module_config import resolve_module_constructor_config

snapshot = config.resolve_module_config("model.layers.0.self_attn.q_proj")
constructor_config = resolve_module_constructor_config(
    bits=config.bits,
    group_size=config.group_size,
    desc_act=config.desc_act,
    sym=config.sym,
    pack_dtype=config.pack_dtype,
    format=config.format,
    overrides=snapshot.overrides if not snapshot.excluded else False,
)
model.quantize(calibration, backend=BACKEND.AUTO)
print(model.quantization_run_plan.describe())

Validation

  • Lifecycle contracts, checkpoint modules, stage modules, and checkpoint adapter: 138 passed, 2 skipped.
  • Checkpoint quantization, checkpoint extension, and loop extensions: 34 passed.
  • Weight-only, AWQ per-module widths, and dataset preparation: 142 passed, 75 skipped.
  • GPU-only QQQ checkpoint schema: passes with a GPU visible.
  • Dynamic override unit test: passes.
  • Repository Ruff, compileall, and git diff --check: pass.
  • GitHub Actions: ruff and CodeQL (actions + python) all pass.

Known environment limits

  • tests/test_dynamic.py needs a real model; the available GPUs mix compute capabilities, so only its unit-level override test runs here.
  • test_gguf_forward_requests_dequantized_weight_in_input_dtype fails identically on the base revision in this environment (CPU/CUDA dtype mismatch) and is unrelated to this PR.

Copy link
Copy Markdown
Collaborator Author

Pushed 04aa4b6a5.

Fixed an EoRA multi-GPU finalize deadlock caused by reversed processor/module lock order. Also updated the checkpoint tests to use all four visible 4090s and keep EoRA on two GPUs.

Validated:

  • device suite on 4x4090: 27 passed
  • GPTQ EoRA recovery: 14 passed
  • CPU checkpoint recovery: 7 passed
  • focused finalize/concurrency tests: 41 passed
  • ruff/diff checks passed

Copy link
Copy Markdown
Collaborator Author

Pushed 0809b195d.

CI found an AWQ dynamic-config bug (named_get_effective_module_config(module)). Fixed it to use get_effective_module_config(named_module) and applied Ruff import formatting.

Validated:

  • AWQ dynamic/per-module width tests: 121 passed
  • repository Ruff gate: passed
  • GitHub Ruff workflow: passed

Copy link
Copy Markdown
Collaborator Author

Pushed a8aaec031.

Single-GPU checkpoint cases now pin one visible GPU instead of inheriting all four. Specialized QQQ/Paro EoRA recovery passes.

Validated:

  • specialized EoRA checkpoint recovery: 8 passed
  • Ruff gate: passed locally and in GitHub Actions

Copy link
Copy Markdown
Collaborator Author

Pushed 138377c0b.

Forward controls now use ForwardConfig(required, replay_after_process), and lifecycle updates use ProcessorLifecycleConfig.use().

Validated:

  • lifecycle/planning/stage: 109 passed, 33 skipped
  • processor/AWQ: 122 passed, 1 deselected
  • weight-only: 71 passed, 9 skipped
  • GitHub Actions Ruff: passed
  • local Ruff, compileall, and git diff --check: passed

Copy link
Copy Markdown
Collaborator Author

Pushed 3d6589779.

Moved all forward behavior into ForwardConfig:

ForwardConfig(
    required=...,
    replay_after_process=...,
    all_modules_in_single_pass=...,
    subset_early_stop=...,
    activation_capture=...,
    capture_layer_context=...,
)

Validated:

  • lifecycle/subset/stage/module-tree: 81 passed
  • NPU: 19 passed, 33 skipped
  • focused ParoQuant forward tests: 4 passed
  • Ruff, compileall, and git diff --check: passed

Copy link
Copy Markdown
Collaborator Author

Pushed ffa8b46aa.

Removed redundant ExecutionConfig. The API is now direct:

lifecycle=self.lifecycle.use(ForwardConfig(...))
forward_config=ForwardConfig(...)

Validated:

  • lifecycle/stage/MoE/NPU/AWQ/preprocessor: 230 passed, 33 skipped
  • checkpoint adapter/extension/store/continuation: 50 passed
  • VPTQ/EXL3: 18 passed, 2 skipped
  • focused ParoQuant forward tests: 4 passed
  • Ruff, compileall, and git diff --check: passed

Copy link
Copy Markdown
Collaborator Author

Pushed be262a573.

Simplified the names:

forward=ForwardConfig(...)
processor.forward

No _config suffix remains for ForwardConfig variables.

Validated:

  • lifecycle/stage/MoE/NPU/AWQ/preprocessor: 230 passed, 33 skipped
  • checkpoint/continuation/VPTQ/EXL3: 68 passed, 2 skipped
  • Ruff, compileall, and git diff --check: passed

Copy link
Copy Markdown
Collaborator Author

Pushed a66b3efea.

Processor constructors now accept one complete config:

GPTQProcessor(..., forward=ForwardConfig(required=False, ...))

Removed require_fwd and other individual forward-property constructor arguments. Processor defaults now live in each class lifecycle.

Validated:

  • lifecycle/stage/MoE/NPU/preprocessor/AWQ: 371 passed, 33 skipped
  • checkpoint/continuation/VPTQ/EXL3/ParoQuant: 80 passed, 2 skipped
  • lifecycle contract suite: 9 passed
  • submodule finalize benchmarks: 3 passed
  • Ruff, compileall, and git diff --check: passed

Copy link
Copy Markdown
Collaborator Author

Fixed the FP8 oracle in 9f4fc0af7. It now applies scale_inv in FP32 before converting to BF16, matching dequantization semantics.

Validation: 58 passed, 1 skipped; Ruff, compileall, and diff checks passed.

Copy link
Copy Markdown
Collaborator Author

Added CalibrationConfig in fe46b42ec. Calibrated processors now receive one config object instead of separate dataset, preparation, sort, concat, separator, and batch arguments.

Validation: 250 processor tests, 98 lifecycle/stage tests, and 37 checkpoint tests passed. Ruff, compileall, and diff checks passed.

Copy link
Copy Markdown
Collaborator Author

Pushed 97418806f.

Review fixes:

  • Fixed the AWQ/EoRA lock inversion and dynamic per-module format handling.
  • Fixed calibrated preprocessor construction.
  • Fixed checkpoint identity for dynamic rule order, runtime exclusions, empty dynamic config, and mixed kernels.
  • Centralized lifecycle overrides and removed duplicated dynamic/checkpoint config logic.

Validation:

  • 415 relevant tests passed; 7 unchanged CPU timing cases excluded.
  • Four-4090 Hessian recovery: 14 passed.
  • EoRA/AWQ recovery: 38 passed.
  • Ruff, compileall, and diff checks passed.

Comment thread tests/test_prepare_dataset.py Fixed

@Qubitium Qubitium left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the lifecycle refactor at e584e93c4 and reproduced two checkpoint regressions. I also found one avoidable calibration preparation cost in the new processor factory. Details are attached to the changed lines below.

Comment thread gptqmodel/looper/gptq_checkpoint.py Resolved
Comment thread gptqmodel/looper/checkpoint_modules.py Resolved
Comment thread gptqmodel/models/base.py Resolved
Persist runtime calibration exclusions across continuation and record each AWQ module's effective format. Pass an empty calibration config to planning-only preprocessors.

@Qubitium Qubitium left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed at b06782733. The three issues I reported on e584e93c4 are addressed and their focused regressions pass. I found one remaining checkpoint resume failure for dynamic weight-only settings, detailed below.

Comment thread gptqmodel/looper/checkpoint_modules.py Resolved
Record effective FP8 scale/format settings and BitsAndBytes block/compression settings in packed module specs. Restore them over global method defaults and cover dynamic FP8 stop/resume.
Rename EffectiveModuleConfig to ResolvedModuleConfig, effective variables to resolved_cfg, and the bind/get helpers to resolved-module-config names. Update docs and tests.

@Qubitium Qubitium left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fresh subagent correctness review at 25d44e724, with local verification of both findings. The earlier dynamic weight-only checkpoint failure is fixed: its FP8 stop/resume reproduction and the new FP8/BNB tests pass.

[P3] scripts/repro_issue_2326.py still imports and constructs ExecutionConfig (lines 29 and 258), which this PR removes from loop_processor.py. Running python scripts/repro_issue_2326.py --help now exits immediately with ImportError: cannot import name 'ExecutionConfig'. Please migrate the diagnostic to ForwardConfig and processor.forward so it remains usable for the multi-GPU regression it documents.

Comment thread gptqmodel/looper/module_looper.py Resolved
run_layer_stage() replays and publishes every trailing decoder layer when an embedding endpoint is requantized, so the execution plan must cover them instead of truncating at the last quantized layer. Extract plan_layer_count() and share it with the weight-only looper.

Copy link
Copy Markdown
Collaborator Author

Fresh correctness and design review at 0f2fd95b7, using two independent subagents with fresh context, followed by local verification. The full base-to-head changes were reviewed across lifecycle construction, scheduling, dynamic resolution, packing, and checkpoint reconstruction.

New correctness finding — [P3] run-plan diagnostics crash for accepted string backends. A real CPU RTN run with model.quantize(calibration=None, backend="torch") completes (model.quantized == True), but model.quantization_run_plan.describe() raises AttributeError: 'str' object has no attribute 'value'. The plan stores the caller's backend, then describe assumes an enum. Normalize the recorded diagnostic backend using the existing method-aware normalization, while preserving intended AUTO/looper semantics. Add coverage through the public quantize call with a supported string alias. Quantization itself succeeds.

Design assessment: the grouped configs are useful, but several decisions still have multiple owners. I would keep this approach and tighten ownership in these concrete ways:

  1. One lifecycle policy and one checkpoint admission predicate. LoopProcessor copies lifecycle.forward into self.forward, despite lifecycle being mutable. I reproduced processor.lifecycle.forward = ForwardConfig(required=False) leaving processor.forward.required == True. Make forward a property delegating to lifecycle, or freeze the instance policy after construction. The property is the smaller change if mutation is intentional; freezing is clearer if settings are construction-only. This is a demonstrated mutation-contract mismatch, but I found no ordinary quantize path that mutates it. Separately, the run-plan checkpoint allowlist duplicates the adapter's role checks. Both should use the same declared roles and chain predicate. Reading selected processor classes earlier has an import-cost tradeoff; a lightweight shared descriptor can preserve lazy optional imports if needed.

  2. Resolve the full normalized module settings once. ResolvedModuleConfig currently freezes only overrides; packing interprets fields again, and checkpoint specs maintain another field inventory. Reuse the existing method-specific normalized config clone and derive a small validated constructor spec from it for packing and reconstruction. Persist the selected kernel and that spec, retaining explicit schemas for runtime-created buffers. This addresses the recurring missing-field class of bugs without requiring a universal quantization framework. The tradeoff is versioning/validating persisted constructor metadata; avoid serializing the entire runtime config. Extend the “clone and pack settings” test through actual module creation and checkpoint restore—it currently only checks the clone.

  3. Execute the existing LoopPlan as the step authority. The embedding fix addresses the earlier failure, but ModuleLooper builds the plan while stage_layer independently recalculates its stopping condition. The new helper is used by planners, not by the stage's execution decision. Prefer iterating planned steps from the resume cursor and publishing those same step objects; as a smaller intermediate change, pass the already-resolved execution extent into the stage. Keep cursor position distinct from model-layer index. Test an actual observer's emitted step sequence against the plan for normal, excluded-tail, embedding, and resumed runs; the new helper-only test cannot catch drift between planner and executor.

Prepared calibration ownership is another possible follow-up: consumers sharing the same dataset/preparation policy can share read-only prepared batches while retaining separate activation caches. Repeated preparation predates this PR, so this is an optimization opportunity rather than a new regression.

Validation: local scheduling/lifecycle selection 80 passed; independent agent lifecycle/checkpoint-schema selection 74 passed (overlapping suites, not additive). Locally reproduced the string-backend crash and forward-policy mismatch. No new confirmed quantization/checkpoint numerical failure emerged from this pass; no new free-threaded multi-GPU qualification was performed. The previously reported stale ExecutionConfig import in scripts/repro_issue_2326.py remains at this head and is already covered by the earlier review.

- Normalize the recorded loop backend with method-aware normalization so
  run-plan diagnostics accept string backends; AUTO stays AUTO.
- Delegate LoopProcessor.forward to the mutable lifecycle instead of a
  stale copy.
- Share one checkpoint-chain admission predicate between the run plan and
  the checkpoint adapter, with a drift test against processor lifecycles.
- Let run_layer_stage consume the planner-resolved layer extent instead of
  recomputing it.
- Migrate scripts/repro_issue_2326.py to ForwardConfig and cover it with a
  regression test.
@Qubitium

Copy link
Copy Markdown
Collaborator Author

Pushed c98604f3b.

Fixes for this review:

  • [P3] string backend diagnostics — the run plan now records the method-aware normalized backend and describe() no longer assumes an enum. AUTO stays AUTO. Covered through the public model.quantize(calibration=None, backend="torch") call.
  • Forward policy ownership — LoopProcessor.forward is now a property delegating to the mutable lifecycle, so lifecycle.forward = ... is observed. Test added.
  • One checkpoint admission predicate — run plan and checkpoint adapter both use checkpoint_chain_supported. A drift test asserts the run-plan roles match each processor's declared lifecycle.checkpointing.
  • Planner/executor extent — run_layer_stage() now consumes the planner-resolved last_quantized_layer_index instead of recomputing it. Covered by a test that supplies an extent and verifies the stage stops there.
  • Stale script import — scripts/repro_issue_2326.py migrated to ForwardConfig, with a subprocess regression test.

Design items 2 (one normalized constructor spec for packing/checkpoint) and 3 (execute the LoopPlan as step authority) remain follow-ups. Item 3's smaller intermediate change is done; item 2 would be a larger schema refactor and I did not silently expand this PR into it.

Validation: lifecycle contracts 15 passed; checkpoint/loop-extension/method compatibility 26 passed; stage and weight-only focused tests passed; broader AWQ/prepare-dataset/checkpoint/stage suite 227 passed, 32 skipped. The one QQQ failure in that run was caused by forcing CUDA_VISIBLE_DEVICES=""; it passes with a GPU visible. Ruff, compileall, and git diff --check pass.

Copy link
Copy Markdown
Collaborator Author

Re-reviewed head c98604f3b36b43b0ed0e15ca7d17d0573228b0b6, with a fresh independent subagent checking traversal, lifecycle ownership, and checkpoint admission. This pass focused on the latest fixes and regression checks across the affected lifecycle/checkpoint paths.

One actionable finding — [P2] migrate the checkpoint adapter fixture so its existing assertions still run.

The new capture call unconditionally reads the quantization config through _checkpoint_runtime_dynamic_rules(), but adapter_for() still supplies quantize_config=None. Consequently, all three dense scaling/alias round-trip cases and all five malformed-alias cases fail during capture with AttributeError: 'NoneType' object has no attribute 'dynamic', before testing restoration or rejection-before-mutation.

Reproduction: CUDA_VISIBLE_DEVICES=0,1,3,4 python -m pytest tests/test_checkpoint_processor_adapter.py -q. Base b962d7a79: 12 passed. Current head: 4 passed / 8 failed. In an isolated diagnostic rerun, supplying GPTQConfig(offload_to_disk=False) in that fixture restored 12 passing tests, without changing production code. Please migrate the fixture; this is a test regression, not evidence that normal configured models fail to checkpoint.

Latest fixes verified: string backend quantization and plan diagnostics pass through the public API; forward now follows the current lifecycle object; the layer stage receives the planner's extent; both checkpoint admission paths use the shared predicate. No additional production correctness finding emerged in this pass.

Design: the smaller extent-passing change is sufficient for the observed planner/executor mismatch. The step-to-checkpoint-role table still duplicates processor declarations, but its drift test is a reasonable guard. A normalized per-module constructor specification shared by packing and restoration remains a useful follow-up; I would keep that separate from fixing the failing tests.

Validation: lifecycle/helpers/stage/subset/weight-only suites: 157 passed, 9 skipped. Checkpoint adapter/method/modules/extension and loop-extension checks, with recovery cases deselected: 94 passed, 8 failed (the fixture issue above), 95 deselected. Full subprocess recovery coverage was not completed in this pass. No repository files changed.

- Add ModuleConstructorSpec as the single normalized constructor contract.
  create_quant_module resolves dynamic overrides into it, checkpoint capture
  derives it from the packed module, and restore consumes it. This removes
  the duplicated field inventory and override interpretation.
- Make the LoopPlan the execution authority in run_layer_stage: iterate the
  planned steps from the extension cursor and publish those exact step
  objects instead of recomputing the stop condition.
- Fix checkpoint capture for models without a quantization config.
- Cover plan/observer agreement for normal, excluded-tail, embedding, and
  resumed runs, plus packing/checkpoint spec agreement.
@Qubitium

Copy link
Copy Markdown
Collaborator Author

Pushed 67b824c50. Design items 2 and 3 are now implemented in this PR.

2. One normalized constructor spec.

  • Added ModuleConstructorSpec (gptqmodel/quantization/module_spec.py) with validation for bits, group size, symmetry, packing dtype, and format.
  • create_quant_module resolves the winning dynamic rule into that spec; the inline FP8/BitsAndBytes/GGUF override logic now lives in resolve_module_constructor_spec.
  • packed_module_spec derives the same object from the packed module, and restore_packed_module consumes it. Packing and checkpoint no longer maintain separate field inventories.
  • Method-specific values (FP8 scales/block, BitsAndBytes block settings, Paro rotation options) live in spec.options; the selected kernel stays explicit in the checkpoint payload.
  • Test: packing and checkpoint produce the same spec for a dynamic module.

3. LoopPlan is the step authority.

  • ModuleLooper passes its LoopPlan and the extension cursor into run_layer_stage.
  • The stage iterates the planned steps, publishes the planner's own step objects, and no longer recomputes the stopping layer. The cursor is a plan position, separate from the model-layer resume index.
  • Tests assert the observer's emitted sequence equals the plan for normal, excluded-tail, embedding, and resumed runs.

Also fixed: checkpoint capture crashed for models with no quantization config (config=None); the runtime-exclusion helper now tolerates it. This was a pre-existing failure on the branch.

Validation: 138 passed (lifecycle, checkpoint modules, stage, checkpoint adapter); checkpoint quantization/extension 34 passed; weight-only/AWQ/prepare-dataset 142 passed, 75 skipped; QQQ GPU-only schema test passes with a GPU visible. Ruff, compileall, and diff checks pass.

Comment thread tests/test_stage_modules.py Fixed
Drop the remaining spec naming from the lifecycle surface:
- module_spec -> module_config
- ModuleConstructorSpec -> ModuleConstructorConfig
- resolve/module_constructor_spec -> resolve/module_constructor_config
- packed_module_spec -> packed_module_config
- checkpoint state key specs -> modules (adapter schema v6)

Copy link
Copy Markdown
Collaborator Author

Re-reviewed head 3b63d758c581ba714370147a9d6ebd4aa2ce1251, focusing on the three commits since c98604f3b. A fresh independent subagent reviewed the new plan-driven layer execution; I reviewed constructor normalization, packing/checkpoint serialization, and integration behavior.

No new actionable correctness findings in this delta.

  • The previous checkpoint adapter issue is fixed: all 12 adapter tests now pass without fixture patches.
  • Traced ModuleConstructorConfig through packing, checkpoint capture, and restoration. The focused tests cover dynamic packing settings and method-specific FP8, BitsAndBytes, GGUF, AWQ, QQQ, and Paro reconstruction behavior.
  • Checked plan-position versus layer-index handling, embedding modes, lm_head, trailing exclusions, stop/finalization behavior, and resumed execution. The stage now consumes the actual plan and publishes its step objects.

Design assessment: these changes address the two main structural concerns from the earlier review. Executing the plan directly removes the competing traversal decision, and the shared constructor config centralizes common constructor fields without requiring a generic quantization algorithm. Keeping kernel resolution and tensor-schema validation explicit is appropriate. I do not see a correctness-driven reason for another broad redesign in this pass.

Validation on this head:

  • Focused lifecycle, stage, subset, weight-only, GGUF dynamic, checkpoint adapter/modules/telemetry/extensions/method checks: 291 passed, 9 skipped (recovery cases excluded from this batch).
  • Non-subprocess checkpoint quantization tests, including exact tensor equality after resume across the four model-family fixtures and dynamic configurations: 12 passed.
  • Abrupt subprocess recovery: Llama kill-after and Qwen3-MoE kill-before: 2 passed.

Total: 305 passed, 9 skipped. The subagent additionally checked traversal combinations with mocked subset/replay work; those are not counted above. This was not the full method/device/recovery matrix or a GIL=0 qualification. No repository files changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant