[GH-ISSUE #661] [Issue] Would VA signal with RO enabled cause unexpected data correctness problems in DeepEP V2? #388

Closed
opened 2026-10-26 09:59:54 +00:00 by bsakaguchi · 9 comments
Owner

Originally created by @baymaxhuang on GitHub (Jun 9, 2026).
Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/661

The DeepEP v2 uses GIN VA signal with RO enabled to notify the peers to read tokens from the receive buffer. And the DeepEP document recommends configuring PCI_ATOMIC_MODE=4 to improve atomic performance, which would use the PCI Atomic, see pci-atomic-mode. According to the discussion in this issue https://github.com/NVIDIA/nccl/issues/2210, the RO PCI Atomic operation could bypass prior write operations. Maybe there would be a data correctness problem in DeepEP v2 if we configure PCI_ATOMIC_MODE=4 ?

Originally created by @baymaxhuang on GitHub (Jun 9, 2026). Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/661 The DeepEP v2 uses GIN VA signal with RO enabled to notify the peers to read tokens from the receive buffer. And the DeepEP document recommends configuring `PCI_ATOMIC_MODE=4` to improve atomic performance, which would use the PCI Atomic, see [pci-atomic-mode](https://github.com/deepseek-ai/DeepEP#pci-atomic-mode). According to the discussion in this issue https://github.com/NVIDIA/nccl/issues/2210, the RO PCI Atomic operation could bypass prior write operations. Maybe there would be a data correctness problem in DeepEP v2 if we configure `PCI_ATOMIC_MODE=4` ?
Author
Owner

@baymaxhuang commented on GitHub (Jun 9, 2026):

@sphish @LyricZhao could you please help confirm this?

<!-- gh-comment-id:4656734973 --> @baymaxhuang commented on GitHub (Jun 9, 2026): @sphish @LyricZhao could you please help confirm this?
Author
Owner

@gangxie112 commented on GitHub (Jun 9, 2026):

Per the PCIe specification, a Posted Write request with RO=1 can be bypassed by subsequent Non-Posted requests. If the associated MR also enables RO, the FAA operation will not wait for the write-combining buffer to be flushed.
RO FAA acts as a PCIe ordering point. It forces all prior posted writes (including those from RO) to be flushed to memory before completion. This is why NCCL_WIN_STRICT_ORDERING maps to NCCL_NET_MR_FLAG_FORCE_SO, and consequently disables the IBV_ACCESS_RELAXED_ORDERING flag during MR registration.

<!-- gh-comment-id:4656860405 --> @gangxie112 commented on GitHub (Jun 9, 2026): Per the PCIe specification, a Posted Write request with RO=1 can be bypassed by subsequent Non-Posted requests. If the associated MR also enables RO, the FAA operation will not wait for the write-combining buffer to be flushed. RO FAA acts as a PCIe ordering point. It forces all prior posted writes (including those from RO) to be flushed to memory before completion. This is why NCCL_WIN_STRICT_ORDERING maps to NCCL_NET_MR_FLAG_FORCE_SO, and consequently disables the IBV_ACCESS_RELAXED_ORDERING flag during MR registration.
Author
Owner

@sphish commented on GitHub (Jun 10, 2026):

Thanks for the feedback. I'll look into this.

<!-- gh-comment-id:4665791010 --> @sphish commented on GitHub (Jun 10, 2026): Thanks for the feedback. I'll look into this.
Author
Owner

@sphish commented on GitHub (Jun 10, 2026):

This is indeed an issue. Have you encountered any data errors resulting from it?

<!-- gh-comment-id:4666602749 --> @sphish commented on GitHub (Jun 10, 2026): This is indeed an issue. Have you encountered any data errors resulting from it?
Author
Owner

@baymaxhuang commented on GitHub (Jun 10, 2026):

@sphish, thanks for confirming it. Indeed, we have not encountered any data check errors when testing with test_ep.py. And we are planning to do more pressure tests on it because the data error problem is a very critical issue in model training.

<!-- gh-comment-id:4667034593 --> @baymaxhuang commented on GitHub (Jun 10, 2026): @sphish, thanks for confirming it. Indeed, we have not encountered any data check errors when testing with test_ep.py. And we are planning to do more pressure tests on it because the data error problem is a very critical issue in model training.
Author
Owner

@kimimaroo commented on GitHub (Jun 29, 2026):

Hi @baymaxhuang, you mentioned earlier that you were planning to run more pressure tests on this. Any results to share? Especially curious about PCI_ATOMIC_MODE=4 with long-running data checks — given NVIDIA/nccl#2210 now confirms via PCIe spec B2b/C2b that mode 4 is the actually-unsafe case.

<!-- gh-comment-id:4830748124 --> @kimimaroo commented on GitHub (Jun 29, 2026): Hi @baymaxhuang, you mentioned earlier that you were planning to run more pressure tests on this. Any results to share? Especially curious about PCI_ATOMIC_MODE=4 with long-running data checks — given NVIDIA/nccl#2210 now confirms via PCIe spec B2b/C2b that mode 4 is the actually-unsafe case.
Author
Owner

@baymaxhuang commented on GitHub (Jun 29, 2026):

Hi, @kimimaroo, I have not reproduced this issue with the config of PCI_ATOMIC_MODE=4. Maybe it is a very rare case, and we will be careful with it.

<!-- gh-comment-id:4832366659 --> @baymaxhuang commented on GitHub (Jun 29, 2026): Hi, @kimimaroo, I have not reproduced this issue with the config of PCI_ATOMIC_MODE=4. Maybe it is a very rare case, and we will be careful with it.
Author
Owner

@kimimaroo commented on GitHub (Jun 30, 2026):

A thought on why PCI_ATOMIC_MODE=4 might not reproduce in practice — IB Spec o9-20 says:

An application shall not depend on the contents of an RDMA WRITE buffer at the responder until one of the following has occurred:

  • Arrival and Completion of the last RDMA WRITE request packet when used with Immediate data.
  • Arrival and completion of a subsequent SEND message.
  • Update of a memory element by a subsequent ATOMIC operation.

The third clause makes a subsequent ATOMIC a valid ordering point for prior WRITE contents on the same QP. So even if PCIe C2b permits the Atomic TLP to bypass posted writes, the HCA must enforce ordering above PCIe (clear RO on the atomic TLP, drain outstanding writes before issuing, or some internal fence) — otherwise it violates o9-20. That would explain why mode 4 doesn't corrupt data in practice.

<!-- gh-comment-id:4839742527 --> @kimimaroo commented on GitHub (Jun 30, 2026): A thought on why PCI_ATOMIC_MODE=4 might not reproduce in practice — IB Spec o9-20 says: > An application shall not depend on the contents of an RDMA WRITE buffer at the responder until one of the following has occurred: > - Arrival and Completion of the last RDMA WRITE request packet when used with Immediate data. > - Arrival and completion of a subsequent SEND message. > - **Update of a memory element by a subsequent ATOMIC operation.** The third clause makes a subsequent ATOMIC a valid ordering point for prior WRITE contents on the same QP. So even if PCIe C2b permits the Atomic TLP to bypass posted writes, the HCA must enforce ordering above PCIe (clear RO on the atomic TLP, drain outstanding writes before issuing, or some internal fence) — otherwise it violates o9-20. That would explain why mode 4 doesn't corrupt data in practice.
Author
Owner

@sphish commented on GitHub (Jul 7, 2026):

Fixed in https://github.com/deepseek-ai/DeepEP/pull/674. Thank you!

<!-- gh-comment-id:4901476214 --> @sphish commented on GitHub (Jul 7, 2026): Fixed in https://github.com/deepseek-ai/DeepEP/pull/674. Thank you!
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepEP#388
No description provided.