已合并
处理AdaptiveMaxPool3d算子examples中test_aclnn_adaptive_max_pool3d失败问题 #9020
liuhongpeng创建于 8月21日
处理AdaptiveMaxPool3d算子examples中test_aclnn_adaptive_max_pool3d失败问题 #9020
已合并
liuhongpeng创建于 8月21日
liuhongpeng
8月21日

描述

在环境中执行bash build.sh --run_example adaptive_max_pool3d eager --soc=ascend950报错

关联的Issue

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

测试

在环境中执行bash build.sh --run_example adaptive_max_pool3d eager --soc=ascend950,用例执行OK.

文档更新

类型标签

AI/Agent生成声明

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 liuhongpeng 的贡献)
Lliuhongpeng
8月21日 创建了 pull request,commit d592eb2b
atomgit-bot
atomgit-bot
8月21日 评论:

变更摘要

本 PR 修复了 AdaptiveMaxPool3d 算子示例用例 test_aclnn_adaptive_max_pool3d.cpp 在 bash build.sh --run_example adaptive_max_pool3d eager --soc=ascend950 场景下的执行失败问题。核心原因是示例中输出缓冲与 indices 结果的数据类型和大小定义与算子实际输出不一致:将输出缓冲从固定 4 个元素调整为与输出 shape 匹配的 8 个元素,并将 indices 结果的数据类型从 int64_t 修正为与 ACL_INT32 张量一致的 int32_t,同时补充了对 indices 结果的打印,便于核对输出。

主要改动

  • 修正输出缓冲大小: 将 outHostData 与 indicesHostData 由固定 4 个元素的初始化列表改为 std::vector<float> outHostData(8, 0) 和 std::vector<int32_t> indicesHostData(8, 0),使 host 侧缓冲大小与输出 shape 一致,避免因缓冲不足导致的失败。
  • 修正 indices 数据类型: 将拷贝结果用的 indicesData 从 std::vector<int64_t> 改为 std::vector<int32_t>,并将 aclrtMemcpy 的拷贝长度由 size * sizeof(int64_t) 改为 size * sizeof(int32_t),与以 aclDataType::ACL_INT32 创建的 indices 张量保持一致。
  • 补充 indices 结果打印: 新增遍历 indicesData 并打印 indices[%ld] is: %d 的循环,便于验证算子输出。
  • 清理注释与文件结尾: 统一注释中 //创建 与 // 创建 的格式,并在文件末尾补充换行符。
likedislike
不准确?
atomgit-bot
atomgit-bot
8月21日 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
liuhongpeng
8月21日 评论:

compile

likedislike
CANN-robotCANN-robot成员
8月21日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
8月21日 评论:

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) ✅ 刘闯, 黄迪 (2/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)
likedislike
CANN-robot
CANN-robot成员
8月21日 评论:

CLA Signature Pass

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

likedislike
Lliuhongpeng
8月21日 预合并成功(commit_id: c838d1c20fc022c9a96fc08ef8e5d59b9e7eb16e)
CANN-robotCANN-robot成员
8月21日 将zengjuan,chaotang233,kevin_huang1234,crystalhu,yangyang016,fanqirui,su-yueming,chenqi317,wang-xing001,liubo75,tangweiwei2,pingchuantang,qianzehong,liuchuangdev设为评审人
CANN-robotCANN-robot成员
8月21日 将kevin_huang1234,su-yueming,wang-xing001,pingchuantang,qianzehong,liuchuangdev设为审查人
CANN-robotCANN-robot成员
8月21日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
8月21日 评论:

流水线任务触发成功
任务链接 [c84ad264040d43f2947c22107e90a136][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_950 ✅ SUCCESS >>>>> >>>>>
Compile_Pre ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_950_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_950_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_classify ✅ SUCCESS >>>>>
Compile_Ascend_X86_mobile_station_9030_ubuntu24 ✅ SUCCESS >>>>> >>>>>
UT_Test_ophost ✅ SUCCESS
UT_Test_opapi ✅ SUCCESS
UT_Test_kernel ✅ SUCCESS
UT_Test_opgraph ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>
UT_Test_report_lcov ⚠️ WARNING >>>>>

[2026-08-21 18:22:19]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
8月21日 评论:

流水线任务触发成功
任务链接 [5ff3b3e0f72e48c0bb0bd2b7ba952066][流水线指导]

任务名称状态日志下载链接
antipoison ✅ SUCCESS >>>>>
codecheck_checkpr ✅ SUCCESS
StaticCheck_codespell ✅ SUCCESS
StaticCheck_link_validity ✅ SUCCESS
StaticCheck_resource_existence ✅ SUCCESS
StaticCheck_tag_closed ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_precommit ✅ SUCCESS >>>>>
SCA ✅ SUCCESS >>>>>

[2026-08-21 18:13:03]    CI执行结束

likedislike
CANN-robotCANN-robot成员
8月21日 添加了label:api-check-pass
CANN-robotCANN-robot成员
8月21日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
8月21日 添加了label:ci-pipeline-passed
yuning_chen
yuning_chen成员
8月22日 评论:

您好,pr合入已准备就绪,请尽快联系committer进行检视,谢谢!

likedislike
Lliuhongpeng
8月24日 修改了pull request 的描述
liuchuangdev成员
8月24日 评论:

/approve

likedislike
CANN-robotCANN-robot成员
8月24日 添加了label:approved
kevin_huang1234成员
8月24日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
8月24日 添加了label:lgtm
CANN-robotCANN-robot成员
8月24日 关闭了关联的issue
CANN-robotCANN-robot成员
8月24日 合入了pull request