Skip to content

Optimize gVisor GPU checkpoint restore#1779

Merged
luke-lombardi merged 5 commits into
mainfrom
codex/gvisor-checkpoint-restore
Jul 18, 2026
Merged

Optimize gVisor GPU checkpoint restore#1779
luke-lombardi merged 5 commits into
mainfrom
codex/gvisor-checkpoint-restore

Conversation

@luke-lombardi

@luke-lombardi luke-lombardi commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • use gVisor's native NVIDIA checkpoint path for GPU workloads
  • make automatic gVisor checkpoints terminal and overlap background CPU page loading with CUDA restore
  • pin the tested Beam gVisor amd64 release with SHA-512 verification
  • retain the official gVisor release for arm64 workers

The gVisor patch is isolated in beam-cloud/gvisor at 4272182b and is also open upstream as google/gvisor#13753. It prefaults only MemoryFile ranges mapped by restored CUDA processes before NVIDIA process resume. There are no vLLM-specific flags, KV-cache changes, eager mode, or workload-state reduction.

Staging results

RTX 5090, untouched Qwen/Qwen2.5-1.5B-Instruct BF16 vLLM deployment, existing 7.3 GiB automatic checkpoint:

  • baseline gVisor runtime restore: roughly 25.7-29 seconds
  • optimized runtime restore: roughly 6.2-6.6 seconds
  • warm image load: 37 ms
  • warm checkpoint path: 7.16 seconds
  • request to exact valid chat completion: 7.62 seconds
  • first request after worker recycle: 8.94 seconds

The exact release artifact and original checkpoint produced HTTP 200 responses with exact requested completion text. The checkpoint remained available and no replacement snapshot was created.

Verification

  • go test ./pkg/runtime ./pkg/worker
  • gVisor //pkg/sentry/mm:mm_test
  • gVisor //pkg/sentry/pgalloc:pgalloc_test
  • gVisor //runsc:runsc
  • amd64 gvisor Docker stage build with checksum and version verification
  • repeated staging checkpoint restores through /v1/chat/completions

Summary by cubic

Optimize gVisor GPU checkpoint/restore by using its native NVIDIA path and making auto-checkpoints terminal, overlapping CPU page loading with CUDA resume. Cuts restore time on RTX 5090 vLLM from ~26–29s to ~6.2–6.6s without changing checkpoints.

  • New Features

    • Use gVisor nvproxy via a GPU bundle annotation; bind cuda-checkpoint; pass --cuda-checkpoint-path on checkpoint and --nvproxy on restore; remove per-PID CUDA freezing.
    • Run restore --background, wait for completion, and add safe force-delete cleanup.
    • Treat gVisor auto-checkpoints as terminal (same as runc); add VLLM_HOST_IP and VLLM_LOOPBACK_IP loopback env vars for service checkpoints.
  • Dependencies

    • Pin amd64 runsc to beam-cloud/gvisor release-20260714.0-beam.1 with SHA-512 digest verification; keep official gVisor release for arm64.

Written for commit f59099b. Summary will update on new commits.

Review in cubic

@luke-lombardi
luke-lombardi merged commit e540933 into main Jul 18, 2026
4 checks passed
@luke-lombardi
luke-lombardi deleted the codex/gvisor-checkpoint-restore branch July 18, 2026 16:31
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