Conversation
Record a CUDA event after scheduler-issued cache block copies are enqueued and attach it to asynchronous load requests. Make receive threads wait before writing destination pages so a background Mooncake transfer cannot race with copy-on-write preservation. Signed-off-by: girasoley <girasoley@inferact.ai>
GirasoleY
requested review from
ApostaC,
NickLucche,
ivanium,
orozery and
xuechendi
as code owners
July 30, 2026 02:20
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
Collaborator
|
Per offline discussion, it seems this race condition cannot happen. More concretely, with #49502, a local partial-tail CoW and a remote connector load should be mutually exclusive. |
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.
Purpose
Prevent asynchronous Mooncake loads from racing scheduler-issued copy-on-write cache block copies.
The model runner enqueues a cache-page copy on the compute stream before Mooncake may write the destination page. Previously, a background receive thread could start the Mooncake GET before that copy completed, allowing the copy and external DMA to write the same page concurrently.
This change records one CUDA event after the copies are enqueued, attaches it to the load requests, and makes the background receive thread wait before issuing the external write. The wait is scoped to the background transfer thread and the recorded stream; it is not a device-wide synchronization. It mirrors the existing store path, which waits before Mooncake reads GPU KV memory.
Duplicate-work check
The following open-PR searches were run:
No open PR addresses this load/copy ordering race. Returned PRs concerned EC hidden-state transfer, MultiConnector state, or request-lifecycle leaks (#47302, #42841, and #36014).
AI assistance was used. The human submitter reviewed the change intent and is responsible for reviewing the final OSS diff before merge.
Test Plan
No model evaluation was run because this changes transfer ordering rather than model computation. A real GPU/Mooncake overlap benchmark remains follow-up validation.
Test Result
Essential Elements of an Effective PR Description Checklist