Skip to content

fix(agent): recreate large shared allocations on restore - #165

Closed
galletas1712 wants to merge 1 commit into
fix/cuinterpose-restore-access-and-multicast-lockfrom
fix/cuinterpose-host-backed-fla-restore
Closed

galletas1712 wants to merge 1 commit into
fix/cuinterpose-restore-access-and-multicast-lockfrom
fix/cuinterpose-host-backed-fla-restore

Conversation

@galletas1712

@galletas1712 galletas1712 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve large shared POSIX-exportable device allocations in anonymous pinned host memory owned by the workload process before CUDA checkpoint
  • release the original exportable device backing before native CUDA checkpoint
  • let CRIU capture the pinned host carrier as ordinary process memory; no carrier sidecar files are created
  • after restore, create fresh exportable device backing, restore bytes with H2D, then unregister and unmap the host carrier
  • transfer creator ranks in parallel and use bounded control timeouts
  • force the path in test_cucheckpoint.py without changing the production threshold, and assert that no carrier files appear

This is a transparent r615 workaround for large shared allocations whose bytes restore but whose original post-restore POSIX export state is stale. It does not change the driver, disable FLA/FABRIC, require GMS, or retain a second device allocation. Small, non-shared, non-POSIX-exportable, and non-device allocations remain on the native CUDA checkpoint path.

Validation

  • exact 578 MiB two-GPU symmetric-memory A/B:
    • PR feat(agent): checkpoint CUDA multicast state #133 without this workaround fails during coordinator restore when creator re-export returns CUDA_ERROR_INVALID_VALUE
    • this patch restores successfully and verifies CUDA-graph output and allocation bytes
  • native CUDA checkpoint test builds the shim with HOST_CARRIER_THRESHOLD=1, exercises the carrier path, and rejects any cuinterposer-host-*.bin artifact
  • GLM 5.2 / DeepSeek-V4-Flash-NVFP4 SGLang TP8/EP8 on eight B200 GPUs, context length 32768, with warm compile/JIT/FlashInfer caches:
    • source startup: 87.02 s
    • checkpoint: 290.891 s total; CRIU dump 262.580 s; CUDA checkpoint 27.632 s
    • active restore: 37.410 s total; CRIU 12.914 s; CUDA 24.291 s
    • standby restore: 40.165 s total; CRIU 12.921 s; CUDA 27.033 s
    • aggregate CRIU process artifact: about 100 GiB; no separate carrier artifact
    • coherent post-restore and post-promotion inference both returned 17 * 23 = 391
  • clean CUDA-image build with -Wall -Wextra -Werror
  • git diff --check
  • python3 -m py_compile agent/cmd/cuinterpose/tests/test_cucheckpoint.py

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 8594f3c2-bc6d-4d22-abf7-539ca6a02bc0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@galletas1712
galletas1712 force-pushed the fix/cuinterpose-host-backed-fla-restore branch from ed51e91 to 0cc1964 Compare September 2, 2026 00:55
@galletas1712
galletas1712 force-pushed the fix/cuinterpose-host-backed-fla-restore branch from 0cc1964 to 4cabaf6 Compare September 2, 2026 06:53
@galletas1712
galletas1712 force-pushed the fix/cuinterpose-host-backed-fla-restore branch from 4cabaf6 to f537c58 Compare September 2, 2026 07:50
@galletas1712
galletas1712 force-pushed the fix/cuinterpose-host-backed-fla-restore branch from f537c58 to 3d30d21 Compare September 2, 2026 08:35
@galletas1712
galletas1712 force-pushed the fix/cuinterpose-host-backed-fla-restore branch 2 times, most recently from 10cc986 to 3d30d21 Compare September 2, 2026 20:20
Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
@galletas1712

Copy link
Copy Markdown
Contributor Author

Superseded by #218 (lifecycle: host carrier for every tracked creator allocation, restored through one pinned arena per process). The re-cut stack (#212#220) supersedes this PR. Its body is quoted verbatim in the replacement's Origin section, and each review thread here has a row in the replacement's "Review threads carried" table with what was done about it.

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