Closed
[Documentation|文档反馈]: aclnnDynamicQuantV3/V4 头文件中的 yOut shape 说明不完整 #6647
KaranocaVeAdd on  Oct 13Closed at  23 days ago
KaranocaVe
KaranocaVe
Oct 13 Create

[Documentation|文档反馈]: aclnnDynamicQuantV3/V4 头文件中的 yOut shape 说明不完整

问题

V3 和 V4 公共头文件都称 yOut 与 x shape 相同。INT32 输出会把 8 个 INT4 打包为一个 INT32,因此调用方若按该注释创建同形输出,会在 API shape 校验阶段失败。

复现

设置 dstType=DT_INT32 且 x shape 为 [16,32]。头文件注释暗示 yOut 为 [16,32],而 API 要求 [16,4]。

预期 / 实际

  • 预期:INT32 输出时,yOut 与 x 维数相同、前置维度相同,末维为 x 末维的 1/8。
  • 实际:V3/V4 头文件均称 yOut 与 x shape 一致。

修复或请求

修正 V3/V4 头文件注释,说明 INT32 的末维例外;其他输出类型仍与 x 同 shape。

Validation

  • Host validation requires INT32 yOut to have the same rank and leading dimensions as x, with the last dimension one eighth of x's. The V3/V4 API references document this rule.
  • An existing V3 Host API UT covers BFLOAT16 [16,32] input and INT32 [16,4] output; V3 and V4 share the same shape validation. No NPU UT was run for this comment-only change.
  • git apply --unidiff-zero --check fix.patch and git diff --check pass on current master. pre-commit 4.3.0 passes for both headers, including clang-format 18.1.8, codespell, and OAT checks.
likedislike
yuning_chen
yuning_chenCollaborators
29 days ago Comments:

初步分析

感谢反馈。

现象理解:aclnnDynamicQuantV3/V4 头文件写 yOut 与 x 同 shape。dstType 为 INT32 时,描述称末维应按 8 个 INT4 打包,API 要求末维为 x 末维的八分之一。

当前判断:初步判断,待复现确认。

涉及范围:V3/V4 头文件注释与 Host shape 校验。

下一步:对照校验和接口文档。若 INT32 末维例外属实,只改注释,其他输出类型仍与 x 同 shape。

likedislike
yuning_chenyuning_chenCollaborators
29 days ago Assign jiaoyiming as responsible person
yuning_chen
yuning_chenCollaborators
29 days ago Comments:

您好,问题已收到,当前问题 @jiaoyiming 正在处理中。

likedislike
CANN-robotCANN-robotCollaborators
23 days ago Close issue
CANN-robotCANN-robotCollaborators
23 days ago Added label: resolved