Pull Request已成功合入, 合并人@CANN-robot
(感谢 sgqt12 的贡献)变更摘要
此 PR 回滚了之前为 UpsampleNearest2dGrad 和 UpsampleNearestExact2dGrad 算子添加的 ascend950 芯片适配代码,主要涉及移除 ascend950 专属的 SIMT kernel 实现、tiling 逻辑、二进制编译配置以及单测文件,同时从 ascendc_config.json 中将 UpsampleNearest2dGrad 的算力单元列表恢复为仅支持 ascend910_93 和 ascend910b。
主要改动
- 删除 ascend950 的 SIMT kernel 实现: 完整移除
image/upsample_nearest2d_grad/op_kernel/arch35/upsample_nearest2d_grad_simt.h,其中包含OpUpsampleNearest2dGradSimtKernel、AccumulateGrad、ReadAsFloat/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.json和upsample_nearest2d_grad_simplified_key.ini;在upsample_nearest2d_grad_def.cpp中移除为 ascend950 添加的OpAICoreConfig(含DynamicCompileStaticFlag、DynamicShapeSupportFlag等);在ascendc_config.json中将UpsampleNearest2dGrad的compute_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 为零的负向测试用例。


代码审查
审查总结
我对全部 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 条目,但该文件本身存在类似既有模式,不影响构建正确性。
⚠️ 已识别出整体风险,但无法提取行内评论,请参考整体评估。


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
/approveor/lgtm- Commenting
/approveimplies 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. 👍


compile


流水线任务触发成功
任务链接 [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执行结束


流水线任务触发成功
任务链接 [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执行结束


/approve


/lgtm
/approve


@zhangzijie @llimwang 麻烦检视打分


描述
Revert upsample_nearest2d_grad和upsample_nearest_exact2d_grad修改
关联的Issue
关联的Issue https://gitcode.com/cann/ops-cv/issues/636
测试
文档更新
类型标签