Pull Request已成功合入, 合并人@CANN-robot
(感谢 陈思 的贡献)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 |
|---|---|---|
| conv | ✅ 陈琦, 杨阳 (2/2) | ✅ 陈琦 (1/1) |
| foreach | ✅ 陈琦, 杨阳 (2/2) | ✅ 陈琦 (1/1) |
| norm | ✅ 陈琦, 杨阳 (2/2) | ✅ 陈琦 (1/1) |
| quant | ✅ 杨阳, 陈琦 (2/2) | ✅ 陈琦 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
chensi79, thanks for your pull request. All authors of the commits have signed the CLA. 👍


变更摘要
此 PR 对多个算子 Tiling 层中 OP_LOGE 日志调用进行了统一整改,将原来含义模糊、信息不足的通用日志宏替换为一系列携带参数名、实际值及原因说明的专用日志宏(如 OP_LOGE_FOR_INVALID_VALUES_WITH_REASON、OP_LOGE_FOR_INVALID_DTYPE_WITH_REASON、OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON 等),使参数校验失败时的错误信息更加明确、可定位,便于快速排查输入参数问题。
主要改动
-
使用
OP_LOGE_FOR_INVALID_VALUES_WITH_REASON替代通用日志:在deformable_offsets_tiling_arch35.cpp中,strides 参数校验失败时,从仅提示 "StrideH not equal to 0" 改为输出完整的 strides 四元组值以及 H/W 维度在不同格式下的位置说明;在dequant_swiglu_quant_tiling.cpp中,speGroupType_与 bias/swiglu 模式冲突时输出当前值和约束条件。 -
使用
OP_LOGE_FOR_INVALID_DTYPE(S)_WITH_REASON替代通用日志:在group_norm_grad_tiling.cpp和group_norm_v2_tiling_arch35.cpp中,dtype 大小校验和 dtype 组合校验失败时,增加了具体 dtype 名称及序列化字符串;在group_norm_silu_tiling_arch35.cpp中同样对 gamma/beta 的 dtype 检查增加了x, gamma/x, beta的具体 dtype 信息。 -
使用
OP_LOGE_FOR_INVALID_SHAPE(SIZE|DIM)_WITH_REASON替代通用日志:在foreach_non_finite_check_and_unscale_tiling.cpp中 empty tensor 校验增加具体参数名和当前 shape size;在dequant_swiglu_quant_tiling.cpp和dequant_swiglu_quant_tiling_arch35.cpp中多处 shape 维度、尺寸校验改为携带参数名、实际 shape 字符串及明确约束描述。 -
修复
group_norm_silu_tiling_arch35.cpp中的接口误用:在CheckGammaAndBetaParams的 beta dtype 校验分支中,将原本错误调用的context->GetNodeType()修正为context->GetNodeName(),确保日志输出节点名而非类型名。 -
使用
OP_LOGE_FOR_INVALID_VALUE_WITH_REASON替代通用日志:在deformable_offsets_grad_tiling_arch35.cpp中,deformable_groups 校验失败时增加实际值输出;在dequant_swiglu_quant_tiling.cpp中,quant_offset 不允许存在和 quant_scale 必须存在等场景也改为携带参数名和实际值/期望值。


代码审查
Closing Summary
共审查 8 个变更文件,发现 3 个 P3 问题,无 P0/P1/P2 问题。
| 文件 | 审查结果 |
|---|---|
conv/deformable_offsets/op_host/arch35/deformable_offsets_tiling_arch35.cpp |
无问题 |
conv/deformable_offsets_grad/op_host/arch35/deformable_offsets_grad_tiling_arch35.cpp |
无问题 |
foreach/foreach_non_finite_check_and_unscale/op_host/foreach_non_finite_check_and_unscale_tiling.cpp |
无问题 |
norm/group_norm_grad/op_host/group_norm_grad_tiling.cpp |
无问题 |
norm/group_norm_silu/op_host/group_norm_silu_tiling_arch35.cpp |
无问题(顺带修复了原代码 GetNodeType → GetNodeName 的 bug) |
norm/group_norm_v2/op_host/arch35/group_norm_v2_tiling_arch35.cpp |
无问题 |
quant/dequant_swiglu_quant/op_host/dequant_swiglu_quant_tiling.cpp |
2 个 P3:speGroupType_ 三元表达式死代码 |
quant/dequant_swiglu_quant/op_host/dequant_swiglu_quant_tiling_arch35.cpp |
1 个 P3:CheckOutputScale 逐维校验丢失维度索引 |
P3 问题清单:
dequant_swiglu_quant_tiling.cpp:484—speGroupType_ ? "2D" : "1D"中的: "1D"分支死代码(恒为 true 时求值)dequant_swiglu_quant_tiling.cpp:493— 同上第二处相同死代码dequant_swiglu_quant_tiling_arch35.cpp:662-664— 逐维度 shape 校验日志丢失具体维度索引i
整体风险评估:低风险。本次改动符合 PR 目标(将 OP_LOGE 替换为 OP_LOGE_FOR_INVALID_* 族标准化宏),无逻辑错误、无安全漏洞、无可靠性回归。3 个 P3 问题均为细微代码质量/诊断精度问题,不影响正确性和运行时行为。
⚠️ 已识别出整体风险,但无法提取行内评论,请参考整体评估。


compile


流水线任务触发成功
任务链接 [63430ea228ee4d9b83fc32077f08cfc8][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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 | >>>>> | |
| 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 | ⚠️ WARNING | >>>>> |
[2026-06-29 15:01:49] CI执行结束


流水线任务触发成功
任务链接 [ad01e45eb30d428db45ce84345d2c931][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ❌ FAILED | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_checkpr | ✅ SUCCESS | ||
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_style | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ⚠️ WARNING | >>>>> | >>>>> |
| SCA | ✅ SUCCESS | >>>>> |


compile


流水线任务触发成功
任务链接 [58de8e50dff449dca18f53eac2f35446][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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 | >>>>> | |
| 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 | ⚠️ WARNING | >>>>> |
[2026-06-29 15:23:55] CI执行结束


流水线任务触发成功
任务链接 [67b0970d7fff4b6a8e23ba49411d61fa][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_checkpr | ✅ SUCCESS | ||
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_style | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ⚠️ WARNING | >>>>> | >>>>> |
| SCA | ✅ SUCCESS | >>>>> |
[2026-06-29 15:10:43] CI执行结束


/lgtm


描述
对 conv / foreach / norm / quant 共 8 个算子 host 侧 tiling 代码中的
OP_LOGE(...)报错日志进行整改,统一替换为按错误类型分类的OP_LOGE_FOR_INVALID_*_WITH_REASON系列宏,使报错信息携带参数名、实际值与原因描述,符合 op_loge 日志规范。涉及的算子与文件:
deformable_offsets_tiling_arch35.cppdeformable_offsets_grad_tiling_arch35.cppforeach_non_finite_check_and_unscale_tiling.cppgroup_norm_grad_tiling.cppgroup_norm_silu_tiling_arch35.cppgroup_norm_v2_tiling_arch35.cppdequant_swiglu_quant_tiling.cppdequant_swiglu_quant_tiling_arch35.cpp按错误类型采用的分类宏:
OP_LOGE_FOR_INVALID_VALUE_WITH_REASON/OP_LOGE_FOR_INVALID_VALUES_WITH_REASON:单值/多值非法(如deformable_groups、quant_offset、group_index维度、speGroupType)OP_LOGE_FOR_INVALID_DTYPE_WITH_REASON/OP_LOGE_FOR_INVALID_DTYPES_WITH_REASON:dtype / dtype 组合非法(如x、gamma、beta)OP_LOGE_FOR_INVALID_SHAPESIZE_WITH_REASON/OP_LOGE_FOR_INVALID_SHAPESIZES_WITH_REASON:shape size 非法(如scaled_grads空 tensor、quant_scale与quant_offsetsize 不一致)OP_LOGE_FOR_INVALID_SHAPEDIM/OP_LOGE_FOR_INVALID_SHAPEDIM_WITH_REASON:shape 维度数非法(如group_index仅支持 1D、scale维度需比y少 1)OP_LOGE_FOR_INVALID_SHAPE_WITH_REASON:shape 非法(如weight_scale、quant_scale、quant_offset、scale与y的形状约束)整改后每条报错均明确给出:参数名(如
strides、deformable_groups、quant_scale)、actual 值、以及符合报错规范的原因描述(reason);控制流与返回值未改动。关联的Issue
https://gitcode.com/cann/ops-nn/issues/3631
测试
OP_LOGE升级为分类宏,校验逻辑与返回值未改动。文档更新
无(仅 host 侧 tiling 代码改动,不涉及对外接口或 README 变更)。
类型标签
AI/Agent生成声明