mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[PR #1128] [CLOSED] [TE] fix(rdma): pre-compute slice_count to avoid race condition #2028
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#2028
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/1128
Author: @wwq2333
Created: 11/27/2025
Status: ❌ Closed
Base:
main← Head:fix-rdma-slice-count-race📝 Commits (3)
d1d1c24[TE] fix(rdma): pre-compute slice_count to avoid race condition7165eab[TE] fix(rdma): simplify slice count calculation by merging redundant conditionsde84bfb[TE] fix(rdma): unify slice counting and allocation logic📊 Changes
3 files changed (+118 additions, -45 deletions)
View changed files
📝
mooncake-transfer-engine/include/transport/rdma_transport/rdma_transport.h(+20 -0)📝
mooncake-transfer-engine/src/transport/rdma_transport/rdma_endpoint.cpp(+1 -1)📝
mooncake-transfer-engine/src/transport/rdma_transport/rdma_transport.cpp(+97 -44)📄 Description
Description
Previously,
task.slice_countwas incremented inside the slicing loop using__sync_fetch_and_add(). This caused a race condition under USE_EVENT_DRIVEN_COMPLETION (#1053): when some slices completed quickly,completed_slice_countcould equalslice_countbefore all slices were created, causing premature task completion detection. Similarly, any other logic that needs to accessslice_countcould also be affected by this issue.This commit:
Type of Change
How Has This Been Tested?
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.