Skip to content

feat(exl3): dispatch authenticated projections to pipelined workers - #3598

Merged
Qubitium merged 20 commits into
ModelCloud:mainfrom
tpurtell:upstream/18-exl3-remote-workers-20261108
Nov 9, 2026
Merged

Qubitium merged 20 commits into
ModelCloud:mainfrom
tpurtell:upstream/18-exl3-remote-workers-20261108

Conversation

@tpurtell

@tpurtell tpurtell commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Carry authenticated tensor transport, dynamic coordinator/remote slot scheduling, projection checkpoint reuse, bounded scratch retention, per-device serialization, and remote Hessian failure diagnostics. This preserves the existing explicit NVIDIA execution contract; it does not newly qualify ROCm.

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

Incremental change: 4 files, +1830/−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["encode_tensor_envelope"]
    S1["decode_tensor_envelope"]
    S2["execute_remote_projection"]
    S3["EXL3RemoteClient"]
    M3_0["EXL3RemoteClient.__init__"]
    E["AssertionError, RuntimeError, ValueError"]
    S0 -->|"raises on rejected input/state"| E
    S1 -->|"raises on rejected input/state"| E
    S2 -->|"raises on rejected input/state"| E
    S3 -. "exposes" .-> M3_0
    S3 -->|"calls where selected"| S0
    S3 -->|"calls where selected"| S1
    S3 -->|"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_remote.py:243: encode_tensor_envelope
API absent in the previous stack layer (path/symbol checked) gptqmodel/utils/exl3_remote.py:266: decode_tensor_envelope
API absent in the previous stack layer (path/symbol checked) gptqmodel/utils/exl3_remote.py:473: execute_remote_projection
API absent in the previous stack layer (path/symbol checked) gptqmodel/utils/exl3_remote.py:627: EXL3RemoteClient

Committed reference: docs/exl3-remote-workers.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_remote.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.
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.
- validate_remote_inputs/output_tensors used set literals for codebook and
  apply_out_scales membership, so a malformed list value raised TypeError
  instead of the documented ValueError. Use tuples and build the expected
  tensor-name set only after the codebook is validated.
- Satisfy the ruff import-order gate; add a regression 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 18)

Reviewed the incremental layer-18 commit (891404198, 4 files, +1830). The authenticated envelope, HMAC request/response path, durable slot assignments, bounded pipeline staging, and worker checkpoint resume are sound. I pushed a fix commit (2e6d2e251).

Fixed

  1. Malformed codebook raised TypeError. validate_remote_inputs and validate_remote_output_tensors used set literals for codebook / apply_out_scales membership, so a list value raised TypeError instead of the documented ValueError; the output path also built expected_names before validating the codebook. Both now use tuple membership and validate before building the set. Regression test added.
  2. Ruff I001 (import order) in both new files.

Verification

tests/test_exl3_remote.py: 15 passed (14 original + 1 new). ruff check clean.

Notes (not changed)

  • _ensure_assignment_directory creates missing directories without exist_ok, so two coordinators racing to create the same prefix can raise FileExistsError rather than reusing the directory.
  • _persist_assignment treats an existing record as an error; recovery relies on _load_assignments having populated the in-memory map first. A record created between client construction and the first acquire_slot is rejected rather than adopted.
  • _read_response trusts Content-Length when present; a chunked response without it is accepted after the size cap.

@Qubitium
Qubitium marked this pull request as ready for review November 9, 2026 09:06
@Qubitium
Qubitium merged commit cd87c6a into ModelCloud:main Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Review found a publication race and slot-capacity issue across EXL3 coordinators. #3714 adds exclusive publication and cross-process slot locks.

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