已关闭
[Bug-Report|缺陷反馈]: aclnnQuantMax roundMode 空指针返回码不规范 #5374
majinglan创建于  26 天前关闭于  2 天前
majinglan
majinglan
26 天前 创建

Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.

Describe the current behavior / 问题描述 (Mandatory / 必填)

环境
CANN 版本:9.1.0-beta.1(aarch64)
NPU:910B3
算子路径:quant/quant_max/op_api/
缺陷描述
aclnnQuantMaxGetWorkspaceSize 的 char* roundMode 参数判空逻辑存在,但判空失败分支返回 ACLNN_ERR_PARAM_INVALID(161002)而非规范的 ACLNN_ERR_PARAM_NULLPTR(161001)。违反 CANN 接口规范:必选指针参数为 nullptr 时必须返回 161001。

复现步骤
cd /opt/mjl/exp0829/ops-nn
source /usr/local/Ascend/ascend-toolkit/latest/set_env.sh
bash build.sh -u --noexec --ops=quant_max --soc=ascend910b -j8
BIN=build/tests/ut/op_api/nn_op_api_ut
$BIN --gtest_filter="l2_quant_max_nullptr_test.quant_max_nullptr_test_roundmode_nullptr"

退出码 1(断言 FAIL:期望 161001,实际 161002)

预期行为
返回 ACLNN_ERR_PARAM_NULLPTR(161001)。

实际行为
返回 ACLNN_ERR_PARAM_INVALID(161002)。

错误码对照
参数 期望返回码 实测返回码
roundMode = nullptr 161001 (ACLNN_ERR_PARAM_NULLPTR) 161002 (ACLNN_ERR_PARAM_INVALID)
缺陷点
文件:quant/quant_max/op_api/aclnn_quant_max.cpp
行号::139-141
if (roundMode == nullptr) {
OP_LOGE(ACLNN_ERR_PARAM_INVALID, "roundMode cannot be nullptr");
return ACLNN_ERR_PARAM_INVALID; // 应为 ACLNN_ERR_PARAM_NULLPTR
}
修复建议
将 :140 的 ACLNN_ERR_PARAM_INVALID 改为 ACLNN_ERR_PARAM_NULLPTR,日志同步调整。

复现材料
用例:quant/quant_max/tests/ut/op_api/test_aclnn_quant_max_nullptr_check.cpp(quant_max_nullptr_test_roundmode_nullptr)
日志:/opt/mjl/exp0829/ops-nn/nullptr_audit/logs/l2_quant_max_nullptr_test.log
一键复现:bash /opt/mjl/exp0829/ops-nn/nullptr_audit/repro.sh --case=3

Environment / 环境信息 (Mandatory / 必填)

参考问题描述,脚本看评论附件

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

参考问题描述,脚本看评论附件

Describe the expected behavior / 预期结果 (Mandatory / 必填)

参考问题描述,脚本看评论附件

参考问题描述,脚本看评论附件

Special notes for this issue/备注 (Optional / 选填)

likedislike
majinglan
majinglan
26 天前 评论:
yuning_chenyuning_chen成员
26 天前 将 Hana77 设为负责人
yuning_chen
yuning_chen成员
26 天前 评论:

您好,感谢反馈,问题已收到,当前 @Hana77 正在跟踪处理。

likedislike
HHana77成员
16 天前 将 jiaoyiming 设为负责人
HHana77成员
16 天前 移除了负责人 Hana77
HHana77成员
16 天前 将 Hana77 设为负责人
HHana77成员
16 天前 移除了负责人 Hana77
Yyuanbin_22成员
16 天前 关联了pull request:fix(quant_max): roundMode判空返回码改为ACLNN_ERR_PARAM_NULLPTR
yuanbin_22成员
16 天前 评论:

/assign

likedislike
CANN-robotCANN-robot成员
16 天前 将 yuanbin_22 设为负责人
yuanbin_22成员
8 天前 评论:

/assign majinglan

likedislike
Yyuanbin_22成员
8 天前 将 majinglan 设为负责人
majinglanmajinglan
2 天前 issue状态由 进行中 改变为 已完成
majinglanmajinglan
2 天前 关闭了 issue
CANN-robotCANN-robot成员
2 天前 添加了label:resolved