Pull Request已成功合入, 合并人@CANN-robot
(感谢 Nice try 的贡献)变更摘要
本 PR 将多个算子的 op_api 目录从 op_host/op_api/ 路径整体上移至算子根目录 op_api/(涉及 apply_top_k_top_p_with_sorted、embedding_bag、linear_index、linear_index_v2、fused_cross_entropy_loss_with_max_sum、fake_quant_affine_cachemask、single_layer_lstm_grad 等算子),并同步更新了 classify_rule.yaml 分类规则、各源文件与测试文件中的 include 路径,同时顺带修正了部分文件末尾缺失换行符及注释格式问题。该改动属于目录结构调整(标记为 Bug 修复),不改动算子对外接口与业务逻辑。
主要改动
op_api目录上移: 将上述多个算子原本位于op_host/op_api/下的.cpp/.h文件整体迁移至算子根目录op_api/,如linear_index_v2.h、aclnn_embedding_bag.h、fake_quant_common.h、aclnn_lstm_backward.h等,统一op_api目录层级。- 更新
classify_rule.yaml分类路径: 将linear_index_v2的源码分类路径由ops/ops-nn/index/linear_index_v2/op_host/op_api/调整为ops/ops-nn/index/linear_index_v2/op_api/,与新的目录结构保持一致。 - 同步修正 include 路径: 源文件中
index_put_v2的aclnn_index_put_impl.cpp将index/linear_index_v2/op_host/op_api/linear_index_v2.h改为index/linear_index_v2/op_api/linear_index_v2.h,scatter_elements_v2的aclnn_scatter.cpp将../../linear_index/op_host/op_api/linear_index.h改为../../linear_index/op_api/linear_index.h;多个测试文件(如test_aclnn_apply_top_k_top_p.cpp、test_aclnn_embedding_bag.cpp、test_aclnn_fake_quant_per_channel_affine_cachemask.cpp、test_aclnn_lstm_backward.cpp等)的#include路径也相应从../../../op_host/op_api/调整为../../../op_api/。 - 顺带修正格式问题: 为
embedding_bag.cpp中注释补充空格(如//根据dtype→// 根据dtype),并为linear_index_v2.h、fake_quant_common.h、aclnn_lstm_backward.cpp、embedding_bag.h、test_aclnn_embedding_bag.cpp等文件末尾补充缺失的换行符。


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.
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 |
|---|---|---|
| */*/op_api/*.h | ✅ 王永光, 刘波, 汤平川 (3/2) | ✅ 王永光 (1/1) |
| index | ✅ 钱泽洪, 刘波, 唐燕峰, 汤平川 (4/2) | ✅ 唐燕峰, 汤平川, 钱泽洪 (3/1) |
| loss | ✅ 汤平川, 钱泽洪, 刘波 (3/2) | ✅ 汤平川, 钱泽洪 (2/1) |
| quant | ✅ 钱泽洪, 刘波, 汤平川 (3/2) | ✅ 汤平川, 钱泽洪 (2/1) |
| repo-cann/ops-nn | ✅ 汤平川, 刘波 (2/2) | ✅ 汤平川, 刘波 (2/1) |
| rnn | ✅ 钱泽洪, 汤平川, 刘波 (3/2) | ✅ 钱泽洪, 汤平川 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
Nice_try, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


流水线任务触发成功
任务链接 [40b1c3ce9eec4141b850a1069a1b1ec2][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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 | ⚠️ WARNING | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> | |
| UT_Test_report_lcov | ⚠️ WARNING | >>>>> |
[2026-08-18 10:53:11] CI执行结束


流水线任务触发成功
任务链接 [0707c922c1444979a9ef4eefd93d8e5d][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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-18 10:34:28] CI执行结束


/lgtm
/approve


/lgtm
/approve


/lgtm
/approve


/approve


描述
将 7 个算子的 op_api 实现从
op_host/op_api/子目录移动至算子根目录op_api/,并将算子根目录 CMakeLists.txt 由递归式file(GLOB)+add_subdirectory统一为add_modules_sources构建方式,同时同步更新所有相关头文件引用路径。涉及的算子:
改动原因
ops-nn 仓库中部分算子的 op_api 代码位于
op_host/op_api/层级之下,与其他算子的组织方式不一致,且构建配置分散在op_host/CMakeLists.txt中。本改动将 op_api 目录统一上移至算子根目录,并统一算子构建配置。改动方法
op_host/op_api/目录整体移动至算子根目录op_api/(纯移动,内容不变);op_host/CMakeLists.txt,算子根目录 CMakeLists.txt 统一改为调用add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE <op_name> ACLNNTYPE aclnn_exclude);index/index_put_v2/op_api/aclnn_index_put_impl.cpp(linear_index_v2.h)、index/scatter_elements_v2/op_api/aclnn_scatter.cpp(linear_index.h)及 6 个 UT 测试文件;classify_rule.yaml中 linear_index_v2 的 op_api 路径(op_host/op_api/→op_api/);关联的Issue
测试
文档更新
无文档变更。
类型标签
AI/Agent生成声明