mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[GH-ISSUE #587] Why doesn't low-latency dispatch use system-level fence before issuing IBGDA writes? #360
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#360
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 @hexclover on GitHub (Mar 2, 2026).
Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/587
(Clarification: https://github.com/deepseek-ai/DeepEP/issues/113 also inquires about the
__threadfenceinibgda_post_send, but in this issue I am asking specifically about the consistency guarantee of the token data, not the WQE itself, so this is technically not a duplicate 😃)To quote from
internode_ll::dispatch, it first performs casting and writes FP8 data to the send buffer:github.com/deepseek-ai/DeepEP@567632dd59/csrc/kernels/internode_ll.cu (L213-L252)Then it issues IBGDA writes.
nvshmemi_ibgda_put_nbi_warpis implemented such that the request is posted to NIC whenslot_idx % 4 == 3.github.com/deepseek-ai/DeepEP@567632dd59/csrc/kernels/internode_ll.cu (L267)The problem is I don't see any use of system-level primitives here, to guarantee the NIC will read the freshly cast data from the send buffer when it composes IB packets. The closest thing I see is the
__threadfenceinibgda_post_send, but it is not system-level (and I'm curious about that one, too).@hexclover commented on GitHub (Mar 2, 2026):
Grepping the original NVSHMEM code, I see both of
__threadfence{,_system}are used insrc/include/non_abi/device/pt-to-pt/ibgda_device.cuh, such as the examples below:github.com/NVIDIA/nvshmem@fcd704cc46/src/include/non_abi/device/pt-to-pt/ibgda_device.cuh (L222-L244)github.com/NVIDIA/nvshmem@fcd704cc46/src/include/non_abi/device/pt-to-pt/ibgda_device.cuh (L1629)github.com/NVIDIA/nvshmem@fcd704cc46/src/include/non_abi/device/pt-to-pt/ibgda_device.cuh (L2238-L2239)Which one to choose from the two flavors of fences seems to depend on flags including
nic_buf_on_gpumemandis_data_buf_in_sysmem. If those flags simply mean whether the buffer is located on host memory or GPU memory, then it seems NVSHMEM also considers a plain__threadfenceis sufficient in these use cases. If this is the case, then this and #113 can probably be answered in the same way as https://github.com/deepseek-ai/DeepEP/issues/113#issuecomment-2785394086: