已合并
docs(norm): 修正 6 个 aclnn 算子 A5 确定性计算描述 #8709
docs(norm): 修正 6 个 aclnn 算子 A5 确定性计算描述 #8709
已合并
HelloWord-LuXin创建于 6 天前
HelloWord-LuXin
HelloWord-LuXin成员
6 天前

修改内容

修正 aclnnBatchNorm、aclnnBatchNormElemt、aclnnBatchNormBackward、aclnnGroupNormBackward、aclnnRmsNormGrad、aclnnRmsNormGradQuant 六个算子文档中 A5(Ascend 950) 确定性计算描述与代码实际行为不符的问题。

close #4890

问题分析

原描述为「默认非确定性实现,支持通过 aclrtCtxSetSysParamOpt 开启确定性」,未区分芯片版本。代码核查表明:

A5(Ascend 950) 的 arch35/regbase kernel 使用 SyncAll 做核间同步,无 SetAtomicAdd;regbase tiling 不检查 GetDeterministic(),不读取 aclrtCtxSetSysParamOpt 设置。因此 A5 实际为默认确定性实现,且不支持通过 aclrtCtxSetSysParamOpt 开启确定性。

代码依据

算子 A5 GetDeterministic() A5 SetAtomicAdd A5 同步机制
aclnnBatchNorm SyncAll
aclnnBatchNormElemt 无跨核归约
aclnnBatchNormBackward SyncAll
aclnnGroupNormBackward 是(workspace写入) SyncAll+二分树归约
aclnnRmsNormGrad SyncAll
aclnnRmsNormGradQuant 无跨核归约

GroupNormBackward A5 虽使用 SetAtomicAdd 写 workspace,但 SPLIT_COUNT=2 保证每个 workspace slot 仅 2 个核写入,浮点加法交换律(a+b==b+a)保证结果确定;stage2 用 SyncAll + 二分树归约,最终输出无 atomic add。

修改方案

仅修改 A5(Ascend 950) 描述,区分芯片版本描述:

算子 A5 描述
aclnnBatchNorm → 默认确定性实现
aclnnBatchNormElemt → 默认确定性实现
aclnnBatchNormBackward → 默认确定性实现
aclnnGroupNormBackward → 默认确定性实现
aclnnRmsNormGrad → 默认确定性实现
aclnnRmsNormGradQuant → 默认确定性实现

涉及文件

  • norm/batch_norm_v3/docs/aclnnBatchNorm.md — 分架构描述,A5 改为默认确定性实现
  • norm/batch_norm_elemt/docs/aclnnBatchNormElemt.md — 分架构描述,A5 改为默认确定性实现
  • norm/batch_norm_grad_v3/docs/aclnnBatchNormBackward.md — 分架构描述,A5 改为默认确定性实现
  • norm/group_norm_grad/docs/aclnnGroupNormBackward.md — 分架构描述,A5 改为默认确定性实现
  • norm/rms_norm_grad/docs/aclnnRmsNormGrad.md — 分架构描述,A5 改为默认确定性实现
  • norm/rms_norm_grad_quant/docs/aclnnRmsNormGradQuant.md — 仅 A5 支持,改为默认确定性实现
  • docs/zh/op_api_list.md — 同步修正上述 6 个算子的 A5 列
likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 HelloWord-LuXin 的贡献)
HelloWord-LuXinHelloWord-LuXin成员
6 天前 创建了 pull request,commit ac2316ed
atomgit-bot
atomgit-bot
6 天前 评论:

变更摘要

本次 PR 主要修正 aclnnBatchNormaclnnBatchNormElemtaclnnBatchNormBackwardaclnnGroupNormBackward 四个算子文档中「确定性计算」描述与代码实际行为不符的问题。原描述称这些算子「默认非确定性实现,支持通过 aclrtCtxSetSysParamOpt 开启确定性」,但代码核查表明四个算子均不读取 aclrtCtxSetSysParamOpt 的设置,实际行为均为确定性实现。因此将相关文档及总览表格统一改为「默认确定性实现」,与 aclnnDynamicQuantV2aclnnAdaLayerNorm 等已有确定性算子的描述风格保持一致。

主要改动

  • 修正四个算子文档的确定性描述:将 aclnnBatchNormaclnnBatchNormElemtaclnnBatchNormBackwardaclnnGroupNormBackward 文档「约束说明 > 确定性计算」中原有的「默认非确定性实现,支持通过 aclrtCtxSetSysParamOpt 开启确定性」统一改为「默认确定性实现」。
  • 同步更新算子总览表格:将 docs/zh/op_api_list.md 中上述四个算子对应的条目统一改为「默认确定性实现」,保持文档间描述一致。
  • 明确移除与 aclrtCtxSetSysParamOpt 的关联:更新后的描述不再声称这些算子支持通过 aclrtCtxSetSysParamOpt 开启确定性,与代码中不读取该设置的实际行为保持一致。
likedislike
atomgit-bot
atomgit-bot
6 天前 评论:

🤖 本次改动均为数据 / 生成 / 二进制文件(如测试用例、锁文件、媒体资源),没有可审查的代码逻辑,已跳过 AI 代码审查。

likedislike
CANN-robotCANN-robot成员
6 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
6 天前 评论:

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.
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
*/*/docs/acl*.md 吴瑶, 陈娇 (2/2) 吴瑶, 陈娇 (2/1)
docs 吴瑶, 陈娇 (2/2) 吴瑶, 陈娇 (2/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
此处折叠了66条消息 查看更多
chenjiao成员
2 天前 评论:

/approve

likedislike
CANN-robotCANN-robot成员
2 天前 添加了label:lgtm
CANN-robotCANN-robot成员
2 天前 关闭了关联的issue
CANN-robotCANN-robot成员
2 天前 合入了pull request
CANN-robot
CANN-robot成员
2 天前 评论:

Pull Request 已合并或已关闭。

If you want to solve this problem, you can click here to do it in the FAQs.

likedislike