mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[PR #557] [MERGED] Optimize slice handling to accelerate the large batch transfer operation #1649
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#1649
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?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/Mooncake/pull/557
Author: @SCDESPERTATE
Created: 6/25/2025
Status: ✅ Merged
Merged: 7/1/2025
Merged by: @alogfans
Base:
main← Head:main📝 Commits (5)
440518bkick off transfer first when there are too many slices to post inRdmaTransport::submitTransferTaskf1e38f4allow the last slice of aTransferRequestto be larger to reduce wr&&slice related overhead1a94176Merge branch 'kvcache-ai:main' into maindcc03a9add configs && docs explanation04bc3a3remove a unnecessary reset operation📊 Changes
6 files changed (+51 additions, -6 deletions)
View changed files
📝
doc/en/transfer-engine.md(+2 -1)📝
doc/zh/transfer-engine.md(+1 -0)📝
mooncake-transfer-engine/include/config.h(+1 -0)📝
mooncake-transfer-engine/include/transport/transport.h(+10 -3)📝
mooncake-transfer-engine/src/config.cpp(+12 -0)📝
mooncake-transfer-engine/src/transport/rdma_transport/rdma_transport.cpp(+25 -2)📄 Description
In scenarios such as cases mentioned in #499 , where transfers involve a large batch size (thousands or more), but each chunk within the batch is relatively small (tens to hundreds of KiB), a substantial number of slices and work requests must be generated for the transfer. The current implementation introduces non-negligible latency due to the following issue:
RdmaTransport::submitTransferTask, all slices must be allocated before posting toRdmaContext::submitPostSend. When there are many requests, the volume of slices can overwhelm theThreadLocalSliceCache, causing page faults and delaying transfer initiation.TransferRequestlength may not be a multiple ofGlobalConfig::slice_size, leading to smaller final slices. Each slice becomes a separate work request, and when many small slices are created, overhead increases, reducing throughput.newoperator reaches a predefined watermark, even if there are still pending requests to be processed inRdmaTransport::submitTransferTask.Run the Python script provided by #499
Since the modification occurs with
RdmaTransport::submitTransferTask, two results have been merged for comparison as followResult shows that the modification achieves 20%~30% boost in throughput.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.