Pull Request has been successfully merged by CANN-robot.
(Thank you for wangqi_ai's contribution.)变更摘要
本 PR 将 master 分支已合入的 bitwise_and 新增 int8/uint8/uint32/uint64 数据类型支持(#5321)通过 cherry-pick 同步(backport)至 9.2.0 分支。此前 BitwiseAndTensor / BitwiseAndScalar / InplaceBitwiseAndTensor / InplaceBitwiseAndScalar 仅支持 int16/uint16/int32/int64 四种整型,本次将 kernel 侧、l0 层与 aclnn 接口的类型注册和支持列表扩展为 8 种整型,使 uint32/uint64 等按位与场景(如权重打包、掩码计算)可在 Ascend 950 上走 NPU AICore 加速路径,整体分派结构对齐同族算子 bitwise_or;计算与类型推导逻辑保持存量实现不变。同时 README 与 4 个 aclnn 接口文档同步了 uint32/uint64 类型说明。
主要改动
- kernel 侧类型注册扩展:
op_host/bitwise_and_def.cpp中 x1/x2/y 的DataType/Format注册由 4 种整型扩展为 8 种(新增 int8/uint8/uint32/uint64),op_host/config/ascend950/bitwise_and_binary.json同步新增BitwiseAnd_int8、BitwiseAnd_uint8、BitwiseAnd_uint32、BitwiseAnd_uint64四个 binary 条目 - tiling 模板分支扩展:
op_host/arch35/bitwise_and_tiling.cpp的DoOpTiling新增DT_INT8/DT_UINT8/DT_UINT32/DT_UINT64四个 dtype 分支,分别实例化对应BitwiseAndCompute模板执行BroadcastBaseTiling - l0 层 AICore 分派调整:
op_api/bitwiseand.cpp新增ASCEND950_AICORE_DTYPE_SUPPORT_LIST(8 种整型全走 AICore),IsAiCoreSupport改为按 910B(DAV_2201)/ RegBase(950)/ 其他硬件三类分别查表,对齐bitwise_or的既有分派结构,910B 与其余硬件支持列表保持不变 - aclnn 接口支持列表扩展:
aclnn_bitwise_and_tensor.cpp的DTYPE_SUPPORT_LIST扩展为 9 种(BOOL + 8 整型);aclnn_bitwise_and_scalar.cpp新增REGBASE_DTYPE_SUPPORT_LIST(950 上 scalar 支持 uint32/uint64),非 RegBase 平台维持原 7 种列表;计算与推导路径(双输入推导类型后转换到 out)保持存量实现不变 - UT 用例扩展: 新增 tensor uint32/uint64 用例、950 scalar uint32/uint64 门禁(910B 拒绝)、int→bool out 拒绝、混合 uint32|uint64 推导拒绝,以及收窄 / 升宽 / inplace / 弱标量(int64 标量不抬升 int32 推导)等接受面锚点用例


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 |
|---|---|---|
| */*/README.md | ✅ 陈娇, 汤平川 (2/2) | ✅ 陈娇 (1/1) |
| */*/docs/acl*.md | ✅ 陈娇, 汤平川 (2/2) | ✅ 陈娇 (1/1) |
| */*/op_host/*_def.cpp | ✅ 王永光, 汤平川 (2/2) | ✅ 王永光 (1/1) |
| math/bitwise_and | ✅ 汤平川, 宋恺 (2/2) | ✅ 汤平川, 宋恺 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
wangqi_ai, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/approve


/approve


您好,PR已满足合入指标,请尽快联系Committer进行合入。如暂时不需要合入,请在PR标题前加[WIP]


/lgtm
/approve


/approve


修改背景
本 PR 为 master 分支已合入的 PR #5321(bitwise_and新增int8/uint8/uint32/uint64数据类型支持)向 9.2.0 分支的同步迁移(backport)。
bitwise_and 系列算子(BitwiseAndTensor / BitwiseAndScalar / InplaceBitwiseAndTensor / InplaceBitwiseAndScalar)此前仅支持 int16 / uint16 / int32 / int64 四种整型,同族算子 bitwise_or 已支持全部 8 种整型;uint32 / uint64 等按位与场景(如权重打包、掩码计算)无法走 NPU AICore 加速路径。
修改内容
与 master 分支 PR #5321 完全一致(cherry-pick,patch-id 相同):
kernel 侧(Ascend 950 / arch35)
op_host/bitwise_and_def.cpp:x1/x2/y 类型注册从 4 种整型扩展为 8 种op_host/config/ascend950/bitwise_and_binary.json:新增 int8/uint8/uint32/uint64 四个 binary 条目op_host/arch35/bitwise_and_tiling.cpp:DoOpTiling 新增 4 个 dtype 模板分支l0 层
op_api/bitwiseand.cpp:新增 ASCEND950_AICORE_DTYPE_SUPPORT_LIST(8 种整型全走 AICore),IsAiCoreSupport 按 910B(DAV_2201)/ RegBase(950)/ 其他 三类分别查表,对齐 bitwise_or 的既有分派结构;910B 与其余硬件的支持列表不变aclnn 侧
aclnn_bitwise_and_tensor.cpp:接口 DTYPE_SUPPORT_LIST 扩展为 9 种(BOOL + 8 整型,与 bitwise_or 一致)aclnn_bitwise_and_scalar.cpp:新增 REGBASE_DTYPE_SUPPORT_LIST(950 上 scalar 支持 uint32/uint64),非 RegBase 平台维持原 7 种列表,与 bitwise_or 一致测试与文档
验证情况
本 PR 与 master 合入代码完全对齐(
math/bitwise_and/目录与 master 零差异),master 侧已完成的验证:--soc=ascend950与--soc=ascend910b均 26/26 通过风险说明