Pull Request has been successfully merged by CANN-robot.
(Thank you for CPZhou's contribution.)变更摘要
本 PR 针对 moe_gating_top_k 算子在 arch35 上的 regbase 实现,将 Sigmoid 计算中的 1 / (1 + exp(-x)) 除法由显式指定的 DivSpecificMode(MaskMergeMode::ZEROING 且开启特定模式标志)改为不指定模式的默认 Reg::Div,以对齐 aclnnSigmoid 的舍入口径,使算子间数值结果保持一致。
主要改动
- 统一 Sigmoid 除法模式: 在
moe_gating_top_k_regbase.h的SigmoidWithBias与SigmoidWithoutBias中,Reg::Div不再使用<float, &mode>模板参数,改为调用默认模式的Reg::Div,同时删除文件内的mode常量定义,使带偏置与不带偏置两条路径的 Sigmoid 结果与aclnnSigmoid舍入行为对齐。 - E/K 全载分支同步调整: 在
moe_gating_top_k_e_k_fullload_regbase.h的ComputeX中,删除常量EK_DIV_MODE并将 Sigmoid 除法改为默认Reg::Div,使全载场景的归一化输出口径与其他分支一致。 - 无分组分支同步调整: 在
moe_gating_top_k_without_group_regbase.h中删除常量WG_DIV_MODE,ComputeNormSigmoid与ProcessSingleExpertSigmoid(单专家回退路径)的 Sigmoid 除法均改为默认Reg::Div,保证无分组实现各路径与其他实现数值一致。
🧩 本次 Review 已使用自定义 Skill:


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. 👍


/compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


其余gatingTopK & v2算子是否涉及


/approve
/lgtm


The MR can not be merged, because of CodeReview discussion not resolved
If you want to solve this problem, you can click here to do it in the FAQs.


描述
sigmoid除法改为默认模式,对齐aclnnSigmoid舍入口径
关联的Issue
#6944
测试
已通过冒烟测试
文档更新
不涉及
类型标签