Pull Request has been successfully merged by CANN-robot.
(Thank you for zhaoxinmeng's contribution.)变更摘要
本 PR 针对 xlogy 算子 Tiling 入口(XlogyTiling::GetShapeInfo)补充两道参数校验,属于静态扫描 GEIR.07/1 与 CODE.04/1 的代码侧整改,仅改动 math/xlogy/op_host/arch35/xlogy_tiling_arch35.cpp 一个文件。变更在读取输入描述后新增输入 dtype 一致性校验,并在计算广播后 rank_ 后新增 rank 上界校验,使不满足约束的输入在 tiling 阶段即返回 GRAPH_FAILED,与 README/DESIGN.md 中“x1 与 x2 数据类型必须相同”的约束以及 8 维模板支持范围保持一致。
主要改动
- 新增最大 rank 常量: 定义
kMaxRank = 8,作为RANK_8D模板支持的最大 rank 上界,供校验逻辑引用。 - 输入 dtype 一致性校验: 在
GetShapeInfo中获取第 1 个输入描述并做空指针校验,比较x1与x2的GetDataType(),不一致时通过OP_LOGE_FOR_INVALID_DTYPES_WITH_REASON输出两者实际 dtype 并返回GRAPH_FAILED。 - rank 上界校验: 在
PadAndSqueeze计算得到max_bro_shape_与rank_之后判断rank_ > kMaxRank,超限时通过OP_LOGE_FOR_INVALID_SHAPEDIM_WITH_REASON报出实际 rank 与[0, 8]约束并返回GRAPH_FAILED,避免后续以负下标写入TilingData。
🧩 本次 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 |
|---|---|---|
| repo-cann/ops-math | ✅ xuejinghui, 顾宝成 (2/2) | ✅ 顾宝成, xuejinghui (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
zhaoxinmeng, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


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


流水线分析报告 — ops-math run#6778
流水线: https://gitcode.com/CANN/ops-math/actions/runs/191a7eb85ed6411baa95c24da50677ea | PR#7110 | 2026-11-05 16:56:56 ~ 2026-11-05 17:04:08 | 失败 Job 1 个
定界结论: 代码问题 / 代码检查错误(clang-format + OAT 许可证头)
- 失败类型: 代码问题
- 根因:
CodeCheck_precommit中两项 pre-commit 检查不通过clang-format: 2 个文件被格式化工具判定需改动OAT Compliance Check: 1 个文件 License Header 不合规
- 处置建议: 通知 PR 提交者本地修复后重新推送,参考 本地执行 pre-commit 指导
- 排除项: 其余 pre-commit 钩子(trim trailing whitespace、fix end of files、check yaml、large files、merge conflicts、private key、codespell)均 Passed/Skipped;无平台/环境类错误
失败根因分析
根因 #1: 代码问题 / 代码检查错误 — clang-format 格式不符
- 判据: pre-commit hook
clang-formatFailed,files were modified by this hook - 定位步骤:
3_precommit.log - 影响 Job: CodeCheck_precommit
- 根因证据(日志原文):
clang-format.............................................................Failed
- hook id: clang-format
- files were modified by this hook
Formatting [1/2] math/xlogy/op_host/arch35/xlogy_tiling_arch35.cpp
Formatting [2/2] math/xlogy/tests/ut/op_host/arch35/test_xlogy_tiling_arch35.cpp
- 修复:
pre-commit run clang-format --files math/xlogy/op_host/arch35/xlogy_tiling_arch35.cpp math/xlogy/tests/ut/op_host/arch35/test_xlogy_tiling_arch35.cpp,提交格式化结果
根因 #2: 代码问题 / 代码检查错误 — OAT License Header Invalid
- 判据: pre-commit hook
oat-checkexit code 1,License Header Invalid Total Count: 1 - 定位步骤:
3_precommit.log - 影响 Job: CodeCheck_precommit
- 根因证据(日志原文):
OAT Compliance Check.....................................................Failed
- hook id: oat-check
- exit code: 1
[OAT] Found 1 compliance issue(s):
- Invalid File Type: 0
- License Header Invalid: 1
Name: License Header Invalid Content: InvalidLicense Line: 0 Project: ops-math File: math/xlogy/tests/ut/op_host/arch35/test_xlogy_tiling_arch35.cpp
- 修复: 为
math/xlogy/tests/ut/op_host/arch35/test_xlogy_tiling_arch35.cpp补齐社区规范的 License Header,本地执行pre-commit run oat-check验证通过后提交
结构化定界摘要
[{"repo": "ops-math", "run_number": 6778, "Failed_Type": "代码问题", "Failed_Sub_Type": "代码检查错误", "Failed_Reason": "clang-format 检查不通过,xlogy_tiling_arch35.cpp 与 test_xlogy_tiling_arch35.cpp 需格式化", "evidence": "clang-format.............................................................Failed / - files were modified by this hook / Formatting [1/2] math/xlogy/op_host/arch35/xlogy_tiling_arch35.cpp", "suggestion": "本地执行 pre-commit run clang-format 并提交格式化结果", "jobs": "CodeCheck_precommit"},
{"repo": "ops-math", "run_number": 6778, "Failed_Type": "代码问题", "Failed_Sub_Type": "代码检查错误", "Failed_Reason": "OAT 检查发现 test_xlogy_tiling_arch35.cpp License Header Invalid", "evidence": "OAT Compliance Check.....Failed / License Header Invalid Total Count: 1 / File: math/xlogy/tests/ut/op_host/arch35/test_xlogy_tiling_arch35.cpp", "suggestion": "补齐该文件 License Header,本地执行 pre-commit run oat-check 验证", "jobs": "CodeCheck_precommit"}]
由门禁失败定界分析自动生成 | repo: ops-math | run: 191a7eb85ed6411baa95c24da50677ea | PR#7110


compile


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


/approve


/lgtm
/approve
by agent


描述
为 Xlogy 算子 Tiling 入口补充两道参数校验(静态扫描 CODE.04/1 与 GEIR.07/1 的 tiling 侧整改),并补齐 Tiling UT,共 2 个文件(+204 行):
GetShapeInfo补 x1/x2 dtype 一致性校验,不一致返回 GRAPH_FAILED(OP_LOGE_FOR_INVALID_DTYPES_WITH_REASON,对齐 add_v2 同款写法),兑现 DESIGN.md 承诺与 README 约束kMaxRank常量,OP_LOGE_FOR_INVALID_SHAPEDIM_WITH_REASON),消除delta = R - rank_为负时 max_bro_shape 等以负下标写 TilingData、split.axis 错位的静态隐患tests/ut/op_host/arch35/test_xlogy_tiling_arch35.cpp8 个用例(dtype 混合拒绝×2、rank 越界拒绝×2、正常成功×3、不支持 dtype 拒绝×1),填补该算子无 tiling UT 的空白关联的Issue
#4549
测试
-b release -d true(binary复用,ge.jit_compile=0):APT 拦截被绕过,rank=9 直达 Tiling,由本次新增校验拦截(EZ0012: input rank must be within [0, 8])——证明该校验为 binary 复用模式下的实际必需防线文档更新
无(纯代码与 UT)
类型标签