Skip to content

fix(sglang): Warm snapshot engine before capture - #32

Merged
rst0git merged 4 commits into
mainfrom
fix/sglang-snapshot-warmup
Jul 14, 2026
Merged

fix(sglang): Warm snapshot engine before capture#32
rst0git merged 4 commits into
mainfrom
fix/sglang-snapshot-warmup

Conversation

@rst0git

@rst0git rst0git commented Jul 14, 2026

Copy link
Copy Markdown
Member

Overview:

Warm the direct SGLang generation path before Dynamo Snapshot freezes the process. Without this warmup, CUDA checkpoint fails for affected models with CUDA_ERROR_OPERATING_SYSTEM.

This backports ai-dynamo/dynamo@338a898b61 / ai-dynamo#10844 to the Doubleword fork.

Details:

  • issue one bounded dummy generation before quiescing the snapshot engine
  • preserve skip_server_warmup and non-generation model behavior
  • retain upstream DP, disaggregated, debug-tensor, and timeout handling
  • add GPU-free unit coverage for generation and skip paths
  • record the configured Black output for a pre-existing long signature in openai_backend/worker.py, which the repository-wide hook otherwise changes

Validation:

  • Black 23.1.0 check in Python 3.12
  • ruff check
  • python3 -m compileall
  • dependency-isolated async execution checks for generation, disabled, and non-generation paths

Where should the reviewer start?

components/src/dynamo/sglang/snapshot.py

Related Issues:

Copilot AI review requested due to automatic review settings July 14, 2026 11:04

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread lib/gpu_memory_service/tests/test_snapshot_saver.py Fixed
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 14, 2026
@rst0git
rst0git force-pushed the fix/sglang-snapshot-warmup branch 6 times, most recently from e75c030 to c716a64 Compare July 14, 2026 14:13
rst0git added 4 commits July 14, 2026 15:14
Snapshot capture can start before SGLang has executed a real
generation request, leaving model state uninitialized in the
checkpoint. Warm generation engines with a bounded request before
capture, while keeping skip, debug, data-parallel, and
non-generation paths unchanged.

Signed-off-by: Radostin Stoyanov <radostin@doubleword.ai>
A restored process must see the same CUDA device ordering and
thread-local device context that it had during capture. Resolve DRA
GPUs in container ordinal order, bind saver workers before touching
CUDA, and expose CRIU direct I/O for checkpoint storage.

Signed-off-by: Radostin Stoyanov <radostin@doubleword.ai>
GMS mappings become read-only after publication, but buffers and
auxiliary tensors may still be updated by the model. Keep parameters
in shared memory and copy writable non-parameter tensors into private
CUDA memory before later updates can fault.

Signed-off-by: Radostin Stoyanov <radostin@doubleword.ai>
The fork does not have the upstream Fastchecker runners, and several
checks assumed infrastructure or documentation links that are not
available here. Run Rust validation on hosted runners, lock tool
installs to the repository toolchain, and make compliance and link
checks understand the fork's inputs.

Signed-off-by: Radostin Stoyanov <radostin@doubleword.ai>
@rst0git
rst0git force-pushed the fix/sglang-snapshot-warmup branch from c716a64 to 55b9939 Compare July 14, 2026 14:14
@rst0git
rst0git merged commit 4a64347 into main Jul 14, 2026
18 of 19 checks passed
@rst0git
rst0git deleted the fix/sglang-snapshot-warmup branch July 14, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants