已合并
MoeComputeExpertTokens文档更新 #5728
wuxiyuan创建于 9 天前
MoeComputeExpertTokens文档更新 #5728
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 wuxiyuan 的贡献)ascend-robot
9 天前 评论:
9 天前 评论:
atomgit-bot
9 天前 评论:
9 天前 评论:
变更摘要
该 PR 是对 torch_npu.npu_moe_compute_expert_tokens 算子文档的更新,主要修正了公式描述、参数/输出约束、支持的型号以及调用示例。核心是纠正了原文档中公式的拼写错误和示例参数的取值问题,使文档与算子的实际接口约束保持一致。
主要改动
- 修正计算公式描述: 将原公式中的
BinaerSearch拼写修正为BinarySearch,并将公式细化为expertTokens_{i}=BinarySearch(sortedExpertForSourceRow,i), i in [0,numExpert)。 - 完善输入参数约束: 更新
sorted_expert_for_source_row的语义为“每个 source row 排序后对应的专家索引”,新增输入值范围[0, num_expert-1]、非递减顺序要求以及元素个数需小于2^24;num_expert的取值范围更新为(0, 2048]。 - 明确输出说明: 将
expertTokens的 shape 明确为[num_expert],并说明数据类型与sorted_expert_for_source_row保持一致。 - 更新支持型号与约束: 约束说明中新增
Ascend 950PR/Ascend 950DT(A5)支持该接口,支持的型号列表同步加入Ascend 950PR/Ascend 950DT。 - 修正调用示例参数: 单算子模式和图模式示例中,
sorted_experts由[3,3,4,5,6,7]改为[0,0,0,1,1,2],num_experts由5改为3,使其符合新的输入约束。


atomgit-bot
9 天前 评论:
9 天前 评论:
9 天前 添加了label:ascend-cla/yes
此处折叠了53条消息 查看更多
ascend-robot
8 天前 评论:
8 天前 评论:
The following label exists.
needs-issue: The pull request must be linked to at least one issue.


8 天前 删除了label:needs-issue
8 天前 关闭了关联的issue
8 天前 合入了pull request
【合入来源】
【修改方案】
MoeComputeExpertTokens算子文档补充Ascend950支持
【资料变更】
修改MoeComputeExpertTokens文档中关于Ascend950支持的说明
【接口变更】
【功能验证】
【CheckList】