mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[GH-ISSUE #461] Some question about the DC QP in nvshmem. #298
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#298
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 @shanleo2024 on GitHub (Oct 20, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/461
Hi dear developer,
I've just started learning about DeeEP, and noticed that in the code of origin nvshmem, there are lots of logic about DC, but there is not any such login in nvshmem used by deepep.
There are two questions:
(1) In the native nvshmem, what is the role of DC qp?
(2) Is the DC logic necessary? If so, what should be used instead of simplifying the DC logic?
Thank you!
@seth-howell commented on GitHub (Oct 22, 2025):
One thing to keep in mind, specifically requesting DC QPs in the environment before running DeepEP would result in hangs or segfaults.
@shanleo2024 commented on GitHub (Oct 27, 2025):
Hi @seth-howell
From the nvshmem source code alone, it can be seen that whether DC is necessary mainly depends on whether the GPU supports CUevice-ATTRIBUTE-GPU-DIRECT-RDMA-WRITES-ORDERING.
From Deepep's perspective, the simplified version of ibgda_device.cuh file does not use DC's QP. Does it depend on NV's GPU supporting this attribute?
Thank you!
@alpha-baby commented on GitHub (Oct 30, 2025):
I checked the source code of NVSHMEM, and this is the only place where QP is being created.
@seth-howell commented on GitHub (Nov 4, 2025):
Hi, sorry for the delay. I was OOO last week.
In upstream NVSHMEM, RC and DC are both supported as the main communication path regardless of the value of this attribute.
You are correct that in the general case (Using the entire set of upstream NVSHMEM APIs), a single DC qpair can be required to enforce consistent GPU memory in certain cases. This is not applicable to the DeepEP kernels because of the limited set of APIs it uses.
The reasoning for requiring consistency is as follows. Prior to Hopper, GPUDirect RDMA writes were not flushed to the level of consistency by default. The traditional way to fix this was to create a loopback read operation which flushed all writes which had been performed to your GPU from all peers.
Thank you for pointing out this case. There is some nuance to this requirement, and why DeepEP doesn't need it.
consistency is used in two cases:
This is only required after a get operation has been issued, or a fetching atomic has been performed (for some transports including IBGDA). This is to guarantee the SHMEM memory model.
DeepEP does not use get operations or fetching atomics, and they do not use the barrier function. So it is not required by DeepEP.
IB atomics perform a PCIe read, modifies the value and writes it back. The read in the non-fetching atomic performs the same function on the remote PE as if it did a loopback read to itself, so you get ordering guarantees for the writes before it. This is consistent with the DeepEP model which relies on the put_nbi->atomic_add operation sequence to guarantee ordering.
nvshmem_quiet + nvshmem_sync is used in the notify functions rather than nvshmem_barrier.
quiet + sync is equivalent to barrier, minus the enforce_cst call. enforce_cst can be ignored based on the write->atomic reasoning above.