Merged
refactor(moe_gating_top_k): hash模式拆分为独立kernel模板MoeGatingTopKHashRegbase #15062
CPZhouAdd on 8 days ago
refactor(moe_gating_top_k): hash模式拆分为独立kernel模板MoeGatingTopKHashRegbase #15062
Merged
Pull Request has been successfully merged by CANN-robot.
(Thank you for CPZhou's contribution.)8 days ago Added label: cann-cla/yes
CANN-robot
8 days ago Comments:
8 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 |
|---|---|---|
| moe | ✅ cpy_123456, guoqiuhao (2/2) | ✅ cpy_123456 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
ZhouChuping, thanks for your pull request. All authors of the commits have signed the CLA. 👍


8 days ago Set cpy_123456,cheng_zhiwei,juyangokok,monologue815,chen-linxin4,yu-xinjie62,jiang-lirui,Allan_Yu,songkai111,liudan12,Wei_NaChuan,cc-z,kdy18482276080,xuchengyang,mabing1118,guoqiuhao,Julius47 as approver
8 days ago Set cpy_123456,cheng_zhiwei,juyangokok,monologue815,chen-linxin4,yu-xinjie62,jiang-lirui,Allan_Yu,songkai111,liudan12,Wei_NaChuan,cc-z,kdy18482276080,xuchengyang,mabing1118,guoqiuhao,Julius47 as approver
8 days ago Set cpy_123456,cheng_zhiwei,juyangokok,monologue815,chen-linxin4,yu-xinjie62,jiang-lirui,Allan_Yu,songkai111,liudan12,Wei_NaChuan,cc-z,kdy18482276080,xuchengyang,mabing1118,guoqiuhao,Julius47 as approver
8 days ago Set cpy_123456,cheng_zhiwei,juyangokok,monologue815,chen-linxin4,yu-xinjie62,jiang-lirui,Allan_Yu,songkai111,liudan12,Wei_NaChuan,cc-z,kdy18482276080,xuchengyang,mabing1118,guoqiuhao,Julius47 as approver
CPZhou
8 days ago Comments:
8 days ago Comments:
/compile


8 days ago Pre merge succeeded (commit_id: 554b3cc8c066e051ee2c1db9124eeff08408d9f3)
CANN-robot
8 days ago Comments:
8 days ago Comments:
| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


8 days ago Added label: ci-pipeline-running
8 days ago Removed label: ci-pipeline-running
8 days ago Added label: ci-pipeline-passed
CPZhou
2 days ago Comments:
2 days ago Comments:
/compile


2 days ago Pre merge succeeded (commit_id: 26dd8584843c95f422bf05b0b1b317b0aa2a351b)
CANN-robot
2 days ago Comments:
2 days ago Comments:
| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


2 days ago Removed label: ci-pipeline-passed
2 days ago Added label: ci-pipeline-running
2 days ago Modify description of pull request
2 days ago Removed label: ci-pipeline-running
2 days ago Added label: ci-pipeline-passed
2 days ago Modify description of pull request
2 days ago Set as a draft.
2 days ago Draft state has been cancelled
cpy_123456
2 days ago Comments:
2 days ago Comments:
/lgtm
/approve


2 days ago Added label: lgtmapproved
2 days ago Closed associated issue
2 days ago Merged pull request
描述
hash 模式与 group-normal TopK 路径此前耦合在同一个 kernel 模板
MoeGatingTopKRegbase中(原因详见关联 Issue)。本 PR 将 hash 模式拆分为独立 kernel 模板:op_kernel/arch35/moe_gating_top_k_hash_regbase.h:MoeGatingTopKHashRegbase<T, IDXT, EIDXT>,继承精简后的MoeGatingTopKRegbase<T>,复用输入拷贝 / 归一化 / CopyOut 公共通路,新增inputIds/tid2eid哈希查表专属逻辑;op_kernel/arch35/moe_gating_top_k_regbase.h:移除 hash 相关分支与仅 hash 路径使用的模板参数,仅保留 group-normal TopK 路径;op_kernel/moe_gating_top_k_apt.cpp:TILING_KEY_HASH_*4 种 tiling key(int32/int32、int32/int64、int64/int64、int64/int32)全部改为实例化MoeGatingTopKHashRegbase,TILING_KEY_REGBASE保持MoeGatingTopKRegbase不变。关联的Issue
关联Issue #7201
测试
TTK kernel 模式真机(Ascend950DT)动态编译执行 + golden 精度比对(用例取自
moe/moe_gating_top_k/tests/st/arch35/moe_gating_top_k.csv,golden 插件moe/moe_gating_top_k/tests/assets/golden.py):inputIds/tid2eid四种 dtype 组合、对齐/非对齐 expert 数、softmax/sigmoid/softplus 归一化、renorm、无 bias、out_flag、fp16/bf16/fp32、k=1/8/64、8192 行大 shape,全部通过;文档更新
无
类型标签