mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #162] [WIP] Refactoring Mooncake Transfer Engine #78
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#78
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 @alogfans on GitHub (Mar 23, 2025).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/162
This issue is for discussing how to refactor the design of Mooncake Transfer Engine.
We acknowledge @doujiang24 @yuan-luo @alogfans (may be incomplete) contributing PRs #161 #134 #147 to enhance Mooncake Transfer Engine. However these patches have major code modification. It make the code review and merge harder. Also, the interface also changed significantly, and backward compatibility may be affected.
So, before merging to the main stream, may be we can implement
Transfer Engine V2(we also want a short abbr. similar tonixl) seperately. When the second version is ready, we can replace it with the first one.In this stage, we expect to do the following:
Status-based error reporting mechanism, instead of error number. @yuan-luoWhat about everyone's opinions and suggestions?
@yuan-luo commented on GitHub (Mar 24, 2025):
@alogfans Sure. I'm fine with the plan. I also saw TransferEngine is on the sglang's roadmap. https://github.com/sgl-project/sglang/issues/4655
Could you please shed some lights on more details?
@alogfans commented on GitHub (Mar 25, 2025):
@yuan-luo You can change the
mooncake-ngxldirectory to add Status-based APIs, keepingmooncake-transfer-engineunchanged.@yuan-luo commented on GitHub (Mar 26, 2025):
@alogfans Sure. Btw, do you mean fork alogfans:transfer-engine-v2 and work on the branch temporarily? Otherwise we'd better wait for PR#170 being merged into main branch.
@alogfans commented on GitHub (Apr 1, 2025):
@yuan-luo
I recently reviewed the code in PR #170 and found that the new implementation may be buggy, so I believe that the progressive update is more suitable.
Goal:
Stage 1 Plan:
(You can add more in the list)
@xiaguan commented on GitHub (Apr 1, 2025):
From the perspective of the mooncake store, I think there are a few issues that need to be considered:
Is it possible to provide a synchronous blocking interface to avoid idle CPU cycles caused by busy-waiting in the store?
We'd like to improve observability so that when performance or logic issues arise, we can identify the specific module responsible more efficiently.
@yuan-luo commented on GitHub (Apr 1, 2025):
@alogfans I have some comments:
@yuan-luo commented on GitHub (Apr 1, 2025):
@xiaguan If I understand correctly, you might mean "provide an asynchronous non-blocking interface" here. It is a good idea to provide such interfaces, while the problem is the KVCache transfer needs to be layer-wised, it must make sure each layer's cache being really transferred completely to start off the next layer's forward. So IMHO, the current public interface design in Mooncake-Store Client is reasonable.
While I agree with you that inside the Client::TransferData, we can improve to have a latch collecting the result of the async batch transfer, which means to refactor the read/write op inside TE into async op, or alternatively, introduce co-routine to do read/write in a sync manner.
@xiaguan commented on GitHub (Apr 2, 2025):
With the addition of the
coro_rpclibrary, we've also includedasync_simple, which offers a hybrid stackless/stacked coroutine async solution. We might be able to leverage this for some improvements.@yuan-luo commented on GitHub (Apr 2, 2025):
In addition, submitTransfer() itself is already non-blocking, which puts the request into an inflight queue. It requires the application to poll the result with getTransferStatus() in a separate loop. So in data path, the current design is fine. While coro_rpc is quite useful in Client-MasterService's meta-data path.
@xiaguan commented on GitHub (Apr 9, 2025):
I hope that TransferEngine can expose some interfaces for optimization switches, as certain optimizations might be beneficial in Scenario A but counterproductive in Scenario B. Providing these controls would allow callers some room for fine-tuning.
@github-actions[bot] commented on GitHub (Jul 21, 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.
@github-actions[bot] commented on GitHub (Jul 28, 2026):
Closing due to 3 months of inactivity. If this is still relevant, please comment and we can reopen.