Skip to content

[None][feat] Prototype faster native startup with Snapshot - #20079

Closed
chienchunhung wants to merge 3 commits into
NVIDIA:mainfrom
chienchunhung:dev/snapshot-startup-prototype
Closed

chienchunhung wants to merge 3 commits into
NVIDIA:mainfrom
chienchunhung:dev/snapshot-startup-prototype

Conversation

@chienchunhung

@chienchunhung chienchunhung commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Prototype faster native trtllm-serve startup by capturing a clean, warmed PyTorch worker tree and restoring it before serving validation. Snapshot restores execution state; TRTLLM must establish serving validity. No Dynamo, Kubernetes or GMS service is required.

Scope

This draft has three sequential commits, following the v1 design:

  1. Phase 0 — qualification: cold/restore generation probe, profile comparison and explicit capture/restore acceptance boundaries.
  2. Phase 1 — native capture/restore: standalone host adapter invokes real CRIU and Snapshot CUDA helpers; native hooks stop before request threads start and gate HTTP admission through memory-ready, runtime-ready and private generation validation.
  3. Phase 2 — fixed-cohort validity: same-host MPI TP coordination, matched cuinterpose shared-mapping restoration, KV V1/V2 allocation evidence, fresh-session all-rank agreement and an admission lease.

The runbook provides cold → capture/source termination → restore → validated serving commands; ordinary startup remains unchanged unless explicitly enabled.
Delivery target: all required S1-S7 functionality in v1, across Phase 0/1/2. This head is only a partial implementation candidate, not the requested complete e2e prototype. Multi-node execution, both P/D replacement directions, all-request drain, communication reconstruction and orchestrator adapter tests remain required; unsupported-profile rejection does not complete those requirements. Partial-rank failover, survivor rejoin, scaling, GMS, live-request preservation, KV migration and interrupted-transfer resumption remain outside the design's baseline scope.
Capture requires a clean resident template, fixed namespaces/filesystem/GPU assignment and checkpoint privileges; operator-declared profile identity is not attestation. A partial CRIU failure before root-PID publication requires dedicated-container cleanup.

Design Acceptance Checklist

Unchecked items are required delivery work, not deferred features. Passing component tests alone does not complete an item.

  • S1 / Phase 0: Audit native process/control boundaries and approve the host contract; map V2 allocations, ownership/refcounts, free lists, prefix metadata and scheduler associations; inventory missing KV and communication APIs separately.
  • S2 / Phase 0: Reproduce the pinned reference and qualify native single-GPU, single-node multi-GPU and an early multi-node smoke case; instrument initialization, graph replay and artifact I/O; record exact-profile baselines and targets.
  • S3 / Phase 1: Controller-neutral, authenticated, idempotent lifecycle operations; close admission, drain ALL affected requests and prove transfer retirement; distinct memory/runtime/serving readiness; reject stale/conflicting commands and fail closed.
  • S4 / Phase 1: Complete standalone capture/artifact publication/source termination/isolated restore/validated serving; fresh sessions, compatibility/trust checks, explicit fallback accounting, repeated cycles and Snapshot-off regression coverage.
  • S5 / Phase 2: V2 metadata and scheduler consistency, with qualified reset/rebind where needed; preserve graph-required storage and validate cache ownership rather than only addresses/capacity.
  • S6 / Phase 2: Qualified no-future-access evidence; reconstruct registrations, sessions and discovery; validate affected ranks and live peers under existing authority, for both prefill and decode replacement.
  • S7 / Phase 2: Real generation across separately qualified MPI single-node/multi-node and both P/D directions; partial-rank, stale-peer, late-transfer and repeated-cycle tests; Dynamo/Kubernetes adapter contract tests; latency, throughput, artifact/HBM size and success/attempt reporting.

No new fencing, membership, failover or elasticity authority is introduced. Required functionality may use a small approved model and a bounded exact-profile matrix; it must execute the real serving path. Missing functionality stays incomplete, not silently reclassified as out of scope.

Verification

Candidate: e16981e3b74bcb5977a729f77de8fc40baefd09f; implementation base: 553989e4a7406e5cbfeb5e6037ec13a22c1cfe25.

  • Local CPU tests: 79 passed on macOS/Python 3.13.11.
    Command: python -m pytest -c /dev/null --confcutdir tests/unittest/scripts -o 'markers=cpu_only: CPU-only script tests' -p no:cacheprovider tests/unittest/scripts/test_snapshot_startup.py tests/unittest/scripts/test_snapshot_probe.py -q.
    These exercise the production protocol/driver and real HTTP subprocess probes. CUDA, CRIU and native engine boundaries are doubles in the orchestration tests, not evidence of GPU restore.
  • Required commit/pre-commit/DCO hooks and git diff --check: passed.
  • Self-review fixed executable CUDA-graph handle selection, default native CLI launch compatibility and HTTP-only admission bypass. Full source/test/document inspection is complete at this head; merge approval remains blocked by native-runtime verification and the main-branch conflict.
  • Required native tests: tests/unittest/llmapi/test_serve_report_addr.py and tests/unittest/_torch/executor/test_resource_manager.py -k snapshot; not yet run in a compatible built runtime.
  • Remote preparation: two B300 GPUs, driver 615.71.09; MPI and a CUDA/PID namespace probe passed, but neither exercised this PR. CRIU preflight failed under the restricted test-container profile. Broader per-container permissions await approval. Old-head CI wheels were checksum-verified, but the compatible public-PyTorch runtime setup did not complete; the exact NGC 26.09 image was unavailable. No native tests ran. The preparation container was stopped and GPU allocation released. Snapshot release-bundle provenance remains unverified against the inspected source pin.
  • Real model capture/restore, repeated MPI restore, output equivalence and startup speedup: unverified. No speedup or supported deployment profile is claimed.
  • Full CI on old head 53b42f1 passed; that was the earlier probe-only change and does not qualify this implementation. New-head CI is withheld until required targeted verification and self-review pass.

Notes

Uses the raw tool contracts inspected at Snapshot bc9d2161d2a7, not a pre-existing standalone snapshotctl integration. Actual executable hashes are recorded; the adapter contract revision does not attest supplied binary provenance.
TRTLLM memory-control PR #19016 is related work, not a dependency: resident weights/graphs are captured without a memory-release cycle.
Current main fcc4432bef2a729ae6de0d29fdd89b7d15c87794 conflicts with the middleware insertion in commands/serve.py: upstream added a pool-provisioning context around server construction. Rebase approval is pending; no rebase has been executed. Main also changes native code, so a rebased head needs newly compatible build artifacts.
Keep the PR draft; no tracking-issue approval or production qualification is claimed.

  • Repository checklist reviewed: tests, documentation and DCO included; no new package dependency or protected public LLM API change.

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #77080 [ run ] triggered by Bot. Commit: 53b42f1 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #77080 [ run ] completed with state SUCCESS. Commit: 53b42f1
/LLM/main/L0_MergeRequest_PR pipeline #63542 completed with status: 'SUCCESS'

CI Report

Link to invocation

@chienchunhung
chienchunhung force-pushed the dev/snapshot-startup-prototype branch from 53b42f1 to e16981e Compare October 10, 2026 07:04
@chienchunhung chienchunhung changed the title [None][test] Add isolated Snapshot startup qualification probe [None][feat] Prototype faster native startup with Snapshot Oct 10, 2026
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