Skip to content

Sealed all-sum for two-rank tensor parallel (pinned by d-inference#1407) - #35

Draft
jonathan308 wants to merge 1 commit into
darkbloom/jaccl-send-frame-progress-guardfrom
darkbloom/sealed-all-sum
Draft

jonathan308 wants to merge 1 commit into
darkbloom/jaccl-send-frame-progress-guardfrom
darkbloom/sealed-all-sum

Conversation

@jonathan308

Copy link
Copy Markdown

Adds a sealed all-sum for two ranks: each rank's partial result crosses the link only as a frame sealed by a codec the caller supplies. Darkbloom's tensor-parallel cluster mode uses it so model activations never cross the Thunderbolt link in the clear.

  • mlx/distributed/sealed.{h,cpp}: the sealed all-sum primitive and the codec interface.
  • mlx/distributed/primitives.h, CMakeLists.txt: registration and build.

Stacked on #33 (JACCL fixes); review that one first. Layr-Labs/d-inference#1407 pins this branch at 535d4e4 through mlx-swift (darkbloom/sealed-all-sum).

Hardware: exercised by the two-Mac tensor-parallel runs recorded on d-inference#1407 (Qwen 3.5 9B and Qwen 3.8 27B).

🤖 Generated with Claude Code

…codec-sealed frames)

all_sum_sealed(x, group, stream) is evaluated on the CPU stream inside the
lazy graph like the native all-sum: the local partial is sealed by a codec
the embedding program installs (set_seal_codec: seal, open, context,
per-frame overhead), the two frames are all-gathered over the group, the
peer's frame is opened (a frame that does not authenticate fails the
evaluation; there is no plaintext fallback) and the partials are added in
rank order (rank 0 + rank 1) so both ranks hold the same bits. float32,
bfloat16, float16; a counter advances per sealed all-sum in evaluation
order, identically on both ranks, for the codec's nonces. No codec: the
graph refuses to build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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