Skip to content

docs: cuinterpose design and limitations - #208

Closed
galletas1712 wants to merge 2 commits into
feat/cuinterpose-multicast-statefrom
docs/cuinterpose
Closed

galletas1712 wants to merge 2 commits into
feat/cuinterpose-multicast-statefrom
docs/cuinterpose

Conversation

@galletas1712

Copy link
Copy Markdown
Contributor

Summary

docs/reference/cuinterpose.md: the design for reviewers (problem, cast, flows as sequence diagrams, lifecycle phases, formats, invariants, measured performance, pitfalls, unsupported cases, accepted risks, knobs and log lines, test matrix, per-PR reading guide). docs/limitations.md: what checkpointing shared CUDA memory does not cover. The vLLM guide gains SNAPSHOT_ENGINE_ARGS and a tensor-parallel section (annotation, explicit command, PodSnapshot versus SnapshotJob shaping, keeping FlashInfer's allreduce on POSIX descriptors). The shim README shrinks to usage, build, and tests.

Validation

make verify-license-headers, make helm-lint; the vLLM guide's app.py is the one used in the end-to-end run described in the other PRs.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Comment @coderabbitai help to get the list of available commands.

galletas1712 and others added 2 commits September 4, 2026 10:50
pytest suite under agent/cmd/cuinterpose/tests/gpu that runs the shim and
the coordinator against the real driver on two GPUs, through
`cuda-checkpoint --launch-job` so the workers are checkpointable. The test
process starts one interposed parent that forks two PyTorch workers; each
creates POSIX-shareable allocations of its own (one before any CUDA context
exists, one large one filled with seeded random bytes), imports a descriptor
from the uninterposed test process, shares a symmetric-memory buffer with
the other rank, and captures a collective into a CUDA graph. The test runs
the coordinator, the native cuCheckpointProcess* sequence through
cuda.bindings, and the coordinator again, then checks that only the state
file was written, that the coordinator's summary counts at least the
workers' own allocations as carried, that the host-to-device copies reached
a fraction (default 80%) of a pinned copy measured on the same machine, that
every byte survived and the graph replays with the right result, and that a
fresh raw import works. A second test holds a raw import across prepare and
checks the refusal names it and the workload keeps working. The multicast
variant runs PyTorch's multimem all-reduce with one rank rebinding its slice
through cuMulticastBindAddr, and skips without NVLink.

Prebuilt binaries are used through CUINTERPOSE_BUILD_DIR (for example copied
out of the agent image); otherwise the tests build the shim with CUDA_HOME.
Dependencies are pinned in pyproject.toml against the cu130 torch index.

Run on two B200s (nscale-dev): 3 passed; carrier restore phase 87 to 108
GB/s aggregate over the two GPUs against a 55 GB/s single-GPU pinned baseline.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Completes docs/reference/cuinterpose.md for reviewers of the cuinterpose
stack: the other flows (fork, short-lived processes, agent restart, failed
prepare and restore), the lifecycle phases as a state diagram with what
each entry point returns per phase, the on-disk and on-wire formats, the
invariants, measured performance on B200 (checkpoint 52 s of which CRIU
49 s and cuinterpose 0.43 s; restore 5.7 s of which cuinterpose 0.35 s;
host carriers before and after the pinned arena), the pitfalls that shaped
the design, what is explicitly unsupported and why, accepted risks, knobs
and log lines, the test matrix, and a per-PR reading guide.

docs/limitations.md gains the user-facing list of what checkpointing shared
CUDA memory does not cover. The vLLM guide's app.py takes extra engine
arguments from SNAPSHOT_ENGINE_ARGS (JSON, nested configs converted to
vLLM's dataclasses) and the guide explains the tensor-parallel setup: the
cuinterpose annotation, an explicit command, PodSnapshot versus SnapshotJob
shaping, and keeping FlashInfer's allreduce on POSIX descriptors. The shim
README gains the per-suite test descriptions.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@galletas1712

Copy link
Copy Markdown
Contributor Author

Superseded by #211: the stack gained a GPU-tests PR (#210) below the docs, and GitHub does not allow changing this PR's base within the stack.

@galletas1712
galletas1712 deleted the docs/cuinterpose branch September 4, 2026 18:27
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