Repository navigation
[None][feat] BREAKING: Add native KV cache V2 sleep/wake - #21221
Conversation
Consolidate the implementation from NVIDIA#20087, originally authored by Yi Zhang, and continue it in NVIDIA#21221. Release native GPU and host backing through V2 cache tiers. Preserve metadata addresses and refresh KV/SSM indices before graph replay. Integrate with MPI and Ray memory controls and add native, graph, and serving tests. Include the successor self-review fix: reject V2 KV sleep with KV-moving connectors until their memory-registration lifecycle is supported. Keep capacity-only connectors and model-only sleep available. Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
af7661f to
b69bc78
Compare
Consolidate the implementation from NVIDIA#20087, originally authored by Yi Zhang, and continue it in NVIDIA#21221. Release native GPU and host backing through V2 cache tiers. Preserve metadata addresses and refresh KV/SSM indices before graph replay. Integrate with MPI and Ray memory controls and add native, graph, and serving tests. Include the successor self-review fix: reject V2 KV sleep with KV-moving connectors until their memory-registration lifecycle is supported. Keep capacity-only connectors and model-only sleep available. Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
b69bc78 to
2ef6661
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #81292 [ run ] triggered by Bot. Commit: |
|
PR_Github #81292 [ run ] completed with state Resource maintenance in LLM/main/L0_Test-x86_64-Single-GPU #9628: L40S-PyTorch-2 is temporarily paused due to Kubernetes agent provisioning and node issues.
|
2ef6661 to
a022433
Compare
Consolidate the implementation from NVIDIA#20087, originally authored by Yi Zhang, and continue it in NVIDIA#21221. Release native GPU and host backing through V2 cache tiers. Preserve metadata addresses and refresh KV/SSM indices before graph replay. Integrate with MPI and Ray memory controls and add native, graph, and serving tests. Include the successor self-review fix: reject V2 KV sleep with KV-moving connectors until their memory-registration lifecycle is supported. Keep capacity-only connectors and model-only sleep available. Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
|
/bot run --disable-fail-fast |
Consolidate the implementation from NVIDIA#20087, originally authored by Yi Zhang, and continue it in NVIDIA#21221. Release native GPU and host backing through V2 cache tiers. Preserve metadata addresses and refresh KV/SSM indices before graph replay. Integrate with MPI and Ray memory controls and add native, graph, and serving tests. Include the successor self-review fix: reject V2 KV sleep with KV-moving connectors until their memory-registration lifecycle is supported. Keep capacity-only connectors and model-only sleep available. Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
a022433 to
bdc6786
Compare
Consolidate the implementation from NVIDIA#20087, originally authored by Yi Zhang, and continue it in NVIDIA#21221. Release native GPU and host backing through V2 cache tiers. Preserve metadata addresses and refresh KV/SSM indices before graph replay. Integrate with MPI and Ray memory controls and add native, graph, and serving tests. Include the successor self-review fix: reject V2 KV sleep with KV-moving connectors until their memory-registration lifecycle is supported. Keep capacity-only connectors and model-only sleep available. Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
bdc6786 to
b5803e0
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #81463 [ run ] triggered by Bot. Commit: |
|
PR_Github #81463 [ run ] completed with state
|
Consolidate the implementation from NVIDIA#20087, originally authored by Yi Zhang, and continue it in NVIDIA#21221. Release native GPU and host backing through V2 cache tiers. Preserve metadata addresses and refresh KV/SSM indices before graph replay. Integrate with MPI and Ray memory controls and add native, graph, and serving tests. Include the successor self-review fix: reject V2 KV sleep with KV-moving connectors until their memory-registration lifecycle is supported. Keep capacity-only connectors and model-only sleep available. Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
57d7b99 to
e433b19
Compare
Consolidate the implementation from NVIDIA#20087, originally authored by Yi Zhang, and continue it in NVIDIA#21221. Release native GPU and host backing through V2 cache tiers. Preserve metadata addresses and refresh KV/SSM indices before graph replay. Integrate with MPI and Ray memory controls and add native, graph, and serving tests. Include the successor self-review fix: reject V2 KV sleep with KV-moving connectors until their memory-registration lifecycle is supported. Keep capacity-only connectors and model-only sleep available. Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
|
/bot run --disable-fail-fast |
e433b19 to
a5ca974
Compare
Consolidate the implementation from NVIDIA#20087, originally authored by Yi Zhang, and continue it in NVIDIA#21221. Release native GPU and host backing through V2 cache tiers. Preserve metadata addresses and refresh KV/SSM indices before graph replay. Integrate with MPI and Ray memory controls and add native, graph, and serving tests. Include the successor self-review fix: reject V2 KV sleep with KV-moving connectors until their memory-registration lifecycle is supported. Keep capacity-only connectors and model-only sleep available. Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
|
/bot run --disable-fail-fast |
|
PR_Github #81525 [ run ] triggered by Bot. Commit: |
|
PR_Github #81526 [ run ] triggered by Bot. Commit: |
|
PR_Github/21221-a5ca974 #81525 was force-killed by a newer pipeline run. |
|
PR_Github #86794 [ run ] triggered by Bot. Commit: |
|
PR_Github #86794 [ run ] completed with state
|
|
/bot run |
|
PR_Github #87031 [ run ] triggered by Bot. Commit: |
|
PR_Github #87031 [ run ] completed with state
|
|
I approved since the Runtime and KVCM key folks had approved this. |
|
Automatically added "ci: full pre-merge approved" because this PR has satisfied the required GitHub review approvals. Unresolved review conversations and other required checks remain independent merge requirements. |
|
/bot run --reuse-test 72187 --add-multi-gpu-test |
|
PR_Github #87090 [ run ] triggered by Bot. Commit: |
|
PR_Github #87090 [ run ] completed with state
|
|
/bot run --add-multi-gpu-test --disable-fail-fast |
|
PR_Github #87284 [ run ] triggered by Bot. Commit: |
|
PR_Github #87284 [ run ] completed with state
|
|
/bot run --add-multi-gpu-test --disable-fail-fast |
|
PR_Github #88163 [ run ] triggered by Bot. Commit: |
|
PR_Github #88163 [ run ] completed with state
|
|
/bot run --add-multi-gpu-test --disable-fail-fast |
|
PR_Github #88327 [ run ] triggered by Bot. Commit: |
Consolidate the implementation from NVIDIA#20087, originally authored by Yi Zhang, and continue it in NVIDIA#21221. Release native GPU and host backing through V2 cache tiers. Preserve metadata addresses and refresh KV/SSM indices before graph replay. Integrate with MPI and Ray memory controls and add native, graph, and serving tests. Include the successor self-review fix: reject V2 KV sleep with KV-moving connectors until their memory-registration lifecycle is supported. Keep capacity-only connectors and model-only sleep available. Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
|
/bot run --add-multi-gpu-test --disable-fail-fast |
|
PR_Github #88340 [ run ] triggered by Bot. Commit: |
|
PR_Github #88327 [ run ] completed with state |
|
PR_Github #88340 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #88464 [ run ] triggered by Bot. Commit: |
|
PR_Github #88464 [ run ] completed with state |
Summary
Enable native KVCacheManagerV2 sleep/wake without falling back to V1. Release physical backing, retain captured CUDA graphs and stable storage interfaces, and restore valid execution state before inference resumes.
Scope
Compatibility and limits: Sleep no longer selects V1 automatically. Ray sleep must use
LLM.release()orAsyncLLM.release(); private/direct sleep RPCs and rank-selected/nonblocking wakeup are rejected. V2 KV sleep rejects multiple locality domains, transceivers, KV-moving connectors, attached lenders, allocated MiniMaxM3 index-V buffers, mixed V1/V2 managers, and mixed-precision KV pools. Weights-only release remains available. Stable virtual addresses do not preserve external registrations. This PR does not preserve live serving requests or implement Snapshot process restore.Failure and wait contract: Unrecovered or uncertain multi-worker execution requires group restart. Actual drain and V2 KV reconstruction have no fixed deadline; unrelated wake acknowledgements remain bounded. Stalled reconstruction requires operator action. Validation/abort retain their existing limits. Capacity preflight does not reserve memory or guarantee later remote health. See the sleep/wake guide for the full mode and recovery contracts.
Verification
Revision:
be96ebf12a, rebased onto upstream9d50cf3c65. One signed-off commit; original authorship retained.git diff --check, and strict Pyrefly on the reported virtual-memory test passed. 279 repository configuration/replay tests passed. Isolated CPU harnesses passed 72 MPI-control, 37 connected-transport/Ray, and 26 RPC/native-control checks; 12 release API cases passed, including both shutdown regressions. The final advisory Pyrefly report dropped both shutdown warnings and all seven missing SSM-method warnings. The additional test diagnostic is anAsyncMock.assert_not_awaitedcall; the fixture explicitly installs anAsyncMock. Remaining fixture and optional-type warnings are not a clean type-check claim. These local tests did not run real MPI, Ray actors, CUDA, or the C++ gtests.5a0ad15bb1. Two GB200 four-rank MNNVL cases passed; the four required H100 MPI/Ray TP2 cases did not run. Recheck all six cases on this revision.Notes
Integration follow-up (whichever PR lands second): once #21221 and #21598 are both present, report
failure_reason=sleep_wakeupfrom the Ray driver after a terminal sleep/wake failure. Cover the combined public status reply. Admission already stays closed.Successor to Yi Zhang's #20087, kept as one signed-off commit with Yi's authorship. #21598 is independent lifecycle work, not a dependency or proof of process restore.
Follow-up PRs (not merge requirements):
External KV users. Keep the attached-lender guard, including for idle lenders. Before enabling this path, fence new leases/copies, prove old accesses have ended, and deregister affected GPU/HOST ranges. After restoring bindings, re-register and publish a fresh peer identity. Reverse completed steps on rollback; keep the group closed if safety is uncertain.
Placement and locality. Add a placement epoch distinct from prefix validity before exporting slot references across wake. Qualify per-domain release, restore and index refresh before enabling multi-locality-domain sleep.
Native and Ray lifecycle. Per Yi's review, retain native living-cache support here; audit direct callers before removing wake-only state. Ray all-rank post-drain preparation, safe pre-mutation abort and automatic recovery need separate qualification. The current contract requires restart after an uncertain transition.
Optional tests and maintenance. Add single-GPU MPI discard/preserve coverage; measure wake latency and host re-pinning on broader profiles. Consider consistent restore/zeroing and page/tree-reset helpers, permanent host-fill error reporting, typed HTTP conflicts, and native API wording. These do not replace the required multi-GPU runs.
Reviewed scope, coding guidelines, tests, documentation, API compatibility, dependencies, and ownership. No new configuration fields, dependencies, or ownership changes.