Closed
[Documentation|文档反馈]: TransData算子aclnnTransMatmulWeight接口输入空tensor场景,文档与算子实现未对齐 #3259
yyt_hwAdd on  Sep 20Closed at  16 days ago
yyt_hw
yyt_hwCollaborators
Sep 20 Create

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

一、文档链接 (必填)

\ops-math\conversion\trans_data\docs\aclnnTransMatmulWeight.md

二、问题文档片段 (必填)

算子实现:

  • GetWorkspaceSize 阶段 : mmWeightRef->IsEmpty() 为 true 时,直接返回 ACLNN_SUCCESS , workspaceSize = 0 ,executor 被创建但不挂载任何计算任务。
  • 执行阶段 : aclnnTransMatmulWeight 调用 CommonOpExecutorRun ,对空任务执行会正常走完流程返回 ACLNN_SUCCESS ,不会发起实际 kernel 计算。

文档:输入空tensor会返回错误码。
image.png
💡 存在的问题(选填)

likedislike
Xxujiachen8Collaborators
Sep 20 Assign yyt_hw as responsible person
陈思
陈思Collaborators
22 days ago Comments:

您好,感谢反馈!

已核对 cann/ops-math 提交 b19eaee4f58e5e1e3cb3b2ecbfed2d02c11c820a 的第一阶段实现:接口先检查空指针、数据类型、格式和形状;通过这些检查后,若 mmWeightRef->IsEmpty() 为真,则设置 workspaceSize=0、返回 executor 和 ACLNN_SUCCESS,不进入后面的 TransData 计算任务构造。因此“空 Tensor 一律返回参数错误”与这条实现分支不一致;空 Tensor 与空指针是不同情形。

关联的 PR !5874 已合入 master,PR !5917 已合入 9.2.0;两条变更均删除错误码表中“不支持空Tensor输入”的条目。当前基线的接口文档也已不含该条目。

本单所指出的文档矛盾已有对应修订,可使用包含上述提交的相应分支资料。调用仍应遵循两段式接口约定,空 Tensor 也不豁免其他参数约束。

likedislike
yyt_hwyyt_hwCollaborators
16 days ago changed custom state from 进行中 to 已解决
yyt_hwyyt_hwCollaborators
16 days ago Close issue