已关闭
[Bug-Report|缺陷反馈]: aclnnInplaceQuantScatter/V2 的 reduction 不校验也不透传(硬编码update),axis/quantAxis 同样未校验 #6625
liuhanwen8创建于 23 天前关闭于 4 天前
23 天前 添加了label:bug-report
yuning_chen
23 天前 评论:
23 天前 评论:
23 天前 将 bartonfang 设为负责人
yuning_chen
23 天前 评论:
23 天前 评论:
您好,问题已收到,当前 @bartonfang 正在处理中。


10 天前 将 huang-jz 设为负责人
10 天前 移除了负责人 bartonfang
4 天前 关闭了 issue
4 天前 添加了label:resolved
Describe the current behavior / 问题描述
aclnnInplaceQuantScatter(及 V2)的reduction入参在GetWorkspaceSize内既不校验也不透传 l0op:l0op 调用使用硬编码const std::string reduce = "update";。index/quant_update_scatter/op_api/aclnn_quant_scatter.cpp::152-156签名含int64_t reduction;:159仅出现在DFX_IN;:199const std::string reduce = "update";;:202-204l0op::QuantUpdateScatter(..., reduce, ...)传硬编码值,用户传入的reduction从未被使用。V2 同构:
aclnn_quant_scatter_v2.cpp:177-181 / :185 / :225 / :228-230;且同文件的roundMode经CheckRoundMode(:172)严格校验——同文件内两属性校验待遇不一致,佐证是遗漏而非设计。文档
docs/aclnnInplaceQuantScatter.md规定:reduction取值支持 1(update)、axis只支持 -2、quantAxis取值支持 -1 或 len(updates.shape)-1。Environment Information / 环境信息
Steps to reproduce the issue / 重现步骤
按文档示例构造:selfRef [1,1,32] INT8(预填 5)、indices [1] INT32(值 0)、updates [1,1,32] FP16(全 1.0)、quantScales [1,1,32] FLOAT(全 0.5)、quantZeroPoints [1,1,32] INT32(全 0);量化后 updates = round(1.0/0.5)+0 = 2,故 update 语义下 selfRef 首元素应变为 2(若按 add 语义则为 7)。
aclnnInplaceQuantScatterGetWorkspaceSize(...);aclnnInplaceQuantScatter;Describe the expected behavior / 预期结果
reduction非 1(或 axis 非 -2、quantAxis 非 -1/rank-1)应返回ACLNN_ERR_PARAM_INVALID(161002)。若设计上仅支持 update,也不应在签名暴露该入参并在文档声明取值。Related log / screenshot / 日志 / 截图
910B2 + CANN 9.2.0-beta.2 实测:
即:reduction 非法值静默成功且恒按 update 执行;axis/quantAxis 非法值第一段也放行,延迟到执行段才报错。
Special notes for this issue/备注
CheckParams中补CHECK_RET(reduction == 1, ACLNN_ERR_PARAM_INVALID)(建议同时补axis == -2、quantAxis ∈ {-1, rank-1}),并将校验后的值映射为字符串透传 l0op,使「声明—校验—透传」一致;reduction 必校验并透传在本仓mse_loss / l1_loss / binary_cross_entropy_with_logits_target_backward中已实现,本文件属遗漏;aclnn 接口Bug日报_20261009卡片 ACLNN-20261009-01;本 issue 在原卡片基础上补充了 axis/quantAxis 同样未校验的实测证据。