已合并
剥离math下op_host/op_api到op_api #4246
yue-ma创建于 19 天前
剥离math下op_host/op_api到op_api #4246
已合并
yue-ma创建于 19 天前
yue-ma成员
19 天前

描述

本次变更主要对 math 目录下多个算子的目录结构进行扁平化整理:将原先嵌套在 op_host/op_api/ 中的 API 实现文件直接提升到 op_api/ 层级

关联的Issue

https://gitcode.com/cann/ops-math/issues/2392

测试

UT/ST通过

文档更新

类型标签

  • Bug修复
  • 新特性
  • 性能优化
  • 文档更新
  • 其他,请描述:
likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 yue-ma 的贡献)
Yyue-ma成员
19 天前 创建了 pull request,commit 6171c3d2
atomgit-bot
atomgit-bot
19 天前 评论:

变更摘要

本次变更主要对 math 目录下多个算子的目录结构进行扁平化整理:将原先嵌套在 op_host/op_api/ 中的 API 实现文件直接提升到 op_api/ 层级,即移除中间的 op_host 目录。同时更新了相关的测试文件头文件引用路径及分类规则配置文件 classify_rule.yaml,以适配新的目录结构。

主要改动

  • 目录重构 — 移除 op_host 中间层级:将 affine_gridbitwise_notcholeskycummaxcumprod 等算子的 API 文件从 op_host/op_api/ 移动到其算子目录下的 op_api/,涉及 aclnn_*.cpp/h 及算子入口 *.cpp/h 文件的路径重命名。同时移除了 bitwise_xor 中已废弃的 op_host/op_api/ 路径。
  • classify_rule.yaml 路径更新:将文件中 affine_gridbitwise_notcholeskycummaxcumprod 等条目的路径从 op_host/op_api/ 修正为 op_api/,并删除 bitwise_xor 的冗余 op_host/op_api/ 行。
  • 测试文件 include 路径修正:更新 math/atan2/tests/ 下的 test_atan2.cpptest_inplace_atan2.cpp 以及 math/cholesky/tests/ 下的 test_aclnn_linalg_cholesky.cpp 中对 aclnn_*.h 的引用,移除路径中的 op_host/ 前缀,使其指向新的 op_api/ 位置。
likedislike
atomgit-bot
atomgit-bot
19 天前 评论:

代码审查

All files exist at their correct new locations. Let me now compile the final summary.

审查总结

已审查文件清单

文件 审查结果
classify_rule.yaml 无问题 — 路径替换正确,bitwise_xor 的重复条目已正确移除
math/affine_grid/CMakeLists.txt 无问题 — 正确替换为 add_all_modules_sources
math/affine_grid/op_api/aclnn_affine_grid.cpp 无问题 — 纯重命名,内容未变
math/affine_grid/op_api/aclnn_affine_grid.h 无问题 — 纯重命名,内容未变
math/affine_grid/op_api/affine_grid.cpp 无问题 — 纯重命名,内容未变
math/affine_grid/op_api/affine_grid.h 无问题 — 纯重命名,内容未变
math/amp_update_scale/CMakeLists.txt 无问题 — 正确替换为 add_all_modules_sources
math/angle_v2/CMakeLists.txt 无问题 — 正确替换为 add_all_modules_sources
math/atan2/tests/ut/op_api/test_atan2.cpp P2 — include 路径多一层 ../,应为 3 层而非 4 层
math/atan2/tests/ut/op_api/test_inplace_atan2.cpp P2 — 同上
math/atanh/tests/ut/op_api/test_atanh.cpp 无问题 — 纯重命名(diff 为空),无内容变更
math/bitwise_not/CMakeLists.txt 无问题 — 正确替换为 add_all_modules_sources
math/bitwise_not/op_api/aclnn_bitwise_not.cpp 无问题 — 纯重命名,内容未变
math/bitwise_not/op_api/aclnn_bitwise_not.h 无问题 — 纯重命名,内容未变
math/bitwise_not/tests/ut/op_api/test_aclnn_bitwise_not.cpp 无问题 — 使用裸名 include,不依赖相对路径
math/cholesky/CMakeLists.txt 无问题 — 正确替换为 add_all_modules_sources
math/cholesky/op_api/aclnn_linalg_cholesky.cpp 无问题 — 纯重命名,内容未变
math/cholesky/op_api/aclnn_linalg_cholesky.h 无问题 — 纯重命名,内容未变
math/cholesky/op_api/cholesky.cpp 无问题 — 纯重命名,内容未变
math/cholesky/op_api/cholesky.h 无问题 — 纯重命名,内容未变
math/cholesky/tests/ut/op_api/test_aclnn_linalg_cholesky.cpp 无问题 — include 路径正确地使用了 3 层 ../
math/cummax/CMakeLists.txt 无问题 — 正确替换为 add_all_modules_sources
math/cummax/op_api/aclnn_cummax.cpp 无问题 — 纯重命名,内容未变
math/cummax/op_api/aclnn_cummax.h 无问题 — 纯重命名,内容未变
math/cummax/op_api/cummax.cpp 无问题 — 纯重命名,内容未变
math/cummax/op_api/cummax.h 无问题 — 纯重命名,内容未变
math/cummax/tests/ut/op_api/test_aclnn_cummax.cpp 无问题 — 使用裸名 include,不依赖相对路径
math/cumprod/CMakeLists.txt 无问题 — 正确替换为 add_all_modules_sources
math/cumprod/op_api/aclnn_cumprod.cpp 无问题 — 纯重命名,内容未变
math/cumprod/op_api/aclnn_cumprod.h 无问题 — 纯重命名,内容未变
math/cumprod/op_api/cumprod.cpp 无问题 — 纯重命名,内容未变
math/cumprod/op_api/cumprod.h 无问题 — 纯重命名,内容未变

发现数量统计

  • P0: 0
  • P1: 0
  • P2: 2(均为 atan2 测试文件 include 路径层级错误)
  • P3: 0

整体风险评估

低风险。 本次 PR 正确地将 7 个算子(affine_grid、amp_update_scale、angle_v2、bitwise_not、cholesky、cummax、cumprod)的 op_host/op_api/ 目录剥离为直接 op_api/。CMake 构建文件、classify_rule.yaml 配置、以及大部分测试文件的 include 路径均已正确更新。唯一的问题是两个 atan2 测试文件的相对 include 路径使用了错误的层级数(4 层 ../ 应为 3 层),可能导致编译失败,建议修正。

类型 数量
🔴 阻塞 3
🟡 建议 2

⛔ 需要修改

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

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_api/*.h 汤磊, 冯彤 (2/2) 汤磊 (1/1)
math/angle_v2 唐燕峰, 宋恺, 冯彤 (3/2) 宋恺, 冯彤, 唐燕峰 (3/1)
math/asin 冯彤, 唐燕峰, 宋恺 (3/2) 冯彤, 唐燕峰, 宋恺 (3/1)
math/asinh 唐燕峰, 宋恺, 冯彤 (3/2) 唐燕峰, 宋恺, 冯彤 (3/1)
math/atan2 宋恺, 冯彤, 唐燕峰 (3/2) 唐燕峰, 宋恺, 冯彤 (3/1)
math/atanh 唐燕峰, 宋恺, 冯彤 (3/2) 唐燕峰, 宋恺, 冯彤 (3/1)
math/bitwise_not 冯彤, 唐燕峰, 宋恺 (3/2) 冯彤, 唐燕峰, 宋恺 (3/1)
math/complex 唐燕峰, 宋恺, 冯彤 (3/2) 唐燕峰, 宋恺, 冯彤 (3/1)
math/cummax 冯彤, 唐燕峰, 宋恺 (3/2) 唐燕峰, 宋恺, 冯彤 (3/1)
math/cumprod 冯彤, 唐燕峰, 宋恺 (3/2) 宋恺, 冯彤, 唐燕峰 (3/1)
math/histogram_v2 唐燕峰, 宋恺, 冯彤 (3/2) 冯彤, 唐燕峰, 宋恺 (3/1)
math/lin_space 冯彤, 唐燕峰, 宋恺 (3/2) 冯彤, 唐燕峰, 宋恺 (3/1)
math/log_add_exp 冯彤, 唐燕峰, 宋恺 (3/2) 冯彤, 唐燕峰, 宋恺 (3/1)
math/masked_scale 唐燕峰, 宋恺, 冯彤 (3/2) 唐燕峰, 宋恺, 冯彤 (3/1)
math/non_finite_check 冯彤, 唐燕峰, 宋恺 (3/2) 冯彤, 唐燕峰, 宋恺 (3/1)
math/pdist 冯彤, 唐燕峰, 宋恺 (3/2) 冯彤, 唐燕峰, 宋恺 (3/1)
math/pow 冯彤, 唐燕峰, 宋恺 (3/2) 宋恺, 冯彤, 唐燕峰 (3/1)
math/pows 冯彤, 唐燕峰, 宋恺 (3/2) 冯彤, 唐燕峰, 宋恺 (3/1)
math/reduce_nansum 冯彤, 唐燕峰, 宋恺 (3/2) 宋恺, 冯彤, 唐燕峰 (3/1)
math/reduce_std_v2 唐燕峰, 宋恺, 冯彤 (3/2) 宋恺, 冯彤, 唐燕峰 (3/1)
math/reduce_std_v2_update 冯彤, 唐燕峰, 宋恺 (3/2) 冯彤, 唐燕峰, 宋恺 (3/1)
math/reduce_std_with_mean 冯彤, 唐燕峰, 宋恺 (3/2) 宋恺, 冯彤, 唐燕峰 (3/1)
math/rfft1_d 冯彤, 唐燕峰, 宋恺 (3/2) 宋恺, 冯彤, 唐燕峰 (3/1)
math/sign_bits_pack 唐燕峰, 宋恺, 冯彤 (3/2) 唐燕峰, 宋恺, 冯彤 (3/1)
math/sign_bits_unpack 唐燕峰, 宋恺, 冯彤 (3/2) 唐燕峰, 宋恺, 冯彤 (3/1)
math/sinkhorn 冯彤, 唐燕峰, 宋恺 (3/2) 宋恺, 冯彤, 唐燕峰 (3/1)
repo-cann/ops-math 冯彤, 宋恺 (2/2) 宋恺, 冯彤 (2/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
此处折叠了168条消息 查看更多
CANN-robotCANN-robot成员
16 天前 添加了label:approved
rxtfeng成员
16 天前 评论:

/lgtm

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