[GH-ISSUE #93] Questions About Illegal Memory Access in DeepEP Low-Latency API Integration #85

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

Originally created by @JimmyWang1850 on GitHub (Mar 25, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/93

Subject:
We've successfully integrated DeepEP's low-latency into our LLM project deployed on H20 GPUs, but encountered an illegal memory access issue during CUDA graph execution. Below are our implementation details and observations:
Implementation Workflow

  1. Initialization
    Called deep_ep.Buffer.get_low_latency_rdma_size_hint() to configure and initialize the low-latency buffer. num_max_dispatch_tokens_per_rank will be 244。
  2. Warmup Phase
  3. CUDA Graph Creation
    Created multiple CUDA graphs with batch sizes bs = [1, 2, 4, 8, ...] sharing the same DeepEP low-latency buffer. All operations use:
    ● buffer.low_latency_dispatch
    ● buffer.low_latency_combine
    Note: num_max_dispatch_tokens_per_rank is set equal to batch size during dispatch.

Observed Issue

When executing the bs=1 CUDA graph, we encounter invalid token counts at this critical line:
while ((num_recv_tokens = ld_acquire_global(rdma_recv_count + local_expert_idx * num_ranks + src_rank)) == 0); at https://github.com/deepseek-ai/DeepEP/blob/main/csrc/kernels/internode_ll.cu#L263

(Code Reference)
The num_recv_tokens variable receives corrupted values (e.g., 19xxxxxxx), indicating memory access violations. Notably:
●The issue only manifests when multiple CUDA graphs coexist
●Single CUDA graph configurations work correctly

Key Questions

  1. API Usage Validation
    Are there any known constraints when reusing low-latency buffers across multiple CUDA graphs?
  2. Buffer State Management
    The README mentions:
    "you may need to restore some buffer status once you replay"
    Could this imply required buffer state reset between graph replays? What specific buffer states require maintenance?
  3. Concurrency Considerations
    Should different batch sizes in concurrent graphs require separate buffer instances or explicit synchronization?
Originally created by @JimmyWang1850 on GitHub (Mar 25, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/93 Subject: We've successfully integrated DeepEP's low-latency into our LLM project deployed on H20 GPUs, but encountered an illegal memory access issue during CUDA graph execution. Below are our implementation details and observations: Implementation Workflow 1. Initialization Called deep_ep.Buffer.get_low_latency_rdma_size_hint() to configure and initialize the low-latency buffer. num_max_dispatch_tokens_per_rank will be 244。 2. Warmup Phase 3. CUDA Graph Creation Created multiple CUDA graphs with batch sizes bs = [1, 2, 4, 8, ...] sharing the same DeepEP low-latency buffer. All operations use: ● buffer.low_latency_dispatch ● buffer.low_latency_combine Note: num_max_dispatch_tokens_per_rank is set equal to batch size during dispatch. Observed Issue When executing the bs=1 CUDA graph, we encounter invalid token counts at this critical line: `while ((num_recv_tokens = ld_acquire_global(rdma_recv_count + local_expert_idx * num_ranks + src_rank)) == 0);` at https://github.com/deepseek-ai/DeepEP/blob/main/csrc/kernels/internode_ll.cu#L263 (Code Reference) The num_recv_tokens variable receives corrupted values (e.g., 19xxxxxxx), indicating memory access violations. Notably: ●The issue only manifests when multiple CUDA graphs coexist ●Single CUDA graph configurations work correctly Key Questions 1. API Usage Validation Are there any known constraints when reusing low-latency buffers across multiple CUDA graphs? 2. Buffer State Management The README mentions: "you may need to restore some buffer status once you replay" Could this imply required buffer state reset between graph replays? What specific buffer states require maintenance? 3. Concurrency Considerations Should different batch sizes in concurrent graphs require separate buffer instances or explicit synchronization?
Author
Owner

@LyricZhao commented on GitHub (Mar 26, 2025):

The core reason is that the num_max_dispatch_tokens_per_rank is different for each graph, moved to WeChat discussion, close it now, feel free to reopen it.

<!-- gh-comment-id:2753365756 --> @LyricZhao commented on GitHub (Mar 26, 2025): The core reason is that the `num_max_dispatch_tokens_per_rank` is different for each graph, moved to WeChat discussion, close it now, feel free to reopen it.
Author
Owner

@Huoyuan100861 commented on GitHub (Mar 26, 2025):

The core reason is that the num_max_dispatch_tokens_per_rank is different for each graph, moved to WeChat discussion, close it now, feel free to reopen it.

Hello DeepEP author,
Thank you very much for providing such a high-performance EP communication library. I've encountered a similar issue and was wondering if it would be possible to exchange contact information for further discussion?
Thank you.

<!-- gh-comment-id:2753662510 --> @Huoyuan100861 commented on GitHub (Mar 26, 2025): > The core reason is that the `num_max_dispatch_tokens_per_rank` is different for each graph, moved to WeChat discussion, close it now, feel free to reopen it. Hello DeepEP author, Thank you very much for providing such a high-performance EP communication library. I've encountered a similar issue and was wondering if it would be possible to exchange contact information for further discussion? Thank you.
Author
Owner

@LyricZhao commented on GitHub (Mar 26, 2025):

Sure, WeChat: LyricZ_THU

<!-- gh-comment-id:2753678883 --> @LyricZhao commented on GitHub (Mar 26, 2025): Sure, WeChat: LyricZ_THU
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#85
No description provided.