mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[GH-ISSUE #81] inplace_unique(rank_idx, num_ranks) in tests/test_intranode.py #73
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#73
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 @zhoutianzi666 on GitHub (Mar 19, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/81
inplace_unique(rank_idx, num_ranks)inplace_unique函数感觉有点绕呀rank_idx假设输入为:[3, 3, 4, 5, 6, 6, 7, 3]
然后统计每个rank上接受此token的个数和 :[0,0,0,3,1,1,2,1]
然后再按照索引从右到左排序,出现0的地方搞成了-1得到输出
[ 7, 6, 5, 4, 3, -1, -1, -1]
可是这样搞的话,是为啥呢?感觉已经脱离了rank_idx的字面意义了,这还怎么和topk_idx进行对应啊。
@zhoutianzi666 commented on GitHub (Mar 19, 2025):
哦,我好像有点理解了,感觉这里应该是只关心这个token需要发送到几张卡上,而不用关心这个token 被发送到了某张卡上的多个专家 。
@LyricZhao commented on GitHub (Mar 21, 2025):
对的,你看函数名就行了;就是把 rank 去重一下,不需要关心里面的实现。