Skip to content

feat(exl3): checkpoint completed projections atomically - #3593

Merged
Qubitium merged 15 commits into
ModelCloud:mainfrom
tpurtell:upstream/13-exl3-projection-checkpoints-20261108
Nov 9, 2026
Merged

Qubitium merged 15 commits into
ModelCloud:mainfrom
tpurtell:upstream/13-exl3-projection-checkpoints-20261108

Conversation

@tpurtell

@tpurtell tpurtell commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Expose content-bound projection requests, atomic safetensors publication, validated restore, and readable checkpoint artifacts. Keep checkpoint identity and completion boundaries unchanged.

This is layer 13/36, extracted from an already-used fork for initial maintainer feedback. It depends on #3592. Review only this feature; the cross-fork Files changed view is cumulative because the PR targets upstream main.

Incremental change: 4 files, +1146/−0 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["build_projection_request"]
    S1["EXL3ProjectionCheckpointStore"]
    M1_0["EXL3ProjectionCheckpointStore.__init__"]
    M1_1["EXL3ProjectionCheckpointStore.committed_tensor_path"]
    M1_2["EXL3ProjectionCheckpointStore.load_committed"]
    E["RuntimeError, ValueError"]
    S1 -. "exposes" .-> M1_0
    S1 -. "exposes" .-> M1_1
    S1 -. "exposes" .-> M1_2
    S1 -->|"raises on rejected input/state"| E
    style E fill:#fee,stroke:#b22
Loading
Before this extraction layer Carried implementation
API absent in the previous stack layer (path/symbol checked) gptqmodel/utils/exl3_projection_checkpoint.py:89: build_projection_request
API absent in the previous stack layer (path/symbol checked) gptqmodel/utils/exl3_projection_checkpoint.py:179: EXL3ProjectionCheckpointStore

Committed reference: docs/exl3-projection-checkpoints.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_exl3_projection_checkpoint.py

This 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.

Serialize configs without the empty state-dict cleanup path and replace completed shard files atomically. Keep live config fields authoritative and preserve source-only extensions. Retain the previous shard on write failures.
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.
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.
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.
- inspect_committed_manifests treated a tensor written before its manifest
  as corruption, so a crash between the two atomic writes blocked
  reserve_module_request on resume. The manifest is the commit marker;
  ignore tensor-only entries (prune still reclaims them).
- commit now validates the request digest before writing and rejects a
  reused request with a different tensor set as a collision instead of
  raising KeyError.
- Add regression tests.

@Qubitium Qubitium left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review (layer 13)

Reviewed the incremental layer-13 commit (6761a5d6f, 4 files, +1146). The content-addressed store, manifest binding, and prune path are solid. I pushed a fix commit (066bdef7f).

Fixed

  1. Interrupted commits blocked resume. commit publishes the tensor before the manifest, so a crash between the two leaves a tensor-only entry. inspect_committed_manifests treated that as "incomplete committed pair", so reserve_module_request failed on the next run — before prune could reclaim the orphan. The manifest is the commit marker, so tensor-only entries are now ignored by inspection (prune still removes them). Regression test added.
  2. Request digest validation. commit and load now validate request_sha256 against the request body before using it as a path, so a malformed request cannot write an unreadable checkpoint.
  3. Tensor-set collision. Reusing a request with a different tensor set now raises "collision" instead of KeyError.

Verification

tests/test_exl3_projection_checkpoint.py: 14 passed (11 original + 3 new). ruff check clean.

Notes (not changed)

  • inspect_committed_manifests validates the manifest and declared tensor identity but deliberately not the request schema; load_committed validates tensor content against the manifest. A checkpoint with a self-consistent digest but unexpected request fields would load via load_committed. Acceptable for a local, opt-in store, but worth documenting.
  • prune reads and hashes every committed payload; fine for a maintenance path, but it is O(checkpoint bytes).

@Qubitium
Qubitium marked this pull request as ready for review November 9, 2026 08:57
@Qubitium
Qubitium merged commit 97945ea into ModelCloud:main Nov 9, 2026
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.

2 participants