Closed
[Bug-Report|缺陷反馈]: moe_gating_top_k renorm归一化除法仅1ULP保真,未对齐realdiv舍入口径 #8853
CPZhouAdd on 2 days agoClosed at 2 days ago
2 days ago Added label: bug-report
周云飞
2 days ago Comments:
2 days ago Comments:
感谢反馈。您描述的 1 ULP 偏差及各分支的除法口径还需要进一步核实。
针对 arch35 的 Renorm 除法,可以考虑使用 PRECISION_0ULP_FTZ_TRUE 模式,并保留 sigmoid 自身除法的现有口径;还需确认该模式的 FTZ 行为、适用的 CANN 版本,以及各分支与 golden 的结果是否符合预期。您提供的关联 PR 已记录,其具体修改范围和状态仍待确认。


2 days ago Assign ZhouChuping as responsible person
2 days ago Close issue
2 days ago changed custom state from 待办的 to 已完成
2 days ago Added label: resolved
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
Describe the current behavior / 问题描述
moe_gating_top_k arch35(Ascend 950)各kernel路径中,Renorm归一化除法(Step5: yOut = gathered / (ReduceSum(gathered) + eps))使用缺省Reg::Div(DivAlgo::INTRINSIC),dav-3510上该档仅保真1ULP,与realdiv/numpy golden的正确舍入除法存在1ULP级偏差;且该除法散布在11个分支(align/NotAlign EVF、hash、top1快路、单专家sigmoid/softmax/softplus renorm等),任一路径口径不一致都会造成同shape不同分支精度不一致。
Environment Information / 环境信息
Steps to reproduce the issue / 重现步骤
Describe the expected behavior / 预期结果
Renorm归一化除法对齐realdiv的正确舍入口径(0ULP);sigmoid自身除法维持对齐aclnnSigmoid的缺省口径不变。
Related log / screenshot / 日志 / 截图
无(数值级1ULP偏差,可由精度比对复现)
Special notes for this issue/备注
修复方案:arch35各kernel统一显式启用
DivSpecificMode{MaskMergeMode::ZEROING, true, DivAlgo::PRECISION_0ULP_FTZ_TRUE}。
参考同仓先例:moe_gating_top_k_backward的div0UlpMode、moe_fused_topk的DivConfig 0ULP档、block_attn_res_prepare的BARP_DIV_0ULP_FTZ_TRUE_MODE。
关联 PR:https://gitcode.com/cann/ops-transformer/merge_requests/17298