Merged
fix: moe_token_permute_with_ep_grad长尾算子加固 #15613
fix: moe_token_permute_with_ep_grad长尾算子加固 #15613
Merged
klein8793Add on 19 days ago
klein8793
klein8793Collaborators
19 days ago

描述

对 moe_token_permute_with_ep_grad 算子进行长尾加固,补强输入校验、支持 probs_grad 可选输出与 range 回退处理,并修复边界场景的越界隐患。

改动内容

  1. 输入校验加强(infershape/tiling):
    • num_topk 必须为正且不超过 512;
    • sorted_indices 必须为 1D,长度必须为正且能被 num_topk 整除;
    • padded_mode 仅支持 False;
  2. 可选输出支持(def/infershape):probs_grad 输出由 REQUIRED 调整为 OPTIONAL,图调用省略该输出时不再报错;
  3. range 回退处理(tiling):range 未提供时回退到全量范围(等效 aclnnMoeTokenPermuteGrad 语义),结束索引取 sorted_indices 全长度,并校验 permuted_tokens_output_grad 行数与 sorted_indices 长度相等;
  4. 越界防护(tiling):permute-grad 场景下,当 permuted_probs_output_grad 输入存在时必须提供 probs_grad 输出,避免向空输出地址写导致越界;
  5. README/docs/example 同步更新。

关联的Issue

  • #8009

测试

冒烟测试、算子l0测试已通过

文档更新

已同步更新 README.md、README_en.md、docs/ 与 example。

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for klein8793's contribution.)
klein8793klein8793Collaborators
19 days ago Created pull request, commit 2189475b
CANN-robotCANN-robotCollaborators
19 days ago Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
19 days ago Comments:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.


PR Approval Progress

✅ Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
*/*/README.md ✅ 陈娇, 杨露, guoqiuhao, cpy_123456 (4/2) ✅ 陈娇, 杨露 (2/1)
*/*/docs/acl*.md ✅ 陈娇, 杨露, guoqiuhao, cpy_123456 (4/2) ✅ 陈娇, 杨露 (2/1)
*/*/op_host/*_def.cpp ✅ guoqiuhao, cpy_123456, 汤磊 (3/2) ✅ 汤磊 (1/1)
moe ✅ guoqiuhao, cpy_123456, cheng_zhiwei (3/2) ✅ cheng_zhiwei (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

klein8793, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robotCollaborators
19 days ago Set cpy_123456,cheng_zhiwei,juyangokok,monologue815,chen-linxin4,yu-xinjie62,jiang-lirui,Allan_Yu,tang-lei01,songkai111,liudan12,Wei_NaChuan,cc-z,kdy18482276080,xuchengyang,mabing1118,wangyongguang,guoqiuhao,Julius47 as approver
CANN-robotCANN-robotCollaborators
19 days ago Set cpy_123456,cheng_zhiwei,juyangokok,monologue815,chen-linxin4,yu-xinjie62,jiang-lirui,Allan_Yu,tang-lei01,songkai111,liudan12,Wei_NaChuan,cc-z,kdy18482276080,xuchengyang,mabing1118,wangyongguang,guoqiuhao,Julius47 as approver
118 messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
10 days ago Added label: lgtm
cheng_zhiwei
cheng_zhiweiCollaborators
10 days ago Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
10 days ago Added label: approved
CANN-robotCANN-robotCollaborators
10 days ago Closed associated issue
CANN-robotCANN-robotCollaborators
10 days ago Merged pull request