mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[GH-ISSUE #212] [Bug] Possible Head/Tail Management and Memory Leak Problem for Normal Mode internode Dispatch Operation #171
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepEP#171
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 @ZhiyiHu1999 on GitHub (Jun 16, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/212
Hi, in the normal internode diapatch, we have the
kRDMANVLForwarderwarp to update theforward_channel_headandforward_channel_retired, lettingkNVLCoordinatorknow the forwarding progress.github.com/deepseek-ai/DeepEP@21efbe9b48/csrc/kernels/internode.cu (L792)github.com/deepseek-ai/DeepEP@21efbe9b48/csrc/kernels/internode.cu (L803)However, I wonder if there is the possibility that, when the
kRDMANVLForwarderperforms the last update (updating theforward_channel_headand setting theforward_channel_retiredto true), and before thekNVLCoordinatorhave read the newestforward_channel_headvalue, it readforward_channel_retiredwhich is set to true. So, the newest forwarding head value may not be written to the sender side.github.com/deepseek-ai/DeepEP@21efbe9b48/csrc/kernels/internode.cu (L826-L827)Therefore, I want to know if there is the above head/tail management problem. if so, will it cause some problem, for example, memory leak when we perform the next dispatch which reuses the same buffer.
Thanks a lot for you help! And if you could confirm the problem, i am willing to submit a PR for it! Thanks again!
@sphish commented on GitHub (Jun 16, 2025):
I don't think there is an issue here. As shown in the code you referenced,
kNVLCoordinatorwill compute themin_head. When a forwarder retires, it is effectively the same as setting itsforward_channel_headto the maximum value.@LyricZhao commented on GitHub (Jun 16, 2025):
"The maximum value" means the
INT_MAX."Head" means the minimum (by index) slot that the receivers wait to consume. If a warp is retired, it means that the warp has already consumed all the required slots, so it is safe to release such slots.