Merged
fix: 修复 GetShape infershape UT 多输入用例的 NodeIoNum 声明冲突 #7022
tan_xinAdd on 8 days ago
fix: 修复 GetShape infershape UT 多输入用例的 NodeIoNum 声明冲突 #7022
Merged
tan_xinAdd on 8 days ago
tan_xinCollaborators
8 days ago

描述

修复 math/get_shape/tests/ut/op_host/test_get_shape_infershape.cpp 中多输入用例的 NodeIoNum 声明冲突:

  • TwoInputs_2D_And_3D(2 输入)与 MultipleDtypes(3 输入)两个用例原带 .NodeIoNum(1, 1),声明 node 仅 1 输入 1 输出,与 IrInstanceNum({2}/{3}, {1}) 设置的多输入矛盾,导致 UT 失败。
  • 移除这两个用例中的 .NodeIoNum(1, 1),使其与实际输入个数一致;单输入用例(SingleInput_3D_Tensor / ScalarInput_Fail / VectorInput)不受影响,保留原声明。

关联的Issue

关联 Issue #4417

测试

  • get_shape infershape UT 全部用例通过(含多输入 2D/3D 与多 dtype 场景)。

文档更新

NA

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for tan_xin's contribution.)
Ttan_xinCollaborators
8 days ago Created pull request, commit f3d1bc81
atomgit-bot
atomgit-bot
8 days ago Comments:

变更摘要

本 PR 修复 math/get_shape/tests/ut/op_host/test_get_shape_infershape.cpp 中 GetShape 算子 InferShape 单元测试的用例声明冲突:多输入用例原先通过 .NodeIoNum(1, 1) 声明节点只有 1 个输入、1 个输出,与随后 .IrInstanceNum({2}, {1}) / .IrInstanceNum({3}, {1}) 设定的多输入实例数量相互矛盾,导致 UT 失败。改动通过移除这些多余的 IO 数量声明,使节点 IO 描述与实际输入个数保持一致。

主要改动

  • TwoInputs_2D_And_3D 用例移除冲突声明: 删除该 2 输入用例中的 .NodeIoNum(1, 1),使其 IO 声明与 .IrInstanceNum({2}, {1}) 一致。
  • MultipleDtypes 用例移除冲突声明: 删除该 3 输入用例中的 .NodeIoNum(1, 1),使其 IO 声明与 .IrInstanceNum({3}, {1}) 一致。
  • 单输入用例声明保持不变: SingleInput_3D_Tensor、ScalarInput_Fail、VectorInput 等单输入用例仍保留原有 NodeIoNum 声明,改动范围仅限多输入场景。

🧩 本次 Review 已使用自定义 Skill:

likedislike
Incorrect?
atomgit-bot
atomgit-bot
8 days ago Comments:

代码审查

✅ 未发现问题


🧩 本次 Review 已使用自定义 Skill:

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
8 days ago Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
8 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 ✅ zhanw_coding, 宋恺 (2/2) ✅ zhanw_coding (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robotCollaborators
8 days ago Set yue-ma,zhou-qilong,wangrui_,rxtfeng,loov1,zhangzijie,jia0liang,zl_hw,songkai111,chenxingyu18,pingchuantang,llimwang,gubaocheng,andong_hw,xuejinghui,onanfield,zhanw_coding,jiangjiawei,clinglai0517 as approver
CANN-robotCANN-robotCollaborators
8 days ago Set yue-ma,zhou-qilong,wangrui_,rxtfeng,loov1,zhangzijie,jia0liang,zl_hw,songkai111,chenxingyu18,pingchuantang,llimwang,gubaocheng,andong_hw,xuejinghui,onanfield,zhanw_coding,jiangjiawei,clinglai0517 as approver
tan_xinCollaborators
8 days ago Comments:

compile

likedislike
Ttan_xinCollaborators
8 days ago Pre merge succeeded (commit_id: 2987233ca77f63903df2b0d399a46b48cc053f2c)
CANN-robot
CANN-robotCollaborators
8 days ago Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
8 days ago Added label: ci-pipeline-running
10 event messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
8 days ago Removed label: ci-pipeline-passed
CANN-robot
CANN-robotCollaborators
8 days ago Comments:

Notification

This pull request has been changed(code update) or closed, so removes the following label(s): ci-pipeline-passed.

likedislike
tan_xinCollaborators
8 days ago Comments:

compile

likedislike
Ttan_xinCollaborators
8 days ago Pre merge succeeded (commit_id: b19ce8f3760ef9f2ec3622354f5065ab5b5753e3)
CANN-robot
CANN-robotCollaborators
8 days ago Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
8 days ago Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
8 days ago Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
8 days ago Added label: ci-pipeline-failed
CANN-robot
CANN-robotCollaborators
8 days ago Comments:

流水线分析报告 — ops-math run#6486

流水线: https://gitcode.com/CANN/ops-math/actions/runs/dc5ccd6750a94544a2e5197fd4473948 | PR#7022 | 2026-11-02 20:52:55 ~ 2026-11-02 20:57:22 | 失败 Job 10 个

定界结论: 代码问题x2(共 2 个根因)

根因 #1(代码问题 / 编译错误)

  • 根因: PR 在 math/sinc/op_api/aclnn_sinc.cpp 中新增了 isRegbase() 调用, 但该符号未声明/未包含定义它的头文件, 编译报 'isRegbase' was not declared in this scope, 导致 opapi_math 目标编译中断。
  • 处置: 通知 PR 提交者修复: 补充 isRegbase() 的声明与对应头文件(若来自新版 CANN 接口, 需加版本兼容守卫), 或删除该调用恢复原判断逻辑。
  • 影响 Job: Compile_Ascend_X86_ubuntu24, Compile_Ascend_X86_mobile_station_ubuntu24, Compile_X86_monitor_910b, Compile_X86_monitor_910c, Compile_X86_monitor_950, Compile_Ascend_X86_mobile_station_9030_ubuntu24, Compile_Ascend_ARM_ubuntu24, Compile_Ascend_single_ubuntu24, Compile_Ascend_single

根因 #2(代码问题 / 代码检查错误)

  • 根因: pre-commit 的 clang-format 检查不通过, 涉及 PR 本次变更的 2 个文件。
  • 处置: 通知 PR 提交者本地执行 pre-commit run clang-format --files <文件> 修复格式后重推。
  • 影响 Job: CodeCheck_precommit

排除项

  • 日志中的 CUDA_TOOLKIT_ROOT_DIR not found or specified 属于 CMake 探测 CUDA 的常规提示(紧随其后为 Could NOT find CUDA ..., 且为可选项), 不是失败原因。报出该提示的 2 个 Job 实际失败点同样是 aclnn_sinc.cpp 编译错误, 已并入根因 #1。
  • 未发现 PR 冲突或取码类失败; 无平台内部错误干扰。

失败根因分析

根因 #1: 代码问题 / 编译错误 — math/sinc/op_api/aclnn_sinc.cpp:57 'isRegbase' 未声明
  • 判据: 源文件编译报错(C++ 符号未声明)
  • 定位步骤: 3_compile_acc.log
  • 影响文件: math/sinc/op_api/aclnn_sinc.cpp:57
  • 影响 Job: 9 个编译 Job(见上), 全部同一错误, 属同因聚合
  • 根因证据(日志原文):
aclnn_sinc.cpp: In function 'bool CheckSocVersionIsSupportBf16()':
aclnn_sinc.cpp:57:82: error: 'isRegbase' was not declared in this scope
   57 |            GetCurrentPlatformInfo().GetSocVersion() <= SocVersion::ASCEND910E)|| isRegbase();
      |                                                                                  ^~~~~~~~~
gmake[3]: *** [.../aclnn_sinc.cpp.o] Error 1
gmake: *** [Makefile:4753: opapi_math] Error 2
::error::构建命令执行失败,退出码: 2
  • 与 PR 变更的对应关系: PR#7022 对 math/sinc/op_api/aclnn_sinc.cpp 的改动正是把原地判断改写为
    ... <= SocVersion::ASCEND910E)|| isRegbase();(新增 isRegbase()), 该符号在全仓无声明, 编译必然失败。确定性错误, 重跑无法恢复。
根因 #2: 代码问题 / 代码检查错误 — clang-format 未通过(2 个变更文件)
  • 判据: pre-commit 检查项不通过: clang-format
  • 定位步骤: 3_precommit.log
  • 影响文件: math/get_shape/tests/ut/op_host/test_get_shape_infershape.cpp、math/sinc/op_api/aclnn_sinc.cpp
  • 影响 Job: CodeCheck_precommit
  • 根因证据(日志原文):
clang-format.............................................................Failed
Formatting [1/2] math/get_shape/tests/ut/op_host/test_get_shape_infershape.cpp
Formatting [2/2] math/sinc/op_api/aclnn_sinc.cpp
::error::precommit.py 异常退出: exit code=1, signal=null
  • 说明: 两个文件均为 PR#7022 本次变更文件; 其中 aclnn_sinc.cpp 的 )|| (缺空格)本身也是格式问题, 与根因 #1 同一处改动, 一次修复可同时解决。
结构化定界摘要
[
  {
    "repo": "ops-math",
    "run_number": 6486,
    "Failed_Type": "代码问题",
    "Failed_Sub_Type": "编译错误",
    "Failed_Reason": "PR 在 math/sinc/op_api/aclnn_sinc.cpp 中新增未声明的 isRegbase() 调用, 第 57 行编译报错 'isRegbase' was not declared, 导致 opapi_math 编译中断, 9 个编译 Job 同因失败",
    "evidence": "aclnn_sinc.cpp:57:82: error: 'isRegbase' was not declared in this scope",
    "suggestion": "补充 isRegbase() 的声明与头文件(必要时加版本兼容守卫), 或删除该调用恢复原逻辑后重推",
    "jobs": "Compile_Ascend_X86_ubuntu24, Compile_Ascend_X86_mobile_station_ubuntu24, Compile_X86_monitor_910b, Compile_X86_monitor_910c, Compile_X86_monitor_950, Compile_Ascend_X86_mobile_station_9030_ubuntu24, Compile_Ascend_ARM_ubuntu24, Compile_Ascend_single_ubuntu24, Compile_Ascend_single"
  },
  {
    "repo": "ops-math",
    "run_number": 6486,
    "Failed_Type": "代码问题",
    "Failed_Sub_Type": "代码检查错误",
    "Failed_Reason": "pre-commit 的 clang-format 检查未通过, 涉及 PR 变更文件 test_get_shape_infershape.cpp 与 aclnn_sinc.cpp",
    "evidence": "clang-format.............................................................Failed",
    "suggestion": "本地执行 pre-commit run clang-format 修复两个文件的格式后重推",
    "jobs": "CodeCheck_precommit"
  }
]

由门禁失败定界分析自动生成 | repo: ops-math | run: dc5ccd6750a94544a2e5197fd4473948 | PR#7022

likedislike
Ttan_xinCollaborators
8 days ago Pre merge succeeded (commit_id: ec59e62e78dafe57d58be92244ae240e88d6df71)
Ttan_xinCollaborators
8 days ago Force-pushed 1 commits:8a2f81f1-sinc
Ttan_xinCollaborators
8 days ago Pre merge succeeded (commit_id: fe48f0416f31947ea7d1e790e8bf6e9a0b3e5232)
CANN-robotCANN-robotCollaborators
8 days ago Removed label: cann-cla/yes
tan_xinCollaborators
8 days ago Comments:

compile

likedislike
CANN-robotCANN-robotCollaborators
8 days ago Added label: cann-cla/yes
Ttan_xinCollaborators
8 days ago Pre merge succeeded (commit_id: 195aa7b48df7a3e32a34a028d4289ab090e6acc4)
CANN-robot
CANN-robotCollaborators
8 days ago Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
8 days ago Removed label: ci-pipeline-failed
CANN-robotCANN-robotCollaborators
8 days ago Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
8 days ago Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
8 days ago Added label: ci-pipeline-passed
chenyifengCollaborators
7 days ago Comments:

您好,PR已满足合入指标,请尽快联系Committer进行合入。如暂时不需要合入,请在PR标题前加[WIP]

likedislike
zhanw_coding
zhanw_codingCollaborators
7 days ago Comments:

/lgtm
/approve

likedislike
CANN-robotCANN-robotCollaborators
7 days ago Added label: approved
songkai111Collaborators
7 days ago Comments:

/lgtm

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