Merged
fix(pooling): 修复 max_pool3_d geir example 在 ascend950 上运行失败问题 #13463
fix(pooling): 修复 max_pool3_d geir example 在 ascend950 上运行失败问题 #13463
Merged
陈晨Add on 19 days ago
陈晨
陈晨Collaborators
19 days ago

描述

问题

执行 bash build.sh --run_example max_pool3_d graph --example_name=max_pool_3d --soc=ascend950 失败,tiling 报错 MaxPool3D: output shape dim = 1, should be equal 5。

原因分析

arch35 示例存在三处缺陷,逐层暴露:

  1. ADD_INPUT 宏对 Data 节点缺少 update_output_desc_y 调用 → Data 输出描述为空 → 算子输出 shape 被置为标量,tiling 校验失败;
  2. 输入输出描述符使用 FORMAT_ND 且未设置 origin format → FE 编译期输出 desc 退化为 shape (1,), ori_shape ();
  3. 示例参数与内核语义不自洽:tiling 要求 ksize/strides 的 N/C 维为 1(NDHWC 约定),但输入 shape {4,1,4,4,6} 为 NCDHW 风格且未设置 data_format。

主要改动

  • examples/arch35/test_geir_max_pool_3d.cpp:补齐 update_output_desc_y;描述符改为 FORMAT_NDHWC 并设置 origin format;输入 shape 调整为 {4,4,4,4,6}(与输出 {4,1,1,3,6}、
    ksize/strides 按 NDHWC 语义完全自洽,已对照 infershape 与 tiling 公式逐一验证);显式设置 data_format="NDHWC"。
  • examples/test_geir_max_pool_3d.cpp:替换为与 arch35 一致的通用版本。原 910b 专用版(NDC1HWC0 存储格式,!7385 引入)在 ascend950 上因 TransData 不支持而必然失败,
    该版本保留在 git 历史中;且本算子在仓内无 arch22/910b 适配代码,故不新增 arch22 示例副本。

关联的Issue

https://gitcode.com/cann/ops-nn/issues/8015

测试

  • bash build.sh --run_example max_pool3_d graph --example_name=max_pool_3d --soc=ascend950 运行成功,顶层与 arch35 两个示例均通过(exit code 0)。

文档更新

类型标签

AI/Agent生成声明

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for 陈晨's contribution.)
陈晨陈晨Collaborators
19 days ago Created pull request, commit 29faa372
陈晨
陈晨Collaborators
19 days ago Comments:

/compile

likedislike
陈晨陈晨Collaborators
19 days ago Pre merge succeeded (commit_id: 75c3d247ea83e46f52c07ec090a2c3d9425d059c)
atomgit-bot
atomgit-bot
19 days ago Comments:

🤖 AI Code Review

⚠️ 审查未能完成

本次代码审查未能完成,可能是临时性故障。

你可以在评论区输入 /ai summary 重新发起审查。若多次失败,请联系管理员并附上下方追踪 ID。

追踪 ID: task-442876

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

🤖 AI Code Review

⚠️ 审查未能完成

本次代码审查未能完成,可能是临时性故障。

你可以在评论区输入 /ai review 重新发起审查。若多次失败,请联系管理员并附上下方追踪 ID。

追踪 ID: task-442877

likedislike
Incorrect?
CANN-robot
CANN-robotCollaborators
19 days ago Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
19 days ago Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
19 days ago Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
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
pooling ✅ 王星, 上官秦南 (2/2) ✅ 王星 (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robotCollaborators
19 days ago Set zengjuan,u010470851,Nice_try,chaotang233,kevin_huang1234,crystalhu,yangyang016,fanqirui,su-yueming,yourealize,chenqi317,wang-xing001,liubo75,tangweiwei2,chenxingyu18,pingchuantang,qianzehong,liuchuangdev as approver
CANN-robotCANN-robotCollaborators
19 days ago Set u010470851,Nice_try,kevin_huang1234,su-yueming,yourealize,wang-xing001,chenxingyu18,pingchuantang,qianzehong,liuchuangdev as approver
CANN-robotCANN-robotCollaborators
19 days ago Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
19 days ago Added label: ci-pipeline-failed
CANN-robot
CANN-robotCollaborators
19 days ago Comments:

流水线分析报告 — ops-nn run#16935

流水线: https://gitcode.com/cann/ops-nn/actions/runs/2fcdb71364c940a8b20fc93427caa005 | PR#13463 | 2026-11-03 10:42:23 ~ 10:45:50 | 失败 Job 1 个

定界结论: 代码问题 / 代码检查错误
  • 失败类型: 代码问题
  • 根因: pre-commit 检查项 clang-format 不通过,Hook 自动改写了 2 个 C++ 示例文件,说明提交代码未按仓库 .clang-format 格式化
  • 处置建议: 通知 PR 提交者修复
    • 本地执行 pre-commit run clang-format --files pooling/max_pool3_d/examples/arch35/test_geir_max_pool_3d.cpp pooling/max_pool3_d/examples/test_geir_max_pool_3d.cpp,将自动格式化结果一并提交后重新触发流水线
    • 参考链接: 本地执行 pre-commit 指导
  • 排除项: 同 Job 内 trim trailing whitespace / end-of-file-fixer / check large files / check merge conflicts / detect private key / codespell / OAT Compliance Check 均 Passed;check_yaml、check_json、ruff-check、ruff-format 因无匹配文件 Skipped,与本次失败无关。仅 CodeCheck_precommit 一个 Job 失败,无下游级联 Job 失败

失败根因分析

根因 #1: 代码问题 / 代码检查错误 — clang-format 未通过(2 个文件被改写)
  • 判据: pre-commit 检查项不通过: clang-format(本地执行 pre-commit run clang-format 修复)
  • 定位步骤: 3_precommit.log
  • 影响 Job: CodeCheck_precommit
  • 根因证据(日志原文):
clang-format.............................................................Failed
- hook id: clang-format
- files were modified by this hook

Formatting [1/2] pooling/max_pool3_d/examples/arch35/test_geir_max_pool_3d.cpp
Formatting [2/2] pooling/max_pool3_d/examples/test_geir_max_pool_3d.cpp
...
❌ 存在部分文件格式错误
::error::precommit.py 异常退出: exit code=1, signal=null
  • 说明: PR 分支 fix/max_pool3_d_geir_example_soc950 新增/修改的上述 2 个示例文件未按 .clang-format(配置为 --style=file --verbose -i)格式化。CI 只做检测不回写,需提交者本地执行 clang-format 后重新推送
结构化定界摘要
[{"repo": "ops-nn", "run_number": 16935, "Failed_Type": "代码问题", "Failed_Sub_Type": "代码检查错误", "Failed_Reason": "pre-commit 的 clang-format 检查未通过,pooling/max_pool3_d/examples/arch35/test_geir_max_pool_3d.cpp 与 pooling/max_pool3_d/examples/test_geir_max_pool_3d.cpp 未按 .clang-format 格式化,hook 改写了文件导致检查失败", "evidence": "clang-format.............................................................Failed / Formatting [1/2] pooling/max_pool3_d/examples/arch35/test_geir_max_pool_3d.cpp / Formatting [2/2] pooling/max_pool3_d/examples/test_geir_max_pool_3d.cpp", "suggestion": "本地执行 pre-commit run clang-format 修复上述 2 个文件并提交后重新触发流水线", "jobs": "CodeCheck_precommit"}]

由门禁失败定界分析自动生成 | repo: ops-nn | run: 2fcdb71364c940a8b20fc93427caa005 | PR#13463

likedislike
陈晨陈晨Collaborators
19 days ago Pre merge succeeded (commit_id: 2d5740b53c790538d1397e952d6e29eb48837294)
9 event messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
19 days ago Removed label: stat/needs-squash
CANN-robot
CANN-robotCollaborators
19 days ago Comments:

Notification

This pull request has been changed(code update) or closed, so removes the following label(s): stat/needs-squash.

likedislike
CANN-robotCANN-robotCollaborators
19 days ago Added label: cann-cla/yes
陈晨
陈晨Collaborators
19 days ago Comments:

/compile

likedislike
陈晨陈晨Collaborators
19 days ago Pre merge succeeded (commit_id: c7e1a89ef17c706132a4a851eec5c0d5d7147bad)
CANN-robot
CANN-robotCollaborators
19 days ago Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
19 days ago Removed label: ci-pipeline-failed
CANN-robotCANN-robotCollaborators
19 days ago Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
19 days ago Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
19 days ago Added label: ci-pipeline-passed
陈晨陈晨Collaborators
19 days ago Modify description of pull request
陈晨陈晨Collaborators
19 days ago Modify description of pull request
wang-xing001
wang-xing001Collaborators
19 days ago Comments:

/lgtm
/approve

likedislike
CANN-robotCANN-robotCollaborators
19 days ago Added label: approved
yuning_chen
yuning_chenCollaborators
19 days ago Comments:

您好,pr合入已准备就绪,请尽快联系committer进行检视,谢谢!
@liubo75 @kevin_huang1234 @yangyang016 @Nice_try @chenxingyu18 @qianzehong @wang-xing001 @liuchuangdev @u010470851

likedislike
sgqt12
sgqt12Collaborators
19 days ago Comments:

/lgtm

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