Pull Request已成功合入, 合并人@CANN-robot
(感谢 klein8793 的贡献)变更摘要
本 PR 为 IndexFill 算子补充 fp4 系列数据类型(DT_HIFLOAT4、DT_FLOAT4_E2M1、DT_FLOAT4_E1M2)在 Ascend 960 平台(ascend960dt / ascend960pr)上的支持,并为此引入了新的 IndexFillSimdDmaTiling 模板与对应的 IndexFillSimdDmaImpl kernel,同时在公共 tiling 中增加 fp4 相关的芯片与尾轴校验、数据类型与规模换算,以及各 kernel 中 fp4 填充值的位拼接处理。
主要改动
- 新增 fp4 数据类型与 Ascend 960 配置:算子原型
index_fill_proto.h的IndexFill输入x/val与输出y增加DT_HIFLOAT4、DT_FLOAT4_E2M1、DT_FLOAT4_E1M2,index_fill_def.cpp新增ascend960XDataType、ascend960IndicesDataType、ascend960FormatList并向AICore()注册ascend960dt、ascend960pr两个config_960配置。 - 新增 SIMD DMA 模板与 kernel:新增
IndexFillSimdDmaTiling(index_fill_tiling_simd_dma.h/.cpp,注册优先级 1,原 SIMD 模板改为 2)与IndexFillSimdDmaImpl(op_kernel/arch35/index_fill_simd_dma.h),并在index_fill_apt.cpp中按TPL_MODE_TEMPLATE_SIMD_DMA分派 B32/B64 两种索引位宽。 - tiling key 扩展:
index_fill_tiling_key.h新增TPL_MODE_TEMPLATE_SIMD_DMA,TEMPLATE_MODE声明位宽由 2 调整为 3,并为各模板选择项补充ASCENDC_TPL_KERNEL_TYPE_SEL(ASCENDC_TPL_MIX_AIV_1_0)。 - fp4 校验与数据换算:
index_fill_tiling_common.cpp新增CheckSupportForHif4,对 fp4 类型校验芯片架构为NpuArch::DAV_9201且尾轴Q为偶数,随后将Q与numel减半、dtype置为DT_INT8并置fp4Support = 1;同时新增isAscend960DT记录当前架构。 - fp4 填充值处理与结构体扩展:
index_fill_struct.h新增FOUR_BIT、HIGH_FOUR_BIT常量与各 TilingData 的fp4Mode字段及新的IndexFillSimdDmaTilingData,index_fill_simd.h、index_fill_simt.h、index_fill_simt_dense_indices.h、index_fill_simd_dma.h在fp4Mode下对fillValue执行高低 4 位复制。 - 配置与校验调整:新增
config/ascend960dt、config/ascend960pr下的index_fill_binary.json与index_fill_simplified_key.ini,并将公共 tiling 中 x/y 的 dtype、shape 及dim等校验改为OP_CHECK_IF+OP_LOGE的写法。


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 |
|---|---|---|
| */*/op_graph/*_proto.h | ✅ 王永光, 陈展熹, 上官秦南 (3/2) | ✅ 王永光 (1/1) |
| */*/op_host/*_def.cpp | ✅ 陈展熹, 王永光, 上官秦南 (3/2) | ✅ 王永光 (1/1) |
| index | ✅ 上官秦南, 陈展熹 (2/2) | ✅ 陈展熹 (1/1) |
| pooling | ✅ 陈展熹, 上官秦南 (2/2) | ✅ 陈展熹 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
klein8793, thanks for your pull request. All authors of the commits have signed the CLA. 👍


/lgtm


Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


描述
为 index_fill、avg_pool、avg_pool_v2 三个算子新增 ascend960dt(Ascend 960)芯片支持。
改动原因
Ascend 960 芯片推出,需要上述算子适配新平台,扩大算子可用硬件范围。
改动方法
关联的Issue
测试
文档更新
无
类型标签
AI/Agent生成声明