Repository navigation
Conversation
sssqqeer
requested review from
ShangmingCai,
UNIDY2002,
alogfans,
staryxchen,
stmatengss and
ykwd
as code owners
October 25, 2026 15:02
sssqqeer
force-pushed
the
te/sync-transfer-quiesce-before-retry
branch
from
October 25, 2026 15:56
de61357 to
ddd4efe
Compare
…r return MultiTransport reports a batch FAILED as soon as one task fails, while sibling tasks can still be reading sources or writing destinations. transferSync and batchTransferSync then freed the batch (cleanup gets deferred) and either retried or returned -1 right away. A caller that reuses its buffers after the return, such as a prefill freeing KV blocks, can have the old attempt write into them later. Before freeing a failed attempt, wait until every task is COMPLETED or FAILED, bounded by the existing transfer deadline. Retry only after that. If tasks are still in flight at the deadline, return -2, the same value as COMPLETION_UNKNOWN in the scatter ticket API, so callers know the buffers must stay alive. -1 now means failed and quiescent. The success path is unchanged. TENT keeps its current behavior: its task states do not yet imply physical quiescence (kvcache-ai#4816). Signed-off-by: shibin <306219114@qq.com>
sssqqeer
force-pushed
the
te/sync-transfer-quiesce-before-retry
branch
from
October 25, 2026 16:30
ddd4efe to
4558d71
Compare
This branch has not been deployed
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.
Description
Related: #4247.
transfer_sync_*andbatch_transfer_sync_*can return while part of the batch is still running. As soon as one task fails, the sync wrapper frees the batch and either retries the whole batch or returns -1, while the other tasks keep reading the sources and writing the destinations.In PD disaggregation this is silent KV corruption: prefill sees the failure, frees its KV blocks, and the next request's KV reaches the decode pages. The same happens when the outer
MC_TRANSFER_TIMEOUTfires.This PR waits for a failed batch to stop before acting on the failure:
COMPLETION_UNKNOWNin the scatter ticket API: the buffers must stay alive. -1 now means "failed, and nothing touches the buffers".vLLM's
MooncakeConnectorchecksret == 0and SGLang checksret < 0, so both treat -2 as a failure.A batch with a 4 KiB write that the target rejects and a 64 MiB valid write, over TCP. Right after the call returns, the caller writes new data into the source buffer, as it would when reusing it:
Suggested Merge Priority
Module
mooncake-transfer-engine)mooncake-store)mooncake-conductor)mooncake-reshard)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)mooncake-rl)Type of Change
How Has This Been Tested?
Test commands:
Test results:
python_sync_quiesce_test(mooncake-integration/tests/test_sync_transfer_quiesce.py); its failure-path test fails onmain.transfer_engine_initiator_test.py12/12 on bothmainand this branch.Checklist
./scripts/code_format.shdocs/source/api-reference/python/transfer-engine.md)AI Assistance Disclosure