Merged
docs: 修正 matrix_diag 文件头注释与头文件保护注释 #6600
TangPCAdd on 19 days ago
docs: 修正 matrix_diag 文件头注释与头文件保护注释 #6600
Merged
Pull Request has been successfully merged by CANN-robot.
(Thank you for TangPC's contribution.)atomgit-bot
19 days ago Comments:
19 days ago Comments:
变更摘要
本次变更仅修改注释,用于修正源文件中的标识性注释与实际文件名、保护宏不一致的问题,不涉及业务逻辑、接口行为或配置默认值的变化。改动覆盖 conversion/im2col 与 conversion/matrix_diag 两个模块的头部注释与结尾注释。
主要改动
im2col内核文件注释修正:conversion/im2col/op_kernel/arch35/im2col_norm_NHWC.h的\file注释由im2col_nhwc_normal.h更正为实际文件名im2col_norm_NHWC.h。matrix_diag图推导文件注释修正:conversion/matrix_diag/op_graph/matrix_diag_graph_infer.cpp的\file注释由matrix_diag_infershape.cpp更正为实际文件名matrix_diag_graph_infer.cpp。matrix_diagTiling 头文件保护宏注释修正:conversion/matrix_diag/op_host/matrix_diag_tiling_arch35.h的#endif尾注释由OPS_BUILT_IN_OP_TILING_RUNTIME_MATRIX_DIAG_TILING_H_更正为实际保护宏OPS_MATH_CONVERSION_MATRIX_DIAG_OP_HOST_MATRIX_DIAG_TILING_ARCH35_H_。matrix_diag切片内核头文件注释修正:matrix_diag_scatter_high_slice_batch.h与matrix_diag_scatter_high_slice_yUB.h的\file注释均由matrix_diag_big_n.h更正为各自实际文件名,便于按注释快速定位对应实现。
🧩 本次 Review 已使用自定义 Skill:


Incorrect?
atomgit-bot
19 days ago Comments:
19 days ago Comments:


Incorrect?
19 days ago Added label: cann-cla/yes
CANN-robot
19 days ago Comments:
19 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 |
|---|---|---|
| repo-cann/ops-math | ✅ 王林木, 张磊 (2/2) | ✅ 王林木, 张磊 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


CANN-robot
19 days ago Comments:
19 days ago Comments:
19 days ago Set FelixTang7,yue-ma,zhou-qilong,wangrui_,rxtfeng,loov1,zhangzijie,jia0liang,zl_hw,songkai111,chenxingyu18,llimwang,gubaocheng,andong_hw,xuejinghui,onanfield,zhanw_coding,clinglai0517 as approver
19 days ago Set FelixTang7,yue-ma,zhou-qilong,wangrui_,rxtfeng,loov1,zhangzijie,jia0liang,zl_hw,songkai111,chenxingyu18,llimwang,gubaocheng,andong_hw,xuejinghui,onanfield,zhanw_coding,clinglai0517 as approver
19 days ago Set FelixTang7,yue-ma,zhou-qilong,wangrui_,rxtfeng,loov1,zhangzijie,jia0liang,zl_hw,songkai111,chenxingyu18,llimwang,gubaocheng,andong_hw,xuejinghui,onanfield,zhanw_coding,clinglai0517 as approver
19 days ago Set FelixTang7,yue-ma,zhou-qilong,wangrui_,rxtfeng,loov1,zhangzijie,jia0liang,zl_hw,songkai111,chenxingyu18,llimwang,gubaocheng,andong_hw,xuejinghui,onanfield,zhanw_coding,clinglai0517 as approver
TangPC
19 days ago Comments:
19 days ago Comments:
compile


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


19 days ago Added label: ci-pipeline-running
19 days ago Removed label: ci-pipeline-running
19 days ago Added label: ci-pipeline-failed
19 days ago Pre merge succeeded (commit_id: ab0770fef02c72d7310ed73fc141e8fea0127f60)
CANN-robot
19 days ago Comments:
19 days ago Comments:
流水线分析报告 — ops-math run#5538
流水线: https://gitcode.com/CANN/ops-math/actions/runs/0e740db912be47109f35bade85cc2d80 | PR#6600 | 2026-10-22 15:58:45 ~ 2026-10-22 16:09:53 | 失败 Job 1 个
定界结论: 代码问题 / 代码检查错误 — pre-commit 格式检查不通过(clang-format 等 3 个 hook)
- 失败类型: 代码问题
- 根因: PR 代码未通过 pre-commit 格式检查:
clang-format需重排 5 个源文件格式,trailing-whitespace(行尾空白)与end-of-file-fixer(文件末尾换行)需修复im2col_norm_NHWC.h - 处置建议: 通知 PR 提交者修复——本地在仓库根目录执行
pre-commit run --all-files, 将 hook 自动修复后的文件提交并推送即可- 参考链接: 本地执行 pre-commit 指导
- 排除项(非环境/工程问题): 同 Job 内 codespell、OAT Compliance Check、check for added large files、check for merge conflicts、detect private key 均 Passed, pre-commit 环境初始化正常; 3 个失败 hook 均明确报
files were modified by this hook(确定性格式违规, 重试不会恢复)
失败根因分析
根因 #1: 代码问题 / 代码检查错误 — clang-format 等 3 个格式 hook 不通过, 5 个源文件需格式修复
- 判据: pre-commit 检查项不通过: clang-format(本地执行 pre-commit run clang-format 修复)
- 定位步骤:
3_precommit.log - 影响 Job: CodeCheck_precommit
- 根因证据(日志原文):
[2026-10-22 16:00:08.934+08:00] trim trailing whitespace.................................................Failed
[2026-10-22 16:00:08.934+08:00] - hook id: trailing-whitespace
[2026-10-22 16:00:08.934+08:00] - exit code: 1
[2026-10-22 16:00:08.934+08:00] - files were modified by this hook
[2026-10-22 16:00:08.934+08:00] Fixing conversion/im2col/op_kernel/arch35/im2col_norm_NHWC.h
[2026-10-22 16:00:08.934+08:00] fix end of files.........................................................Failed
[2026-10-22 16:00:08.934+08:00] - hook id: end-of-file-fixer
[2026-10-22 16:00:08.934+08:00] - exit code: 1
[2026-10-22 16:00:08.934+08:00] - files were modified by this hook
[2026-10-22 16:00:08.934+08:00] Fixing conversion/im2col/op_kernel/arch35/im2col_norm_NHWC.h
[2026-10-22 16:00:08.934+08:00] clang-format.............................................................Failed
[2026-10-22 16:00:08.934+08:00] - hook id: clang-format
[2026-10-22 16:00:08.934+08:00] - files were modified by this hook
[2026-10-22 16:00:08.934+08:00] Formatting [1/4] conversion/matrix_diag/op_graph/matrix_diag_graph_infer.cpp
[2026-10-22 16:00:08.934+08:00] Formatting [2/4] conversion/im2col/op_kernel/arch35/im2col_norm_NHWC.h
[2026-10-22 16:00:08.934+08:00] Formatting [3/4] conversion/matrix_diag/op_host/matrix_diag_tiling_arch35.h
[2026-10-22 16:00:08.934+08:00] Formatting [4/4] conversion/matrix_diag/op_kernel/arch35/matrix_diag_scatter_high_slice_batch.h
[2026-10-22 16:00:08.934+08:00] Formatting [1/1] conversion/matrix_diag/op_kernel/arch35/matrix_diag_scatter_high_slice_yUB.h
- 需格式修复的文件清单:
conversion/matrix_diag/op_graph/matrix_diag_graph_infer.cpp— clang-formatconversion/im2col/op_kernel/arch35/im2col_norm_NHWC.h— clang-format + 行尾空白 + 文件末尾换行conversion/matrix_diag/op_host/matrix_diag_tiling_arch35.h— clang-formatconversion/matrix_diag/op_kernel/arch35/matrix_diag_scatter_high_slice_batch.h— clang-formatconversion/matrix_diag/op_kernel/arch35/matrix_diag_scatter_high_slice_yUB.h— clang-format
- 修复方法: 本地执行
pre-commit run --all-files(hook 自动修复上述文件), 提交修复结果并推送后重新触发流水线
结构化定界摘要
[{"repo": "ops-math", "run_number": 5538, "Failed_Type": "代码问题",
"Failed_Sub_Type": "代码检查错误",
"Failed_Reason": "pre-commit 格式检查不通过: clang-format 需重排 5 个文件(matrix_diag_graph_infer.cpp/im2col_norm_NHWC.h/matrix_diag_tiling_arch35.h/matrix_diag_scatter_high_slice_batch.h/matrix_diag_scatter_high_slice_yUB.h), im2col_norm_NHWC.h 另有行尾空白与文件末尾换行问题",
"evidence": "clang-format.............................................................Failed - files were modified by this hook Formatting [1/4] conversion/matrix_diag/op_graph/matrix_diag_graph_infer.cpp",
"suggestion": "通知 PR 提交者本地执行 pre-commit run --all-files 修复格式后重新提交推送",
"jobs": "CodeCheck_precommit"}]
由门禁失败定界分析自动生成 | repo: ops-math | run: 0e740db912be47109f35bade85cc2d80 | PR#6600


6 event messages are collapsed here。 See more
19 days ago Modify description of pull request
TangPC
19 days ago Comments:
19 days ago Comments:
compile


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


19 days ago Removed label: ci-pipeline-failed
5 event messages are collapsed here。 See more
19 days ago Modify description of pull request
19 days ago Added label: approved
18 days ago Added label: lgtm
18 days ago Closed associated issue
18 days ago Merged pull request
描述
修正
conversion/matrix_diag下多处注释与实际代码不一致的问题,并同步修正一处 clang-format 格式问题:conversion/matrix_diag/op_graph/matrix_diag_graph_infer.cpp:\file注释由matrix_diag_infershape.cpp修正为matrix_diag_graph_infer.cpp。conversion/matrix_diag/op_host/matrix_diag_tiling_arch35.h:#endif尾注释由OPS_BUILT_IN_OP_TILING_RUNTIME_MATRIX_DIAG_TILING_H_修正为实际保护宏OPS_MATH_CONVERSION_MATRIX_DIAG_OP_HOST_MATRIX_DIAG_TILING_ARCH35_H_;同时按仓库 pre-commit 规则修正MatrixDiagTiling构造函数初始化列表后的空格格式。conversion/matrix_diag/op_kernel/arch35/matrix_diag_scatter_high_slice_batch.h:\file注释由matrix_diag_big_n.h修正为matrix_diag_scatter_high_slice_batch.h。conversion/matrix_diag/op_kernel/arch35/matrix_diag_scatter_high_slice_yUB.h:\file注释由matrix_diag_big_n.h修正为matrix_diag_scatter_high_slice_yUB.h。说明:
conversion/im2col/op_kernel/arch35/im2col_norm_NHWC.h的\file注释未在本 PR 修复。该文件存在既有的大范围 clang-format 差异(约 169 行),应用会引入与本 PR 无关的大规模格式变更,已留待单独处理。改动不涉及业务逻辑、接口行为或配置默认值,仅修正注释内容与格式。
关联的Issue
测试
文档更新
本次仅修正源码中的文件头注释与头文件保护宏尾注释,无独立文档文件更新。
类型标签