Repository navigation
[TE] hp_tcp: assign each operation to the least-loaded lane - #4935
Conversation
hp_tcp picked a lane from a per-peer submission sequence (lane_sequence % connections_per_peer), regardless of which lanes were busy. Each lane runs one operation at a time, so under a closed-loop client (a fixed number of transfers in flight, one submitted per completion) the lane that just finished received its next operation only after the sequence came back around, i.e. after connections_per_peer more completions. Lane utilization then settles at whatever fraction it starts at (busy fraction A/N is self-consistent for any number A of active lanes), and with deeper windows the equal round-robin split piles the window onto the slowest connections. Measured on two VMs over a 200 Gb/s pod network (16 MB writes, host memory, 16 lanes): every lane received a request every ~30 ms and transferred for ~15 ms; 7-9 of 16 lanes were sending at any time; the gap from a lane's response to its next request header was 14-17 ms while the client resubmitted within 0.6 ms. Throughput was 5.6-8.9 GB/s with occasional 14-15 GB/s runs. Keep an outstanding-operation count per (target, lane) and give each single-slice operation to the lane with the fewest outstanding operations, ties broken from the round-robin position so the original spreading is kept. The count is released on completion and on both cancel paths. Multi-slice (rail-striped) operations are unchanged. 1 pair, 16 lanes: 7.9-9.2 -> 12.9-14.9 GB/s, run-to-run spread < 5%. 1 pair, 48 lanes, 32 workers: 19.8 GB/s. 2 process pairs: 10.9 -> 19.2 GB/s (classic tcp 19.8, iperf3 21.7).
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
@jacklin78911-collab Could you take a look? |
|
Thanks for the diagnosis. The lane-utilization measurements are consistent with the observed throughput gap, and picking the lane with the fewest outstanding ops is a reasonable minimal fix. Blocking:
Follow-ups, not needed for this PR: low-concurrency and P99 numbers, a multi-rail config, and counting striped READ slices. |
The per-lane outstanding count was taken when an operation was planned and given back only on completion or cancellation. Planned commands that never run leaked it: a batch whose later request fails to plan drops the commands planned for earlier requests, and tryCommitBatch() can reject (admission backpressure, TooManyRequests) and destroy the commands without calling cancel; retries have the same pattern. Each leak left +1 on a lane for good, so the lane was avoided from then on. The count is now held by a LaneSlot shared by the planned command, the queued operation and its completion callback. It is released explicitly on completion and on both cancel paths (so the next submission sees the lane free at once), and otherwise when the last holder is destroyed, at most once. Every path that drops a planned command, current or future, gives the count back. Test: LaneLoadReturnsToZeroOnRejectedSubmits checks that the counts return to zero after an admission rejection, after a mid-batch planning failure, and after a completed transfer. It fails on the previous revision (all three checks) and passes with this change; ctest -R hp_tcp: 9/9.
|
Thanks, I reviewed I recompiled the changed transport/header and new regression against cached CPU runtime dependencies. The regression passes on I also ran a supplementary native HP_TCP comparison on two-process WSL2 loopback: 16 MiB WRITEs, 16 lanes, 32 GiB cumulative transfers using reused buffers, three fresh-process runs per case. Compared with pre-PR round-robin, median throughput was about 4.5% lower at 16 in flight and essentially unchanged at 64. P50 increased slightly; P99 improved at both depths. A separate comparison before/after the These are local diagnostics and do not independently validate the original VM-network throughput claim. The remaining item from my review is the repeated in-flight 16 and 64 results from that environment. I found no further correctness blocker in this revision; current-head CI still needs to complete. |
|
Thanks. I'm testing it on Nebius uk-south-1 B300s. Repeated runs (VM network). Same setup as the description: one sender/receiver pair on two VMs over the VXLAN pod network, hp_tcp
Individual runs (GB/s, in run order):
|
|
Thanks for the repeated runs and individual samples. These address the remaining measurement request, and the current CI Gate is green. Please update the “run-to-run spread under 5%” statement in the description to reflect these results: the after-fix CVs are 8.3% and 6.9%. Variability improves substantially at 16 in flight; at 64, throughput improves but CV increases from 5.1% to 6.9%. The earlier accounting and regression-test concerns are resolved, and I have no further code changes to request. LGTM once the description reflects the updated measurements. |
|
Thanks! I've updated the description |
|
@jacklin78911-collab Hi! Thanks for the detailed comment and review. Can you take a look at the updated description? |
|
Thanks, I checked the updated description. LGTM. |
staryxchen
left a comment
There was a problem hiding this comment.
LGTM. Thank @jacklin78911-collab for the detailed review.
hp_tcp picked a lane from a per-peer submission sequence (lane_sequence % connections_per_peer), regardless of which lanes were busy. Each lane runs one operation at a time, so under a closed-loop client (a fixed number of transfers in flight, one submitted per completion) the lane that just finished received its next operation only after the sequence came back around, i.e. after connections_per_peer more completions. Lane utilization then settles at whatever fraction it starts at (busy fraction A/N is self-consistent for any number A of active lanes), and with deeper windows the equal round-robin split piles the window onto the slowest connections.
Measured on two VMs over a 200 Gb/s pod network (16 MB writes, host memory, 16 lanes): every lane received a request every ~30 ms and transferred for ~15 ms; 7-9 of 16 lanes were sending at any time; the gap from a lane's response to its next request header was 14-17 ms while the client resubmitted within 0.6 ms. Throughput was 5.6-8.9 GB/s with occasional 14-15 GB/s runs.
Keep an outstanding-operation count per (target, lane) and give each single-slice operation to the lane with the fewest outstanding operations, ties broken from the round-robin position so the original spreading is kept. The count is released on completion and on both cancel paths. Multi-slice (rail-striped) operations are unchanged.
1 pair, 16 lanes: 7.9-9.2 -> 12.9-14.9 GB/s, run-to-run spread < 10%. 1 pair, 48 lanes, 32 workers: 19.8 GB/s. 2 process pairs: 10.9 -> 19.2 GB/s (classic tcp 19.8, iperf3 21.7).
fixes #4934
Description
Suggested Merge Priority
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:
Throughput (manual):
transfer_submit_write/transfer_check_status.worker_count=16,connections_per_peer=16unless noted.After the fix, the run-to-run spread is under 10% (previously 5.6–15 GB/s for one configuration). Variability improves substantially at 16 in flight; at 64, throughput improves but CV increases from 5.1% to 6.9%.
Test results:
Checklist
./scripts/code_format.shAI Assistance Disclosure
Claude Code helped run experiment and diagnose & drafted the patch.