Repository navigation
[TransferEngine]Add grouped scatter tasks for TCP - #4200
Merged
Merged
Conversation
LLLL114
marked this pull request as ready for review
September 18, 2026 03:06
LLLL114
requested review from
alogfans,
chestnut-Q,
doujiang24 and
staryxchen
as code owners
September 18, 2026 03:06
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The tests do not verify that TCP requests are actually submitted as one grouped task, so the performance path could regress unnoticed.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Enables grouped TCP scatter tasks while preserving sequential transfer behavior and per-fragment completion results.
Changes:
- Advertises grouped-scatter support for TCP.
- Prepares all requests in grouped tasks and aggregates byte counts.
- Adds fragmented read/write and partial-failure tests.
File summaries
| File | Description |
|---|---|
tcp_transport.cpp |
Processes every request in grouped TCP tasks. |
tcp_transport.h |
Enables TCP grouped-scatter capability. |
tcp_write_visibility_test.cpp |
Tests grouped transfers and fragment failures. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: huanglong <huanglong@linux.alibaba.com>
8 of 36 tasks
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.
Description
TCP scatter currently creates one completion-tracking task per request, although
MultiTransportalready supports grouping adjacent requests from the same scatter operation. Large fragmented transfers therefore incur repeated per-task status checks.Enable TCP's grouped-scatter capability, prepare every request in each grouped task, and accumulate the task's total byte count. Keep the existing TCP transfer sequence and wire protocol. Add tests for fragmented reads and writes, exactly-once callbacks, and preservation of individual fragment results when a peer rejects part of a group.
This is a focused TCP follow-up to #3310, which introduced grouped RDMA tasks while retaining TCP-local sequencing. The change reuses
MultiTransport's existing grouping and completion machinery. Storeget_into_rangescan benefit when it uses TCP scatter; no Store or KV reshard changes are required by this PR.Performance
Configuration:
submitScatter()pluswait()timed together; no Store/SGLang path.CLOCK_THREAD_CPUTIME_ID; process CPU usesCLOCK_PROCESS_CPUTIME_IDand includes both endpoints' I/O threads. CPU time sums thread execution and may exceed wall time.All times are milliseconds per operation. Each cell shows baseline → patched.
For the 4 MiB case, caller-thread CPU fell by 96.96% and process CPU by 42.34%. This is a CPU-overhead reduction, not a claim of a material transfer-latency or throughput improvement.
Module
mooncake-transfer-engine)mooncake-store)mooncake-conductor)mooncake-reshard)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)mooncake-rl)Type of Change
How Has This Been Tested?
Test commands:
cmake --build build-tcp-probe \ --target tcp_write_visibility_test transport_uint_test -j 8 build-tcp-probe/mooncake-transfer-engine/tests/tcp_write_visibility_test build-tcp-probe/mooncake-transfer-engine/tests/transport_uint_test \ --gtest_filter='*Batch*:*Scatter*:*Grouped*'Test results:
Checklist
./scripts/code_format.shAI Assistance Disclosure
Codex assisted with implementation, regression tests, validation and PR preparation. The human submitter reviews the changes.