Merged
fix(operation): Restrict LogicalNot integer dtypes to A5 #5885
bynshardAdd on Sep 3
fix(operation): Restrict LogicalNot integer dtypes to A5 #5885
Merged
bynshardAdd on Sep 3
bynshard
bynshardCollaborators
Sep 3

由于 A2/A3 的 TMINS 和 TGATHER 指令不支持当前整数实现所需的数据类型,
将 LogicalNot 的 DT_INT16、DT_UINT16、DT_INT32 和 DT_UINT32 支持限制为仅适用于 A5 架构。

更新 LogicalNot 文档,明确 A2/A3 与 A5 支持的数据类型,并新增架构相关的校验测试。

Related Issue: #3207

更多描述信息见:Commit Message 规范

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for bynshard's contribution.)
bynshardbynshardCollaborators
Sep 3 Created pull request, commit 37b41217
atomgit-bot
atomgit-bot
Sep 3 Comments:

变更摘要

本 PR 针对 LogicalNot 算子的数据类型支持做架构限制修复:由于 A2/A3 架构的 TMINS 与 TGATHER 指令不支持整数实现所需的数据类型,将 DT_INT16、DT_UINT16、DT_INT32、DT_UINT32 的支持从 A2/A3 集合中移除,仅保留在 A5 架构(LogicalNot 的 LOGICALNOT_A2A3_TYPES 与 LOGICALNOT_A5_TYPES 分别定义),并同步更新接口文档与新增按架构区分的单元测试。

主要改动

  • 收紧 logical.cpp 中 A2/A3 支持的整数类型:从 LOGICALNOT_A2A3_TYPES 中删除 DT_INT16、DT_INT32、DT_UINT16、DT_UINT32,仅保留 DT_FP32、DT_FP16、DT_UINT8、DT_INT8、DT_BOOL、DT_BF16;LOGICALNOT_A5_TYPES 仍保留上述整数类型及 DT_INT64,使 16/32 位整数输入在 A2/A3 上执行 LogicalNot 时被 CheckTensorDataType 拦截。
  • 更新 LogicalNot_UnsupportedDataType 测试:测试前将 NPU 架构设为 NPUArch::DAV_2201(A2),验证 DT_INT32 输入抛出异常,用例结束后复位为 NPUArch::DAV_UNKNOWN。
  • 新增 LogicalNot_A5SupportedDataType 测试:将架构设为 NPUArch::DAV_3510(A5),验证 DT_UINT32 输入调用 LogicalNot 不再抛出异常,并复位架构状态。
  • 更新 LogicalNot 文档:按 PR 描述明确 A2/A3 与 A5 架构各自支持的数据类型范围,与本次代码层面的限制保持一致。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
Sep 3 Comments:

代码审查

✅ 未发现问题

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Sep 3 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Sep 3 Comments:

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.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.


PR Approval Progress

✅ Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
docs ✅ 尹杰, lyz0328, 林嘉树 (3/2) ✅ 尹杰, lyz0328 (2/1)
framework/src/interface/operation ✅ 尹杰, 林嘉树 (2/2) ✅ 尹杰 (1/1)
framework/src/interface/tileop/vector ✅ 尹杰, 林嘉树 (2/2) ✅ 尹杰 (1/1)
repo-cann/pypto ✅ 尹杰, 林嘉树 (2/2) ✅ 尹杰 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

bynshard, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
75 messages are collapsed here。 See more
lyz0328
lyz0328Collaborators
Sep 4 Comments:

/approve

likedislike
linjiashu
linjiashuCollaborators
Sep 4 Comments:

/lgtm

likedislike
Jie Yin
Jie YinCollaborators
Sep 4 Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
Sep 4 Added label: lgtmapproved
CANN-robotCANN-robotCollaborators
Sep 4 Merged pull request