已合并
Revert upsample_nearest2d_grad和upsample_nearest_exact2d_grad修改 #1155
Revert upsample_nearest2d_grad和upsample_nearest_exact2d_grad修改 #1155
已合并
sgqt12创建于 29 天前
sgqt12
sgqt12成员
29 天前

描述

Revert upsample_nearest2d_grad和upsample_nearest_exact2d_grad修改

关联的Issue

关联的Issue https://gitcode.com/cann/ops-cv/issues/636

测试

文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 sgqt12 的贡献)
sgqt12sgqt12成员
29 天前 创建了 pull request,commit 42d093bf
atomgit-bot
atomgit-bot
29 天前 评论:

变更摘要

此 PR 回滚了之前为 UpsampleNearest2dGradUpsampleNearestExact2dGrad 算子添加的 ascend950 芯片适配代码,主要涉及移除 ascend950 专属的 SIMT kernel 实现、tiling 逻辑、二进制编译配置以及单测文件,同时从 ascendc_config.json 中将 UpsampleNearest2dGrad 的算力单元列表恢复为仅支持 ascend910_93ascend910b

主要改动

  • 删除 ascend950 的 SIMT kernel 实现: 完整移除 image/upsample_nearest2d_grad/op_kernel/arch35/upsample_nearest2d_grad_simt.h,其中包含 OpUpsampleNearest2dGradSimtKernelAccumulateGradReadAsFloat/WriteFromFloat 等模板函数及 UintDiv 快速除法等性能优化。
  • 删除 ascend950 的 tiling 实现与数据结构: 移除 upsample_nearest2d_grad_tiling_arch35.cpp(含 UpsampleNearest2dGradArch35TilingFunc)、upsample_nearest2d_grad_tiling_data.h(含 UpsampleNearest2dGradTilingData 结构体)和 upsample_nearest2d_grad_tiling_key.h
  • 移除 ascend950 编译配置与算子注册: 删除 upsample_nearest2d_grad_binary.jsonupsample_nearest2d_grad_simplified_key.ini;在 upsample_nearest2d_grad_def.cpp 中移除为 ascend950 添加的 OpAICoreConfig(含 DynamicCompileStaticFlagDynamicShapeSupportFlag 等);在 ascendc_config.json 中将 UpsampleNearest2dGradcompute_units["ascend910_93", "ascend910b", "ascend950"] 缩减为 ["ascend910_93", "ascend910b"]
  • 清理跨算子对 arch35 tiling 的调用: 在 upsample_nearest_exact2d_grad_tiling.cpp 中移除 UpsampleNearest2dGradArch35TilingFunc 的调用分支,并在对应的头文件中删除该函数的声明,切断 UpsampleNearestExact2dGrad 对 ascend950 tiling 的依赖。
  • 移除相关单元测试: 删除 test_upsample_nearest2d_grad_tiling_arch35.cpp,其中包含 fp32/fp16 正向测试以及 dimHin/dimC/dimHout 为零的负向测试用例。
likedislike
atomgit-bot
atomgit-bot
29 天前 评论:

代码审查

审查总结

我对全部 7 个变更文件逐一审查完毕,结论如下:

文件 审查结果
image/upsample_nearest2d_grad/op_host/upsample_nearest2d_grad_def.cpp 无问题 — 干净移除了 ascend950 的 AICore 配置
image/upsample_nearest2d_grad/tests/ut/op_host/CMakeLists.txt 无问题 — 干净移除了 add_modules_ut_sources 调用
image/upsample_nearest2d_grad/tests/ut/op_kernel/CMakeLists.txt 无问题 — 干净移除了已删除源文件的引用
image/upsample_nearest_exact2d_grad/op_host/upsample_nearest_exact2d_grad_tiling.cpp 无问题 — 构造函数空格调整(纯格式)及移除 UpsampleNearest2dGrad 的 arch35 dispatch 分支
image/upsample_nearest_exact2d_grad/op_host/upsample_nearest_exact2d_grad_tiling.h 无问题 — 干净移除了 UpsampleNearest2dGradArch35TilingFunc 声明
image/upsample_nearest_exact2d_grad/tests/ut/op_kernel/CMakeLists.txt 无问题 — 干净移除了已删除源文件的引用
scripts/kernel/binary_config/ascendc_config.json 1 个 P3 发现 — compile_options 中残留 ascend950 条目

发现统计:

  • P0: 0
  • P1: 0
  • P2: 0
  • P3: 1(低置信度,残留清理项)

整体风险评估:低风险。 本次 revert 改动干净、一致:所有被删除文件(共 8 个)的引用均已在 CMakeLists、头文件声明、源文件 dispatch 逻辑和 JSON 配置的 compute_units 中正确移除。唯一的小瑕疵是 JSON 中 compile_options 残留了一个 ascend950 条目,但该文件本身存在类似既有模式,不影响构建正确性。

⚠️ 已识别出整体风险,但无法提取行内评论,请参考整体评估。

likedislike
CANN-robotCANN-robot成员
29 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
29 天前 评论:

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


PR Approval Progress

Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
*/*/op_host/*_def.cpp 刘伟, 徐鲁威, 汤磊 (3/2) 汤磊 (1/1)
image/upsample_nearest2d_grad 刘伟, 徐鲁威, 任如海 (3/2) 刘伟 (1/1)
image/upsample_nearest_exact2d_grad 刘伟, 任如海, 徐鲁威 (3/2) 刘伟 (1/1)
repo-cann/ops-cv 刘伟, 徐鲁威 (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

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

likedislike
CANN-robotCANN-robot成员
29 天前 将zhou-qilong,renruhai,zhajianqing123,rxtfeng,luowen203_gg123,loov1,tang-lei01,zhangzijie,zl_hw,liu-wei,demoauguste,llimwang,gubaocheng,wangyongguang设为评审人
CANN-robotCANN-robot成员
29 天前 将zhou-qilong,renruhai,zhajianqing123,rxtfeng,luowen203_gg123,loov1,tang-lei01,zhangzijie,zl_hw,liu-wei,demoauguste,llimwang,gubaocheng,wangyongguang设为审查人
sgqt12
sgqt12成员
29 天前 评论:

compile

likedislike
sgqt12sgqt12成员
29 天前 update merge request[project id: 7657293, iid: 1155, commit_id: 173d9e01763e7a837b19437ff612ac8f4d5930a3] virtual merging success
CANN-robotCANN-robot成员
29 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
29 天前 评论:

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

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_A5 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_A5 ✅ SUCCESS >>>>> >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_Pre ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_A5_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_A5_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 ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>
UT_Test_harmony-infer-chs-cv ✅ SUCCESS
UT_Test_report_lcov ✅ SUCCESS

[2026-07-22 20:04:39]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
29 天前 评论:

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

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

[2026-07-22 19:56:11]    CI执行结束

likedislike
sgqt12sgqt12成员
29 天前 修改标题为 “Revert upsample_nearest2d_grad和upsample_nearest_exact2d_grad修改”,原标题为“Revert upsample_nearest2d_grad和upsample_nearest_exact2d_grad的ascend950修改”
CANN-robotCANN-robot成员
29 天前 添加了label:api-check-pass
CANN-robotCANN-robot成员
29 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
29 天前 添加了label:ci-pipeline-passed
sgqt12sgqt12成员
28 天前 修改了pull request 的描述
tang-lei01成员
28 天前 评论:

/approve

likedislike
liu-wei
liu-wei成员
28 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
28 天前 添加了label:approved
sgqt12
sgqt12成员
28 天前 评论:

@zhangzijie @llimwang 麻烦检视打分

likedislike
renruhai成员
28 天前 评论:

/lgtm

likedislike
loov成员
28 天前 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
28 天前 添加了label:lgtm
CANN-robotCANN-robot成员
28 天前 关闭了关联的issue
CANN-robotCANN-robot成员
28 天前 合入了pull request