feat(agent): cuinterpose coordinator - #204
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 |
Add cuinterpose-coordinator, the static program the snapshot agent runs once before the native CUDA checkpoint and once after the native CUDA restore. The coordinator talks to every CUDA process over the shim's control socket, checks that their descriptions of shared memory agree, refuses to prepare while any process still holds an untracked import, drives teardown and rebuild in the order the driver needs, and writes the cuinterpose.state sidecar with an atomic rename and a directory fsync. Every restore phase is dispatched to all participants at once with a barrier after it; the barrier before multicast binding is a driver requirement, since cuMulticastBindMem spins until every device of the team is attached. The coordinator prints one progress line per phase with elapsed time and, for the carrier phases, bytes and throughput, which the agent logs. Compared with the earlier coordinator layer (#155): SIGPIPE from a participant that hung up no longer kills the coordinator; a missing state file on restore is an error instead of a silent success; --control-dir replaces a hard-coded path and an environment fallback; multicast BIND_MEM records are checked against the member allocation's bounds; diagnostics no longer print stale indices; timeouts use the SNAPSHOT_ prefix; and the coordinator is covered by a GoogleTest suite against fake participants, run during the image build. This is an intermediate layer: the shim does not answer control requests until the tracking and lifecycle changes land, so an annotated Pod is still refused by the agent's fail-closed detection here. Restoring on a node whose agent image differs from the checkpoint node's is not verified and fails inside CRIU's file validation; this is deferred. Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
galletas1712
force-pushed
the
feat/cuinterpose-coordinator
branch
from
September 4, 2026 17:52
574a1e0 to
858e1c6
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
coordinator.c, replacing PR 1's placeholder:--prepare|--restore --proc-root --checkpoint-dir --control-dir --process OBS NS...; IDENTIFY, INSPECT, topology validation (one creator per allocation, mappings in bounds, multicast groups complete, bind-mem member bounds), refusal while any participant holds live raw imports, phases with barriers (the multicast barrier is a driver requirement:cuMulticastBindMemspins until every device of the team is attached),cuinterpose.state(cuinterpose-state-v2) written with atomic rename and directory fsync and mandatory on restore, one machine-readable progress line per phase. Doc:docs/reference/cuinterpose.md§3.2, §3.3, §5, §6.Intermediate layer: the shim does not answer control requests until PRs 4 and 5, so an annotated Pod is still refused here.
coordinator_testruns the binary against fake participants (phase ordering, barrier, topology validation, raw import refusal, state file golden, every restore precondition).Origin
Re-cut of #155.
#155 feat(agent): coordinate CUDA interposer lifecycle (verbatim, bot blocks removed)
Review threads carried
No review threads on #155. The coordinator threads from #78 and #79 are listed in PR 2's table; all of them are fixed here.
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