Merged
fix(pre-commit): 全仓OAT合规整改——许可证/版权头存量修复与豁免策略对齐 #13363
fix(pre-commit): 全仓OAT合规整改——许可证/版权头存量修复与豁免策略对齐 #13363
Merged
景明Add on Oct 7
景明
景明Collaborators
Oct 7

关联Issue https://gitcode.com/cann/ops-transformer/issues/5885

描述

全仓 OAT 合规整改(pre-commit run oat-check --all-files 从 200 条问题清零):

1. OAT.xml 豁免策略对齐(仅新增 6 行 filteritem,零删除):

  • experimental/.*:孵化目录豁免 license/copyright/binary 三类检查(含 swiglu_gated_mlp 等第三方 Apache-2.0 双版权贡献代码,策略上不归管)
  • *.jpg:文档图片豁免二进制拦截(与已有 *.png 一致)
  • LICENSE:许可证正文本身,豁免许可证头检查
  • Third_Party_Open_Source_Software_Notice:第三方声明文件,豁免版权头检查

2. 文件头修复(167 个源文件):

  • 旧版许可证头(redistribute it and/or modify. 句式,2026-03 入库、04-03 OAT 上线前时间差遗留)→ 标准 CANN V2 头
  • 变体错别字:Copyend (c)、You can not use、in in compliance、free software; 分号、CANN 1.0 许可证等
  • 无头文件补标准头(如 golden.py、executor_aclnnMoeFusedTopk.py)
  • 版权年保留各文件原有年份;CRLF/混合行尾文件逐字节保持原行尾,diff 仅头部

3. 历史遗留原因:存量问题多经网页端合并(不触发本地钩子)或 OAT 上线前入库积累。

验证

  • pre-commit run oat-check --all-files:9 个批次全部 0 issue,Passed
  • git pc HEAD~1 + 显式 pre-commit run --files 复核收敛,第 2 笔为 clang-format/ruff/end-of-files 自动修复
  • py/sh 语法、OAT.xml XML 合法性校验通过

基线 master:d9d81a50a

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for 景明's contribution.)
景明景明Collaborators
Oct 7 Created pull request, commit 92ca3ea4
atomgit-bot
atomgit-bot
Oct 7 Comments:

变更摘要

本 PR 修复 A5 FullMesh dispatch 路径回读 expert_scales 时的步长换算问题。在 mc2/moe_distribute_dispatch_v2/op_kernel/arch35/moe_distribute_dispatch_v2_a5_full_mesh.h 中,MoeDistributeDispatchV2A5FullMesh::CopyInAndOut 构造 DataCopyExtParams expertScaleCopyInParams 时,srcStride 的单位应为 32B(UB_ALIGN),但此处直接填入了字节数,与同函数内 scales、token、expandIdx 三处搬移的处理方式不一致。改动将步长按 (hCommuSize_ - sizeof(float)) / UB_ALIGN 换算为 32B 块数,使 GM→UB 回读的相邻 token 间隔与实际槽位布局匹配,避免 arriveCount≥2 时越出本 expert 槽及已注册通信窗口导致的 device 侧 AI Core 异常。该修正仅涉及单行常量计算,不改变数据布局与语义,影响范围为 A5 FullMesh 且传入 expertScales 的场景。

主要改动

  • 修正 expert_scales 回读步长单位: expertScaleCopyInParams 的 srcStride 由原始字节数 hCommuSize_ - sizeof(float) 改为 (hCommuSize_ - sizeof(float)) / UB_ALIGN,按 32B 块数表示。
  • 与同函数其余搬移的换算方式对齐: 使 expert_scales 的 srcStride 与 scales、token、expandIdx 等搬移一致采用 / UB_ALIGN,消除该分支的遗漏。
  • 影响范围限定: 仅调整 A5 FullMesh + expertScales(hasExpertScalesFlag_ 为真)路径的 GM→UB 回读步长常量,不改变数据布局与其他架构、量化路径。
likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Oct 7 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Oct 7 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
OAT.xml ✅ 马兵, 蒋礼锐, wang-minbo (3/2) ✅ 马兵, 蒋礼锐, wang-minbo (3/1)
*/*/op_api/aclnn*.h ✅ 马兵, 汤磊, 王永光, 蒋礼锐 (4/2) ✅ 汤磊, 王永光 (2/1)
*/*/op_host/*_def.cpp ✅ 汤磊, 王永光, 马兵, kdy18482276080, 蒋礼锐 (5/2) ✅ 汤磊, 王永光 (2/1)
attention ✅ 马兵, kdy18482276080, 蒋礼锐 (3/2) ✅ 蒋礼锐, 马兵, kdy18482276080 (3/1)
examples ✅ 马兵, 蒋礼锐, wang-minbo (3/2) ✅ wang-minbo, 马兵, 蒋礼锐 (3/1)
gmm ✅ 蒋礼锐, 马兵, kdy18482276080 (3/2) ✅ kdy18482276080, 蒋礼锐, 马兵 (3/1)
mc2 ✅ 蒋礼锐, wang-minbo, 马兵 (3/2) ✅ 蒋礼锐, wang-minbo, 马兵 (3/1)
mhc ✅ kdy18482276080, 马兵, 蒋礼锐 (3/2) ✅ kdy18482276080 (1/1)
moe ✅ 马兵, kdy18482276080, 蒋礼锐 (3/2) ✅ 马兵, kdy18482276080, 蒋礼锐 (3/1)
posembedding ✅ 马兵, kdy18482276080, 蒋礼锐 (3/2) ✅ 马兵, kdy18482276080, 蒋礼锐 (3/1)
scripts ✅ 马兵, 蒋礼锐, wang-minbo (3/2) ✅ 马兵, 蒋礼锐, wang-minbo (3/1)
sig-ops-transformer ✅ 蒋礼锐, 马兵 (2/2) ✅ 马兵, 蒋礼锐 (2/1)
tests ✅ 马兵, 蒋礼锐, wang-minbo (3/2) ✅ 马兵, 蒋礼锐, wang-minbo (3/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robot
CANN-robotCollaborators
Oct 7 Comments:

CLA Signature Pass

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

likedislike
62 messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
29 days ago Added label: lgtm
kdy18482276080Collaborators
29 days ago Comments:

/approve
/lgtm

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