Repository navigation
[Bugfix] Drain Mooncake transfers before releasing KV pages - #31357
Closed
kflansburg wants to merge 2 commits into
Closed
kflansburg wants to merge 2 commits into
kflansburg wants to merge 2 commits into
Conversation
added 2 commits
July 15, 2026 09:39
Motivation: aborted or failed requests could return KV pages while synchronous Mooncake, executor, or staging work still referenced them. Modifications: track per-room transfer lifetimes, defer tokenized abort acknowledgements until drain, propagate quiescence across ranks, serialize endpoint sends, finalize staging ownership, and retain chunked-prefill requests until release is safe. Peers without the quiescence capability fail before transfer. Accuracy: prevents stale transfers from reading or overwriting pages reassigned to another request. No model math changes. Speed: adds locking only around transfer lifecycle and endpoint sends; normal transfer data paths are otherwise unchanged. Tests: 26 focused and 104 focused-plus-adjacent CPU tests passed; pre-commit and py_compile passed.
Add deterministic coverage for blocked native transfers, executor sibling drain, tokenized abort retries, collective failure barriers, staging cleanup races, capability gating, message ordering, and chunked-prefill retention. Tests: 26 focused and 104 focused-plus-adjacent CPU tests passed; pre-commit passed.
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
This was referenced Jul 19, 2026
This was referenced Jul 22, 2026
This was referenced Jul 27, 2026
|
I this this patch is better addressed by #32564 |
Contributor
|
Thanks @kflansburg. Closing this because it is still a draft and has not been updated in 40 days. Reopen it if the work is still relevant. Some directories moved recently, so an older branch may need retargeting: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Mooncake aborts and transfer timeouts currently make requests terminal before in-flight native transfers have quiesced. The scheduler can therefore return source or destination KV pages to the allocator while an existing RDMA, executor, or CUDA staging operation still reads or writes those addresses. If a page is reassigned, the old transfer can corrupt another request or read its KV state.
The existing
ABORT_ACKonly confirms that the abort notification was received. It does not prove that synchronous native transfer work has returned.Modifications
ABORT_ACKuntil prefill transfer work is quiescent.QUIESCE_V1capability on both peers so mixed versions fail before transferring KV rather than silently weakening the ownership barrier.This protocol requires coordinated rollout of prefill and decode peers. A peer that does not advertise
QUIESCE_V1is rejected before KV transfer begins.Accuracy Tests
This change does not modify model forward computation or model outputs. It prevents stale transfers from reading or overwriting KV pages after request failure.
Focused and adjacent CPU unit tests passed:
Speed Tests and Profiling
No performance benchmarks were run. The normal data-transfer path is unchanged apart from lifecycle accounting and per-endpoint send serialization. The additional waiting occurs only when a transfer is aborted, fails, or must drain before ownership release.
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ❌ Run #29438714597
Latest PR Test (Extra): ❌ Run #29438714032