Skip to content

feat(exl3): persist authenticated capture frontiers - #3594

Merged
Qubitium merged 16 commits into
ModelCloud:mainfrom
tpurtell:upstream/14-exl3-capture-frontiers-20261108
Nov 9, 2026
Merged

Qubitium merged 16 commits into
ModelCloud:mainfrom
tpurtell:upstream/14-exl3-capture-frontiers-20261108

Conversation

@tpurtell

@tpurtell tpurtell commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Preserve durable capture descriptors, tensor/route evidence, bounded frontier hydration, and namespace-scoped cleanup as a standalone store for the following looper integration.

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

Incremental change: 4 files, +1139/−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["EXL3CaptureDescriptor"]
    S1["EXL3CaptureFrontierStore"]
    M1_0["EXL3CaptureFrontierStore.__init__"]
    M1_1["EXL3CaptureFrontierStore.restore_index"]
    M1_2["EXL3CaptureFrontierStore.load_record_hessian"]
    E["EXL3CaptureFrontierError"]
    S1 -. "exposes" .-> M1_0
    S1 -. "exposes" .-> M1_1
    S1 -. "exposes" .-> M1_2
    S1 -->|"calls where selected"| S0
    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_capture_frontier.py:56: EXL3CaptureDescriptor
API absent in the previous stack layer (path/symbol checked) gptqmodel/utils/exl3_capture_frontier.py:142: EXL3CaptureFrontierStore

Committed reference: docs/exl3-capture-frontiers.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_capture_frontier.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.
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.
- Normalize family_join through its JSON form so a resumed store compares
  equal to the manifest after tuples become lists and non-finite values are
  rejected up front.
- Publish the artifact tree and payloads as 0644/0755 so an unprivileged
  host validator can read them, matching the projection checkpoint store.
- Skip the two tests that call EXL3Processor capture-frontier methods that
  land in a later stack layer; add a round-trip/readability test.

@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 14)

Reviewed the incremental layer-14 commit (3188a5c6d, 4 files, +1139). The crash-consistent temp-dir → os.replace publication and payload hashing are sound. I pushed a fix commit (9193389d1).

Fixed

  1. Family identity round-trip. __init__ stored family_join verbatim while _read_manifest compares it to the JSON-parsed manifest. A tuple (or other JSON-normalizable value) in family_join would never validate on restore. It is now normalized through its canonical JSON form, and non-finite values are rejected up front.
  2. Artifact readability. mkdtemp produces 0700 and safetensors payloads were 0600, so an unprivileged host validator could not read the frontier. The published tree is now 0755 and payload/manifest files 0644, matching the projection-checkpoint store.
  3. Two tests fail on the head because they call EXL3Processor.commit_subset_capture_frontier / _hydrate_capture_frontier, which do not exist in this branch or main. They are now skipped with a reason; move them to the looper-integration layer.

Verification

tests/test_exl3_capture_frontier.py: 7 passed, 2 skipped (including a new round-trip/readability test). ruff check clean.

Notes (not changed)

  • commit_streaming returns a pre-existing manifest after _read_manifest without validating its captures; restore_index is the validating path.
  • _prune_incomplete removes any .capture-*.tmp directory, so concurrent commits into one root can delete each other's in-progress temp tree. Serialized workers are assumed; worth documenting.
  • discard_through(block_namespace=None) removes by layer alone and does not check family_join; it relies on the root being run-scoped.

@Qubitium
Qubitium marked this pull request as ready for review November 9, 2026 08:59
@Qubitium
Qubitium merged commit cd675d0 into ModelCloud:main Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Review found interrupted frontier cleanup could block restart. #3715 now renames the frontier to a tombstone before deletion.

Qubitium added a commit that referenced this pull request Nov 17, 2026
) (#4991)

Seven EXL3 tests carried an unconditional module-level
``pytest.mark.skip`` with "lands in a later stack layer" reasons from
#3592/#3594/#3599. That wiring landed long ago, so shipped code paths had
tests that pass but nobody ever ran.

- test_exl3_capture_frontier.py / test_exl3_error_ledger.py: drop the
  ``_processor_wiring_pending`` skip and its decorators; all four tests
  run and pass.
- test_quantize_config_offload_tempdir.py: drop two ``pytest.mark.skip``
  decorators; widen the two tiny ``nn.Linear(16, ...)`` layers to 128
  because EXL3 requires in_features to be a multiple of 128.
- kernels/test_kernel_compile_levels_quant.py: gate the Paro cases on
  ``awq_runtime_available()``/``awq_runtime_error()`` instead of
  ``CUDA_HOME`` plus an ``nvcc``-on-PATH probe, which misreported the
  runtime as available.
- Add tests/test_exl3_skip_reasons_4981.py, an AST guard that fails if
  any EXL3 test reintroduces an unconditional ``pytest.mark.skip``. A
  real precondition belongs in ``skipif`` with a precise reason.

The Machete JIT gate in test_machete_jit.py is deliberately left alone:
swapping the ``nvcc``-on-PATH probe for
``cuda_source_build_available()`` turns a skip into a failure on hosts
whose toolkit and headers disagree, which is worse than the status quo.

Fixes #4981
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