[GH-ISSUE #35] Why use "ld.acquire" order to get channel_tail_idx in dispatch kernels? #33

Closed
opened 2026-10-26 09:52:52 +00:00 by bsakaguchi · 1 comment
Owner

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

Image

I notice the use of "ld.acquire" order to get channel_tail_idx in dispatch kernels. I guess it is used to gurantee that the following load will not preceed the load of channel_tail_idx. But I think the condition of breaking "while block", I mean, cached_channel_head_idx != cached_channel_tail_idx, has already gurantee the order. So if use a normal load, it will also work?

Originally created by @hellboywyh on GitHub (Mar 2, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/35 <img width="796" alt="Image" src="https://github.com/user-attachments/assets/b5c14b3d-dce9-43ca-b806-1abd0078b0db" /> I notice the use of "ld.acquire" order to get channel_tail_idx in dispatch kernels. I guess it is used to gurantee that the following load will not preceed the load of channel_tail_idx. But I think the condition of breaking "while block", I mean, `cached_channel_head_idx != cached_channel_tail_idx`, has already gurantee the order. So if use a normal load, it will also work?
Author
Owner

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

Normal loads (ld.volatile) are correct, but release/acquire pairs are more "semantically" correct, you can think it as a coding standard.

<!-- gh-comment-id:2693137010 --> @LyricZhao commented on GitHub (Mar 3, 2025): Normal loads (`ld.volatile`) are correct, but `release/acquire` pairs are more "semantically" correct, you can think it as a coding standard.
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#33
No description provided.