mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #699] [Bug]: Brainstorm about the NVLink transfer issue #224
Labels
No labels
ascend
auto-closed
bug
bug
CI/Build
Common
documentation
enhancement
feature request
good first issue
help wanted
high priority
MetaX
nightly-failure
pull-request
PyTorch Backend
question
RFC
Roadmap
stale
Store
Tests
Transfer Engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/Mooncake#224
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @fzyzcjy on GitHub (Jul 31, 2025).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/699
Originally assigned to: @alogfans, @ShangmingCai on GitHub.
cc @ShangmingCai
(Make this an issue for easier communication)
My naive brainstorms
@ShangmingCai commented on GitHub (Jul 31, 2025):
Let us check. CC @alogfans
@staryxchen commented on GitHub (Jul 31, 2025):
Hi @fzyzcjy
Can you describe the issue you encountered in more detail? I've been trying to optimize nvlink transport recently, so maybe we can solve your problem together 🙂
@alogfans commented on GitHub (Jul 31, 2025):
We performed write-then-read operations with up to 96 threads on MNNVL machines, and it's likely that the data is consistent in both C++ and Python micro-benchmarks.
In addition, it's interesting that the accurancy drops more significantly if I remove the gil_release_lock in transferSync(). I think there must be something happened to it.
@alogfans commented on GitHub (Jul 31, 2025):
@fzyzcjy Your idea is reasonable, but I'm puzzled about
st.global. Also this problem may be happened in RDMA as well (a write completion doesn't indicate that the data is actually arrived at remote).@fzyzcjy commented on GitHub (Jul 31, 2025):
@ShangmingCai has all the details (and I guess @alogfans maybe also?) with full reproducible samples etc, maybe he knows more about mooncake internal cluster than me
Yes I also think it should almost true to be consistent...
For st.global just check DeepEP
github.com/deepseek-ai/DeepEP@c6faca45c1/csrc/kernels/internode_ll.cu (L232), they use ast.release.sys.globalto send the signal@alogfans commented on GitHub (Aug 1, 2025):
@fzyzcjy I've wrote a program to simulate the data transfer procedure as follows:
Observations:
dstis identical between multiple transfer requests, the decode side may receive corrupted data. In this case, the time diagram looks like this:transfer_syncis essentiallycudaMemcpyacross machines, and NVIDIA controls cache coherence by hardware (at least GPU-to-GPU, which is used by nvlink transport) So just ignore the coherence problem, it's more likely due to unintention overwrite :(@fzyzcjy commented on GitHub (Aug 1, 2025):
I see. Btw curious what raw content do we get when the error happens, and what we get if we simply sleep for a while. (I do not dig into any details about this bug since I heard mooncake will handle it)
@alogfans commented on GitHub (Aug 1, 2025):
For reference, the test script is attached below. In addition, we should hack
writeBytesToBufferandreadBytesFromBufferfunctions in Mooncake to support fetching data from vram by an extra copy. @ShangmingCaiscripts.zip
@alogfans commented on GitHub (Aug 3, 2025):
I have high confidence that the problem can be fixed.
tl; dr: in SGLang's
python/sglang/srt/disaggregation/mooncake/transfer_engine.py, inserttorch.cuda.synchronize()before and after the call toself.engine.transfer_sync_write.Reason: When PyTorch writes something to the numpy array, the change may not immediately applied to GPU device. So the transferred data may not be consistent, especially when there are many threads.
@ShangmingCai commented on GitHub (Sep 4, 2025):
Temporarily fixed by https://github.com/sgl-project/sglang/pull/9261. But the synchronization problem with small data NVLink transfer remains to be addressed.
@github-actions[bot] commented on GitHub (Jun 29, 2026):
This issue has had no activity for 90 days and will be closed in 7 days if there is no further activity. Please comment or react if it should stay open.
@ShangmingCai commented on GitHub (Jun 29, 2026):
Closed as addressed by the bootstrap room ID check.