Skip to content

feat(nvsnap): enable UV_USE_IO_URING after CRIU SQ-array restore fix#225

Open
balajinvda wants to merge 9 commits into
mainfrom
nvsnap-iouring-sqarray-prod
Open

feat(nvsnap): enable UV_USE_IO_URING after CRIU SQ-array restore fix#225
balajinvda wants to merge 9 commits into
mainfrom
nvsnap-iouring-sqarray-prod

Conversation

@balajinvda

@balajinvda balajinvda commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Why

Three pieces, all validated end-to-end on aws-dev1 (H100, criu-v2):

  1. io_uring SQ-array restore fix (original scope): a freshly io_uring_setup'd ring has a kernel-zeroed SQ array; the identity map is written once at setup and never re-established at restore, so libuv aborted post-restore. The CRIU fork re-writes it, so UV_USE_IO_URING=1 is safe again.
  2. Multi-GPU criu-v2 groundwork + a source-built cuda-checkpoint.
  3. Restore speedup (Lever A): madvise huge-page CRIU restore.

What changed

  • CRIU ref pinned to 1ddd5c9c3 (SQ-array fix + madvise huge-page restore); base v0.0.11 / app v0.2.21.
  • cuda-checkpoint built from source (docker/agent/nvsnap-cuda-checkpoint.c) in a cuda-cli-builder stage; committed NVIDIA prebuilt removed (unblocks arm64, extensible).
  • Multi-GPU experiment ladder: vllm-mp (multi-process), vllm-tp2 (TP=2 eager, peer-state-severed) + test-e2e.sh cases; node selection picks most-free-GPU node.
  • Lever A: the CRIU fork madvise(MADV_HUGEPAGE)s the premapped private-VMA arena before faulting in the process image, so it populates as 2MB pages instead of ~800k 4KB pages. Best-effort, degrades to a no-op on non-THP nodes, never affects correctness. Design in docs/proposals/single-gpu-restore-speedup.md.

Restore speedup: before / after (agent restore, single GPU)

Every single-GPU workload restores faster; the win grows with the process's CPU-side memory footprint (the huge-page fault-reduction mechanism).

Workload Checkpoint Before (v0.2.20) After Lever A (v0.2.21) Delta
vllm-small 3.2G 44.3s 32.2s -27%
vllm-8b 18G 58.9s 38.5s -35%
e5-mistral 15G 84.0s 40.8s -51%
vllm-qwen32b 64G 77.4s 48.5s -37%

Phase-level (vllm-small -v4 restore.log): CPU pages restore 13.5s -> 3.8s (-72%); CUDA plugin restore ~27s unchanged; CRIU restore total 40.3s -> 28.2s. No RSS bloat: AnonHugePages=0 in the final restored process (huge pages are transient to the staging arena and split on the remap to final addresses).

Testing

criu-v2 single-GPU regression 5/5 PASS on the Lever A build, every checkpoint/restore driven by the source-built CLI: vllm-small, vllm-8b (38.5s), e5-mistral (40.8s), vllm-qwen32b (64G, 48.5s). Multi-GPU: vllm-mp + vllm-tp2 (TP=2, config-severed) PASS - first criu-v2 multi-GPU C/R. Default-config multi-GPU still needs the transparent sever (issue #25), tracked separately.

Customer Release Notes

criu-v2 GPU checkpoint/restore is ~30% faster to restore (huge-page memory install), handles io_uring/uvloop and multi-process single-GPU workloads, and builds cuda-checkpoint from source (arm64-capable).

References

Relates to #71

Summary by CodeRabbit

  • New Features
    • Added vLLM multi-process (vllm-mp) and TP=2 (vllm-tp2) workload/restore manifests.
  • Enhancements
    • Enabled io_uring for supported vLLM workloads.
    • Upgraded the nvsnap agent image to v0.2.21 across workloads.
  • Bug Fixes
    • Improved GPU-node selection by picking the node with most free GPUs.
  • Documentation
    • Updated CUDA checkpoint build guidance and added single-GPU restore speedup plus huge-page benchmark docs.
  • Tests / Chores
    • Expanded end-to-end tests for vllm-mp and vllm-tp2; added SPDX headers to Dockerfiles.

libuv/uvloop servers (vLLM, e5-mistral) previously had to pin
UV_USE_IO_URING=0 under criu-v2: the restored libuv SQPOLL io_uring ring
aborted the event loop on the first epoll_ctl_flush (SIGABRT, nvsnap#107).
Root cause was in CRIU's io_uring restore, which recreated a fresh ring
but never rebuilt the SQ-array identity map (sq_array[i] = i) that
liburing/libuv write once at setup; every restored submission then
resolved to SQE 0 and completions never returned.

The CRIU fork now rebuilds that identity map on restore
(io-uring-cr commit 0a9963ed0). Pin the base build to it and re-enable
UV_USE_IO_URING=1 on the single-GPU criu-v2 workloads.

- versions.sh: NVSNAP_CRIU_REF -> 0a9963ed0; base v0.0.9; app v0.2.19.
- vllm-small, vllm-8b, vllm-qwen32b, e5-mistral: UV_USE_IO_URING 0 -> 1.

Validated e2e on aws-dev1 (kernel 6.8): all four checkpoint, restore, and
serve inference with io_uring on, zero event-loop aborts.

Co-Authored-By: Balaji Ganesan <bganesan@nvidia.com>
@balajinvda
balajinvda requested a review from a team as a code owner July 17, 2026 04:31
@github-actions

Copy link
Copy Markdown

🛡️ CodeQL Analysis

🚨 Found 2 issue(s)

Severity Breakdown:

  • 🔴 Errors: 0
  • 🟡 Warnings: 0
  • 🔵 Notes: 0
📋 Top Issues

🔗 View full details in Security tab

🕐 Last updated: 2026-07-17 04:33:48 UTC | Commit: a9701c1

@balajinvda balajinvda self-assigned this Jul 17, 2026
balaji-g and others added 3 commits July 19, 2026 08:14
…fixes

- vllm-mp: TP=1 multi-process (separate EngineCore + ZMQ RPC) — criu-v2 e2e
  PASSES; the historical multi-process restore blocker does not apply to the
  in-namespace engine.
- vllm-tp2: TP=2 eager with the peer-state sever profile (disable custom
  all-reduce, symm-mem, NCCL P2P/NVLS/SHM -> PYNCCL sockets) — criu-v2 e2e
  PASSES: 5.3G checkpoint, 57s restore, both TP workers and both GPUs
  restored, inference serves. First criu-v2 multi-GPU checkpoint/restore.
  Default config (peer state on) hangs per-rank cuda-checkpoint even with
  all ranks locked first; a transparent sever is required (issue #25).
- test-e2e.sh: workload cases for both; node selection now picks the node
  with the MOST free GPUs instead of first-fit (first-fit caused repeated
  UnexpectedAdmissionError on the delete->recreate placeholder cycle).

Co-Authored-By: Balaji Ganesan <bganesan@nvidia.com>
…inary

Promote nvsnap-cuda-checkpoint.c (a drop-in cuda-checkpoint CLI on the
public CUDA driver checkpoint API, cuCheckpointProcess*, driver 570+) from
the research tree into docker/agent/ and compile it in a new
cuda-cli-builder stage in Dockerfile.base (nvidia/cuda:12.8.1-devel; links
against the toolkit stub, resolves the node's real libcuda at runtime via
the existing wrapper). The build fails if the provenance marker string is
missing from the produced binary.

Replaces the committed NVIDIA prebuilt binary (removed): the public
release is x86-64 only, so this unblocks arm64 (no committed binaries per
arch), and gives us an extensible CLI (lock --timeout today; r580 gpuPairs
migration next). build_app's stale binary-copy requirement is removed —
the app image only overlays the wrapper; the binary comes from base.

Validated as base v0.0.10 / app v0.2.20 on aws-dev1 (driver 580.126):
on-node binary provenance-verified, then the full criu-v2 regression
suite passed 6/6 with every checkpoint/restore driven by this CLI —
vllm-small, vllm-8b, e5-mistral, vllm-qwen32b (64G), vllm-mp
(multi-process), vllm-tp2 (TP=2 multi-GPU, config-severed).

Co-Authored-By: Balaji Ganesan <bganesan@nvidia.com>
…ckpoint)

Co-Authored-By: Balaji Ganesan <bganesan@nvidia.com>
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change builds CUDA checkpoint tooling from source, updates nvsnap image and CRIU versions, adds vLLM multi-process and tensor-parallel manifests, enables io_uring in selected workloads, extends end-to-end workload selection, and adds Docker build, test-image, and restore-speedup documentation.

Changes

CUDA checkpoint tooling

Layer / File(s) Summary
CUDA checkpoint CLI
src/compute-plane-services/nvsnap/docker/agent/nvsnap-cuda-checkpoint.c
Adds CUDA process-state queries, checkpoint actions, toggle behavior, error handling, and command-line validation.
Source-built CUDA checkpoint integration
src/compute-plane-services/nvsnap/docker/agent/Dockerfile.base, src/compute-plane-services/nvsnap/scripts/build-agent.sh, src/compute-plane-services/nvsnap/CONTRIBUTING.md, src/compute-plane-services/nvsnap/docker/agent/Dockerfile.app.patch
Builds the CLI in a CUDA builder stage, verifies its provenance, installs it into the base image, removes prebuilt binary staging, fixes wrapper placement, and documents source builds.

vLLM workload and restore support

Layer / File(s) Summary
vLLM source and restore manifests
src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-{mp,tp2}*.yaml
Adds multi-process and TP=2 vLLM workloads with matching restore placeholders, GPU resources, readiness probes, runtime settings, and storage mounts.
Restore-compatible runtime settings
src/compute-plane-services/nvsnap/deploy/k8s/workloads/e5-mistral.yaml, src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-{8b,qwen32b,small}.yaml
Sets UV_USE_IO_URING to "1" and updates CRIU compatibility comments.
End-to-end workload integration
src/compute-plane-services/nvsnap/scripts/test-e2e.sh
Adds vLLM workload cases and selects the eligible GPU node with the most free GPUs.

nvsnap release rollout

Layer / File(s) Summary
Version and CRIU pin updates
src/compute-plane-services/nvsnap/scripts/versions.sh
Updates default base/app versions and the pinned CRIU fork commit.
Agent image references
src/compute-plane-services/nvsnap/deploy/k8s/agent-daemonset*.yaml, src/compute-plane-services/nvsnap/deploy/k8s/benchmarks/*, src/compute-plane-services/nvsnap/deploy/k8s/workloads/*
Updates deployment and init-container nvsnap-agent references from v0.2.17 to v0.2.21.

Build and test image updates

Layer / File(s) Summary
Docker build definitions
src/compute-plane-services/nvsnap/docker/**/Dockerfile*, src/compute-plane-services/nvsnap/placeholder/Dockerfile*, src/compute-plane-services/nvsnap/tests/uvloop-mp-test/Dockerfile
Adds SPDX headers, introduces a minimal CRIU builder, and defines a Python 3.12 uvloop multiprocessing test image.
Restore speedup documentation
src/compute-plane-services/nvsnap/docs/BENCHMARK.md, src/compute-plane-services/nvsnap/docs/proposals/single-gpu-restore-speedup.md
Documents huge-page restore measurements, optimization levers, selected scope, implementation phases, and open questions.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant E2E as test-e2e.sh
  participant K8s as Kubernetes
  participant Workload as vLLM workload
  participant Restore as vLLM restore pod
  E2E->>K8s: Apply vllm-mp or vllm-tp2 manifest
  K8s->>Workload: Start vLLM server
  Workload-->>E2E: Report /v1/models readiness
  E2E->>K8s: Apply restore manifest with checkpoint ID
  K8s->>Restore: Start restore placeholder
  Restore-->>E2E: Report restored /v1/models readiness
Loading

Suggested reviewers: famousdirector

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly captures the main functional change: enabling UV_USE_IO_URING after the CRIU restore fix.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nvsnap-iouring-sqarray-prod

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

balaji-g and others added 2 commits July 19, 2026 08:22
Co-Authored-By: Balaji Ganesan <bganesan@nvidia.com>
Co-Authored-By: Balaji Ganesan <bganesan@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/compute-plane-services/nvsnap/CONTRIBUTING.md`:
- Around line 17-20: Update the `cuda-checkpoint` documentation sentence in
`CONTRIBUTING.md` to replace the em dash between “arm64” and “no committed
binaries” with standard ASCII punctuation, preserving the existing meaning and
concise wording.

In `@src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-mp.yaml`:
- Around line 23-30: Disable automatic ServiceAccount token mounting by adding
automountServiceAccountToken: false under spec in both
src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-mp.yaml (lines
23-30) and src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-tp2.yaml
(lines 25-32).

In `@src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-tp2.yaml`:
- Around line 1-2: Replace the em dash in the header comment for the vLLM TP2
workload with ASCII punctuation, preserving the comment’s meaning and all other
manifest content.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 44fb3a12-d86c-4a85-b116-88eb732813a7

📥 Commits

Reviewing files that changed from the base of the PR and between e55e71e and a8273f1.

📒 Files selected for processing (29)
  • src/compute-plane-services/nvsnap/CONTRIBUTING.md
  • src/compute-plane-services/nvsnap/deploy/k8s/agent-daemonset-crio.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/agent-daemonset.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/benchmarks/gemma-4-31b-nim-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/benchmarks/gemma-4-31b-nim.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/benchmarks/whisper-large-v3-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/e5-mistral-replay.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/e5-mistral.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/nim-llama-8b-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/nim-llama-8b.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/sglang-8b-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/sglang-8b.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/sglang-small-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/sglang-small.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/trtllm-small-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/trtllm-small.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-8b.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-mp-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-mp.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-qwen32b.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-small.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-tp2-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-tp2.yaml
  • src/compute-plane-services/nvsnap/docker/agent/Dockerfile.base
  • src/compute-plane-services/nvsnap/docker/agent/cuda-checkpoint
  • src/compute-plane-services/nvsnap/docker/agent/nvsnap-cuda-checkpoint.c
  • src/compute-plane-services/nvsnap/scripts/build-agent.sh
  • src/compute-plane-services/nvsnap/scripts/test-e2e.sh
  • src/compute-plane-services/nvsnap/scripts/versions.sh

Comment thread src/compute-plane-services/nvsnap/CONTRIBUTING.md Outdated
Comment thread src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-mp.yaml
Comment thread src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-tp2.yaml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-tp2.yaml (2)

28-35: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Disable service-account token automounting.

This privileged workload does not need Kubernetes API credentials. Without automountServiceAccountToken: false, the default service-account token may be mounted into a compromised vLLM process. The restore manifest already disables this token.

Proposed fix
 spec:
+  automountServiceAccountToken: false
   tolerations:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-tp2.yaml` around
lines 28 - 35, Update the workload pod specification in vllm-tp2.yaml to set
automountServiceAccountToken to false, matching the existing restore manifest
behavior and preventing the default service-account token from being mounted.

58-68: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Do not mask vLLM startup failures with an infinite sleep.

If vllm serve exits, the shell, tail process, and infinite sleep keep the container running. With restartPolicy: Never, readiness remains false while the pod never reports a failed workload, causing E2E runs to wait until an external timeout. Track the server PID and exit when it terminates.

Proposed fix
           nohup setsid vllm serve \
             --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 \
             --host 0.0.0.0 \
             --port 8000 \
             --max-model-len 2048 \
             --tensor-parallel-size 2 \
             --enforce-eager \
             --disable-custom-all-reduce \
-            --gpu-memory-utilization 0.3 > /vllm.out 2>&1 < /dev/null &
+            --gpu-memory-utilization 0.3 > /vllm.out 2>&1 < /dev/null &
+          vllm_pid=$!
           tail -F /vllm.out &
-          while true; do sleep 30; done
+          wait "$vllm_pid"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-tp2.yaml` around
lines 58 - 68, Update the vllm serve startup flow in the workload command to
capture its background process ID, monitor that process instead of using an
unconditional infinite sleep, and exit with the server’s failure status when it
terminates. Keep log streaming through tail, but ensure the container reports
the vLLM startup failure so restartPolicy: Never does not leave the pod running
indefinitely.
src/compute-plane-services/nvsnap/docker/agent/Dockerfile.base (1)

11-18: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Make arm64 support end-to-end.

The new builder can compile the CLI for arm64, but this Dockerfile still hard-codes x86_64 loader paths at Lines 73, 82, and 88. An arm64 image build will therefore fail or produce an unusable CRIU bundle. Make the bundle creation architecture-aware, or narrow the comment to claim arm64 support only for the standalone CLI.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/compute-plane-services/nvsnap/docker/agent/Dockerfile.base` around lines
11 - 18, Update the CRIU bundle creation logic associated with the Dockerfile’s
hard-coded x86_64 loader paths at lines 73, 82, and 88 to select
architecture-appropriate paths for both x86_64 and arm64. Ensure the resulting
bundle and runtime loader configuration remain usable on each supported
architecture, preserving the end-to-end arm64 support claim.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-tp2.yaml`:
- Around line 28-35: Update the workload pod specification in vllm-tp2.yaml to
set automountServiceAccountToken to false, matching the existing restore
manifest behavior and preventing the default service-account token from being
mounted.
- Around line 58-68: Update the vllm serve startup flow in the workload command
to capture its background process ID, monitor that process instead of using an
unconditional infinite sleep, and exit with the server’s failure status when it
terminates. Keep log streaming through tail, but ensure the container reports
the vLLM startup failure so restartPolicy: Never does not leave the pod running
indefinitely.

In `@src/compute-plane-services/nvsnap/docker/agent/Dockerfile.base`:
- Around line 11-18: Update the CRIU bundle creation logic associated with the
Dockerfile’s hard-coded x86_64 loader paths at lines 73, 82, and 88 to select
architecture-appropriate paths for both x86_64 and arm64. Ensure the resulting
bundle and runtime loader configuration remain usable on each supported
architecture, preserving the end-to-end arm64 support claim.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b15e880f-f824-4c70-9094-54c748011b1b

📥 Commits

Reviewing files that changed from the base of the PR and between a8273f1 and 952f394.

📒 Files selected for processing (6)
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-mp-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-mp.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-tp2-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-tp2.yaml
  • src/compute-plane-services/nvsnap/docker/agent/Dockerfile.base
  • src/compute-plane-services/nvsnap/docker/agent/nvsnap-cuda-checkpoint.c
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-tp2-restore.yaml
  • src/compute-plane-services/nvsnap/docker/agent/nvsnap-cuda-checkpoint.c
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-mp-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-mp.yaml

Backfills the SPDX copyright + license header on the 23 remaining
Dockerfiles under src/compute-plane-services/nvsnap. Every source file in
the tree (Go, C, Python, YAML, shell, Dockerfile) now carries the header.

Co-Authored-By: Balaji Ganesan <bganesan@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/compute-plane-services/nvsnap/tests/uvloop-mp-test/Dockerfile (1)

45-48: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Run the test container as a non-root user. Add a dedicated user before CMD and run app_simple.py under it; this test image only serves on port 8000 and does not need root privileges.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/compute-plane-services/nvsnap/tests/uvloop-mp-test/Dockerfile` around
lines 45 - 48, Update the Dockerfile before the CMD instruction to create a
dedicated non-root user, switch to that user with USER, and keep the existing
app_simple.py command running on port 8000.

Source: Linters/SAST tools

🧹 Nitpick comments (1)
src/compute-plane-services/nvsnap/tests/uvloop-mp-test/Dockerfile (1)

10-24: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Pin test-image dependencies for reproducible builds.

The PPA and pip installs currently resolve moving versions, including pip, uvloop, and aiohttp. Use a committed constraints/lock file with tested versions, or document and continuously validate the floating-version contract.

Also applies to: 27-31, 36-37

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/compute-plane-services/nvsnap/tests/uvloop-mp-test/Dockerfile` around
lines 10 - 24, Pin the test image’s moving dependencies by adding and committing
a constraints or lock file covering the deadsnakes/PPA packages and
pip-installed packages such as pip, uvloop, and aiohttp. Update the Dockerfile
installation steps to consume that file and ensure all dependency-install
blocks, including the referenced sections, use the tested versions consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/compute-plane-services/nvsnap/tests/uvloop-mp-test/Dockerfile`:
- Around line 45-48: Update the Dockerfile before the CMD instruction to create
a dedicated non-root user, switch to that user with USER, and keep the existing
app_simple.py command running on port 8000.

---

Nitpick comments:
In `@src/compute-plane-services/nvsnap/tests/uvloop-mp-test/Dockerfile`:
- Around line 10-24: Pin the test image’s moving dependencies by adding and
committing a constraints or lock file covering the deadsnakes/PPA packages and
pip-installed packages such as pip, uvloop, and aiohttp. Update the Dockerfile
installation steps to consume that file and ensure all dependency-install
blocks, including the referenced sections, use the tested versions consistently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 3d419e49-255f-4dca-a235-7419b9cc1583

📥 Commits

Reviewing files that changed from the base of the PR and between 952f394 and 77a9eeb.

⛔ Files ignored due to path filters (1)
  • src/compute-plane-services/nvsnap/docker/agent/Dockerfile.app is excluded by !**/*.app
📒 Files selected for processing (22)
  • src/compute-plane-services/nvsnap/docker/Dockerfile.agent
  • src/compute-plane-services/nvsnap/docker/Dockerfile.server
  • src/compute-plane-services/nvsnap/docker/agent/Dockerfile
  • src/compute-plane-services/nvsnap/docker/agent/Dockerfile.app.criuv2
  • src/compute-plane-services/nvsnap/docker/agent/Dockerfile.app.patch
  • src/compute-plane-services/nvsnap/docker/agent/Dockerfile.local
  • src/compute-plane-services/nvsnap/docker/criu-builder/Dockerfile
  • src/compute-plane-services/nvsnap/docker/criu-builder/Dockerfile.extract
  • src/compute-plane-services/nvsnap/docker/init/Dockerfile
  • src/compute-plane-services/nvsnap/docker/libuv/Dockerfile
  • src/compute-plane-services/nvsnap/docker/libzmq/Dockerfile
  • src/compute-plane-services/nvsnap/docker/nvsnap-blobstore/Dockerfile
  • src/compute-plane-services/nvsnap/docker/nvsnap-l2-wait/Dockerfile
  • src/compute-plane-services/nvsnap/docker/phase2/Dockerfile
  • src/compute-plane-services/nvsnap/docker/pyzmq/Dockerfile
  • src/compute-plane-services/nvsnap/docker/uvloop/Dockerfile
  • src/compute-plane-services/nvsnap/placeholder/Dockerfile
  • src/compute-plane-services/nvsnap/placeholder/Dockerfile.simple
  • src/compute-plane-services/nvsnap/placeholder/Dockerfile.vllm
  • src/compute-plane-services/nvsnap/scripts/Dockerfile.intercept-build
  • src/compute-plane-services/nvsnap/tests/uvloop-mp-test/Dockerfile
  • src/compute-plane-services/nvsnap/tests/uvloop-mp-test/Dockerfile.pip

CRIU restore speedup (Lever A): the fork now madvise(MADV_HUGEPAGE)s the
premapped private-VMA arena before faulting in the process image, so the
content populates as 2MB pages instead of ~800k 4KB pages. Pins CRIU ref
to 1ddd5c9c3, bumps base v0.0.11 / app v0.2.21.

Measured on aws-dev1 (H100, criu-v2), vllm-small 3.2G:
- CPU pages restore phase: 13.5s -> 3.8s (-72%)
- CRIU restore total:      40.3s -> 28.2s (-30%)
- agent restore:           44.3s -> 32.2s (-27%)
Single-GPU regression 5/5 PASS (vllm-small, vllm-8b, e5-mistral,
vllm-qwen32b 64G). No RSS bloat: AnonHugePages=0 in the final process
(huge pages are transient to the staging arena, split on remap). Design +
before/after in docs/proposals/single-gpu-restore-speedup.md.

Review fixes (CodeRabbit):
- automountServiceAccountToken: false on vllm-mp / vllm-tp2 source pods.
- Replace em-dashes with ASCII in CONTRIBUTING.md, vllm-tp2*.yaml.

Co-Authored-By: Balaji Ganesan <bganesan@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/compute-plane-services/nvsnap/docs/proposals/single-gpu-restore-speedup.md`:
- Around line 54-57: Reconcile the workload count in the measured single-GPU
regression statement: either add the missing fifth workload to the parenthetical
list or change “5/5 PASS” to “4/4 PASS” so the claim matches the listed
workloads.
- Around line 7-8: Update the document’s status and affected sections to
distinguish completed work from planned work: mark Lever A and its measured
results as implemented, retain locked decisions as decided, and label proposed
phasing and remaining levers as planned or not yet implemented. Remove the
conflicting “design sketch, pre-implementation” wording while preserving the
existing measurements and proposal details.
- Around line 15-20: Update all affected diagrams in the proposal, including the
referenced sections, to use `text` language tags on their fenced blocks and
replace Unicode box-drawing glyphs with ASCII characters. Preserve the diagrams’
layout, timings, and meaning while ensuring committed documentation uses only
standard ASCII.
- Around line 12-13: Align the restore-time baseline and target throughout the
proposal: update the opening timing, the CRIU/agent breakdown at the referenced
timing section, and the A+B projection so they consistently use either CRIU-only
(~40.3s to ~19s) or agent-inclusive (~44.3s to ~23s) measurements. Preserve the
stated overhead when using the agent-inclusive projection.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 10f409d0-2953-4201-b5be-f2c2f6f932fa

📥 Commits

Reviewing files that changed from the base of the PR and between 77a9eeb and d4551c3.

📒 Files selected for processing (20)
  • src/compute-plane-services/nvsnap/CONTRIBUTING.md
  • src/compute-plane-services/nvsnap/deploy/k8s/agent-daemonset-crio.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/agent-daemonset.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/benchmarks/gemma-4-31b-nim-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/benchmarks/gemma-4-31b-nim.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/benchmarks/whisper-large-v3-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/e5-mistral-replay.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/nim-llama-8b-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/nim-llama-8b.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/sglang-8b-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/sglang-8b.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/sglang-small-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/sglang-small.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/trtllm-small-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/trtllm-small.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-mp.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-tp2-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-tp2.yaml
  • src/compute-plane-services/nvsnap/docs/proposals/single-gpu-restore-speedup.md
  • src/compute-plane-services/nvsnap/scripts/versions.sh
🚧 Files skipped from review as they are similar to previous changes (14)
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/nim-llama-8b-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/benchmarks/gemma-4-31b-nim.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/benchmarks/whisper-large-v3-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/sglang-small-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/sglang-8b-restore.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/sglang-small.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/agent-daemonset-crio.yaml
  • src/compute-plane-services/nvsnap/scripts/versions.sh
  • src/compute-plane-services/nvsnap/deploy/k8s/agent-daemonset.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/trtllm-small.yaml
  • src/compute-plane-services/nvsnap/CONTRIBUTING.md
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-tp2.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-mp.yaml
  • src/compute-plane-services/nvsnap/deploy/k8s/workloads/vllm-tp2-restore.yaml

Comment thread src/compute-plane-services/nvsnap/docs/proposals/single-gpu-restore-speedup.md Outdated
Comment thread src/compute-plane-services/nvsnap/docs/proposals/single-gpu-restore-speedup.md Outdated
Comment thread src/compute-plane-services/nvsnap/docs/proposals/single-gpu-restore-speedup.md Outdated
Comment thread src/compute-plane-services/nvsnap/docs/proposals/single-gpu-restore-speedup.md Outdated
- BENCHMARK.md: add the Lever A huge-page restore section (matched
  before/after for all 4 single-GPU workloads, -27% to -51%).
- single-gpu-restore-speedup.md (CodeRabbit review):
  - status reflects implemented (A) vs proposed (B) vs out-of-scope (C).
  - one consistent restore-time boundary (agent-restore) throughout.
  - ASCII-only diagrams with text-tagged fences.
  - regression count corrected to 4/4.

Co-Authored-By: Balaji Ganesan <bganesan@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/compute-plane-services/nvsnap/docs/BENCHMARK.md`:
- Around line 18-20: Revise the benchmark summary in BENCHMARK.md to scope the
faster-restore claim to the four tested single-GPU workloads rather than all
workloads, and soften or remove the assertion that gains increase with CPU-side
memory footprint. Preserve the reported vllm-small phase timings and
percentages.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c5da3790-9205-4bb9-8b25-8fd5ee64520f

📥 Commits

Reviewing files that changed from the base of the PR and between d4551c3 and 7b11a44.

📒 Files selected for processing (2)
  • src/compute-plane-services/nvsnap/docs/BENCHMARK.md
  • src/compute-plane-services/nvsnap/docs/proposals/single-gpu-restore-speedup.md

Comment on lines +18 to +20
Every single-GPU workload restores faster; the win grows with the process's
CPU-side memory footprint. Phase split from the vllm-small `-v4` restore.log:
the CPU pages-restore phase dropped 13.5 s to 3.8 s (-72%); the cuda_plugin GPU

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Avoid overstating the benchmark conclusion.

The data covers four tested single-GPU workloads, not every possible workload, and the improvement is not monotonic with CPU-side footprint: e5-mistral-7b improves by 51% at 15G, while vllm-qwen32b improves by 37% at 64G. Please scope this to the tested workloads and soften the footprint claim.

Suggested wording
-Every single-GPU workload restores faster; the win grows with the process's
-CPU-side memory footprint.
+All four tested single-GPU workloads restore faster; larger CPU-side footprints
+generally benefit, although the improvement is not monotonic in this sample.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Every single-GPU workload restores faster; the win grows with the process's
CPU-side memory footprint. Phase split from the vllm-small `-v4` restore.log:
the CPU pages-restore phase dropped 13.5 s to 3.8 s (-72%); the cuda_plugin GPU
All four tested single-GPU workloads restore faster; larger CPU-side footprints
generally benefit, although the improvement is not monotonic in this sample.
Phase split from the vllm-small `-v4` restore.log: the CPU pages-restore phase dropped 13.5 s to 3.8 s (-72%); the cuda_plugin GPU
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/compute-plane-services/nvsnap/docs/BENCHMARK.md` around lines 18 - 20,
Revise the benchmark summary in BENCHMARK.md to scope the faster-restore claim
to the four tested single-GPU workloads rather than all workloads, and soften or
remove the assertion that gains increase with CPU-side memory footprint.
Preserve the reported vllm-small phase timings and percentages.

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.

2 participants