Pull Request已成功合入, 合并人@CANN-robot
(感谢 gaomingyuan 的贡献)变更摘要
本 PR 针对 nn 仓部分算子的日志问题进行统一整改,核心内容包括三方面:一是将 activation/relu_grad_v2 与 activation/softplus 的示例测试程序中失败分支的 printf 日志级别由 INFO 纠正为 ERROR;二是对 relu_grad_v2、softplus、map_index、quant_update_scatter、sparse_slice 等算子的 tiling 代码统一修正 OP_LOGE 调用(将误传的 tilingContext 改为 tilingContext->GetNodeName()),并为失败日志补充 coreNum、ubSize、维度等关键参数,同时删除大量冗余的 OP_LOGD 调试日志;三是在 torch_extension/cann_ops_nn/op_builder/builder.py 中为算子 JIT 编译引入文件锁,避免多进程并发编译冲突。
主要改动
- 示例程序错误日志级别修正:在
test_geir_relu_grad_v2.cpp与test_geir_softplus.cpp中,将 GE 初始化失败、RunGraph失败、GEFinalize失败三处分支的printf日志由INFO改为ERROR,使失败场景的日志级别与语义一致。 - tiling 错误日志参数修正:在
relu_grad_v2_tiling_arch35.cpp、softplus_tiling_arch35.cpp等文件中,将OP_LOGE(tilingContext, ...)统一修正为OP_LOGE(tilingContext->GetNodeName(), ...),修复错误日志中传入对象不匹配的问题。 - 失败日志信息增强:在
map_index_tiling_arch35.cpp、sparse_slice_tiling_arch35.cpp中为获取 coreNum/ubSize 失败的日志补充具体数值参数,并在quant_update_scatter_tiling_arch35.cpp中为GetTilingNeg2失败日志补充updateDim2、updateDim3维度信息,提升问题定位效率。 - 冗余调试日志清理:批量删除各 tiling 文件(含
map_index、quant_update_scatter、sparse_slice等)中多余的OP_LOGD入口/出口调试日志,并将map_index的TilingPrepare4MapIndex简化为单行实现。 - JIT 编译并发保护:在
builder.py的OpBuilder中新增基于fcntl.flock的文件锁(锁文件位于扩展目录TORCH_EXTENSIONS_DIR下),编译算子前先获取互斥锁,若算子已加载则直接返回缓存模块,防止并发 JIT 编译冲突。


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 |
|---|---|---|
| activation | ✅ 唐玮玮, 汤平川, 王星 (3/2) | ✅ 汤平川, 王星 (2/1) |
| index | ✅ 唐玮玮, 汤平川, 王星 (3/2) | ✅ 汤平川, 王星 (2/1) |
| torch_extension | ✅ 唐玮玮, 汤平川 (2/2) | ✅ 唐玮玮 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
qq_52874943, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


流水线任务触发成功
任务链接 [78ef4d5398234302853139b747e2f3e0][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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 | ✅ SUCCESS | >>>>> |
[2026-08-27 21:59:16] CI执行结束


compile


流水线任务触发成功
任务链接 [9dbf3bd0d69a4bc5af7233dcb3021562][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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 | ✅ SUCCESS | >>>>> |
[2026-08-27 22:19:54] CI执行结束


流水线任务触发成功
任务链接 [e932f73606b94099a16217d5b938301f][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_checkpr | ✅ SUCCESS | ||
| codecheck_precommit | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| StaticCheck_md | ✅ SUCCESS |
[2026-08-27 22:09:50] CI执行结束


/lgtm
/approve


/lgtm
/approve


/lgtm
/approve


描述
本 PR 针对 nn 仓部分算子的日志问题进行统一整改,核心内容包括三方面:一是将 activation/relu_grad_v2 与 activation/softplus 的示例测试程序中失败分支的 printf 日志级别由 INFO 纠正为 ERROR;二是对 relu_grad_v2、softplus、map_index、quant_update_scatter、sparse_slice 等算子的 tiling 代码统一修正 OP_LOGE 调用(将误传的 tilingContext 改为 tilingContext->GetNodeName()),并为失败日志补充 coreNum、ubSize、维度等关键参数,同时删除大量冗余的 OP_LOGD 调试日志;三是在 torch_extension/cann_ops_nn/op_builder/builder.py 中为算子 JIT 编译引入文件锁,避免多进程并发编译冲突。
关联的Issue
关联Issue#5183
测试
本地已完成新精度对比与性能测试,通过静态检查、蓝区冒烟、算子ST以及算子二级冒烟
文档更新
类型标签
AI/Agent生成声明