mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #691] [Bug]: PD failing at long context/bigger batches #222
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#222
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 @tugot17 on GitHub (Jul 29, 2025).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/691
Bug Report
Hi,
I'm currently testing the PD performance in SGLang at larger batches. The motivation being, this is a worker profile I expect to encounter in (agentic) chat. I think there is some error, but I struggle to identify the source based on the available logs.
Steps to replicate on a single H100 node (should also work with less compute if you change the TP size/smaller model):
run_decode.shrun_prefill.shrun_proxy.shFor a single simple setup this works fine, the problem starts when I try to simulate a batch of long context, e.g. 8x30k tokens in. Than it completely fails
The first few requests complete fine:
but later it just stalls.
The workers than fail to give any further responses. Errors:
decode:prefilljust showsproxydoesn't show any errors.I identified this error while running my benchmarking suite, but the above simplified setup also causes the same problem; hence, I included it as it is easier to replicate. It seems something under the hood fails when the KV cache size grows above some threshold.
Any ideas what might be an issue?
@staryxchen commented on GitHub (Jul 31, 2025):
It seems to be related to insufficient memory. Please check your system using the commands
ulimit -aandfree -g. In addition, you can try usingrdma resourcewhile reproducing this issue to observe RDMA resource usage.@tugot17 commented on GitHub (Jul 31, 2025):
I don't think it is the memory issue, but rather the issue with exploding number of QPs?
Normal baseline (03:01:21):
QP explosion begins (03:02:21):
Peak QP usage before crash (03:05:32):
System crash and cleanup (03:05:52):
The script:
@staryxchen commented on GitHub (Jul 31, 2025):
Hi @tugot17
What version of mooncake are you using?
Can you try using version 0.3.5 and setting the environment variable
MC_ENABLE_DEST_DEVICE_AFFINITY=1to see if that solves the problem?@tugot17 commented on GitHub (Jul 31, 2025):
mooncake-transfer-engine 0.3.4.post2I updated the version and used the
MC_ENABLE_DEST_DEVICE_AFFINITY=1and it seems it is now fully functional.@tugot17 commented on GitHub (Jul 31, 2025):
thanks @staryxchen
@staryxchen commented on GitHub (Aug 1, 2025):
Interesting meme 🤣
BTW, you can report the problem and solution to the sglang community to help others with similar problems, if you confirm the problem has been solved.
@tugot17 commented on GitHub (Aug 1, 2025):
How would I report it? just make a PR to the docs of SGLang, or are you aware of some other process to do so?
@staryxchen commented on GitHub (Aug 1, 2025):
I'm not familiar with the sglang community. If they have some kind of troubleshooting docs, you can add relevant content. Or you can raise an issue to report this problem and see what the community thinks.
@jimmy-evo commented on GitHub (Aug 4, 2025):
Great issue! I've been looking this for 2 weeks
@staryxchen commented on GitHub (Aug 5, 2025):
Hi @jinmingyi1998 I'm glad to be of help.
I am curious to know how much QP has decreased in your case. If you don't mind, could you share the changes in the QP before and after setting MC_ENABLE_DEST_DEVICE_AFFINITY=1?
@jimmy-evo commented on GitHub (Aug 5, 2025):
it does useful!
num_qp < 250 and didn't increase
@staryxchen commented on GitHub (Aug 6, 2025):
Got it. Thanks for letting me know. 🙂