feat(agent): checkpoint CUDA multicast state - #207
Closed
galletas1712 wants to merge 1 commit into
Closed
galletas1712 wants to merge 1 commit into
galletas1712 wants to merge 1 commit into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
multicast.c now tracks multicast objects (cuMulticast*) created with the POSIX descriptor handle type the way interpose.c tracks allocations, and the coordinator's four multicast restore phases do real work: - Logical handles over one driver handle per object per process; tickets for sharing, with the creator's one real export held in the export cache and served to importers by the listener (which now accepts multicast resource requests). - Records of the devices this process attached, the slices it bound (by handle or by address, v1 or device-explicit v2 ABI, tracked members marked shared), and its mappings with merged per-location access. - The effective extent: r615 gives an object more capacity than requested and NCCL binds and maps into it, so INSPECT reports the largest extent used while restore replays the requested size; the coordinator takes the largest extent across participants instead of requiring equality. - Create, add-device, bind, and map are team collectives that block until the other ranks arrive, so the lock is dropped around them and the object looked up again afterwards, undoing the call if a checkpoint began. - PREPARE_MULTICAST closes the cached export descriptor before unmapping, unbinding, and releasing the object; RESTORE_MULTICAST_CREATORS recreates and re-exports, IMPORTERS fetch from the creator, DEVICES reattach, and RESTORE_MULTICAST rebinds and remaps, each behind a coordinator barrier because binding waits for the whole team. - Non-POSIX objects pass through untracked (one log line for FABRIC); binding memory the shim does not track to a tracked object is refused. The CUDA-context helpers move to context.c, shared by both modules; allocations and objects without a context fall back to a device's primary context during the lifecycle. Tests: multicast_test drives a two-rank group (BindMem in the creator, BindAddr_v2 in the importer) through the real coordinator over the fake driver, which now models multicast objects (capacity rounding, device attachment before bind, bindings, cross-process import descriptions); plus the effective extent, unbind-then-BindAddr, pass-through, refusal of untracked members, and the descriptor-before-object teardown order. The coordinator driver helper is shared with the lifecycle test. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
galletas1712
force-pushed
the
feat/cuinterpose-multicast-state
branch
from
September 4, 2026 17:52
fc274d9 to
e24fda7
Compare
Contributor
Author
|
Superseded by the nine-PR re-cut (packaging → delivery → agent → forwarding → coordinator → tracking → lifecycle → multicast → GPU tests): Go and packaging split by component, tests trimmed, docs held back. The replacement PRs are listed on the packaging PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Multicast objects (
cuMulticast*) tracked like allocations and rebuilt in four phases. Doc:docs/reference/cuinterpose.md§3.3 (multicast phases), §6 (barrier and export invariants), and the second and third pitfalls in §8.multicast.c: logical handles over one driver handle per object per process; tickets served from the export cache; records of attached devices, bindings (by handle or address, v1 or device-explicit ABI), and mappings with merged access; the effective extent (r615 gives more capacity than requested and NCCL uses it; the coordinator takes the largest extent any participant reports); create, add-device, bind, and map run without the state lock and re-look up the object afterwards; PREPARE_MULTICAST closes the cached descriptor before releasing the object; creators recreate and re-export, importers fetch, everyone attaches devices, then binds and maps, each behind a coordinator barrier.multicast_preload_test(two-rank group through the real coordinator over a fake driver that now models multicast objects, effective extent, unbind then rebind by address, pass-through, refusal of untracked members, descriptor-before-object teardown).Origin
Re-cut of #133 (both commits: c47baab's rationale for parallel PREPARE_MULTICAST and
-pthreadis now in the coordinator's comments) and the multicast tracking half of #79.#133 feat(agent): checkpoint CUDA multicast state (verbatim, bot blocks removed)
Review threads carried
No review threads on #133. The #79 threads are in PR 2's table; the multicast-specific dispositions: no
export_raw(cache), state v2 accepted and documented, bounds and completeness checked by the coordinator with extents taken as the largest reported.Validation
go test ./...inapi,operator,agent;make lint,make helm-lint,make verify-license-headers.cuda-checkpoint --launch-job): POSIX round trip with seeded 1 GiB carriers per rank, multicast round trip with PyTorch's multimem all-reduce and acuMulticastBindAddrrebind, refusal while a raw import is alive: 3 passed. Host-carrier restore phase 87 to 108 GB/s aggregate over two GPUs (pinned-copy baseline 55 GB/s per GPU).AsyncLLM, Qwen3-0.6B, tensor parallel 2, FlashInfer TRT-LLM attention and fused allreduce (trtllmbackend), PodSnapshot of a Deployment shaped withpodcontract.ShapeCuinterposeCapture, then restore: checkpoint 52 s (CRIU dump 49 s, cuinterpose prepare 0.43 s; 4 CUDA processes, 1052 records, 382 host carriers, 2.08 GB); restore 5.7 s (cuinterpose 0.35 s: carriers 0.05 s, unicast 0.09 s, multicast 0.18 s); the restored replica answers coherently ("The capital of Italy is Rome").🤖 Generated with Claude Code