| Files | Last commit | Last update |
|---|---|---|
grouped_dynamic_mx_quant算子支持group_index int64类型 Co-authored-by: TH<taohai2@huawei.com> # message auto-generated for no-merge-commit merge: !9023 merge grouped_dynamic_mx_quantAdaptINT64 into master grouped_dynamic_mx_quant算子支持group_index int64类型 Created-by: TH_HW Commit-by: TH Merged-by: cann-robot Description: ## 描述 使 GroupedDynamicMxQuant 算子(含 aclnnGroupedDynamicMxQuant 与 aclnnGroupedDynamicMxQuantV2 接口)的 groupIndex 输入不再仅支持 INT32,而是同时支持 INT32、INT64 两种数据类型,满足上层框架以 int64 索引调用算子的需求。同时保持对既有 INT32 场景的完整兼容。 主要改动如下: 1. **算子描述与接口校验**:op_graph/grouped_dynamic_mx_quant_proto.h 中 group_index 的 TensorType 由 {DT_Int32} 扩展为 {DT_Int32, DT_Int64};op_api 与 op_host/op_api 头文件中补充 groupIndex 的 int64 支持说明;aclnn_grouped_dynamic_mx_quant.cpp / aclnn_grouped_dynamic_mx_quant_v2.cpp 的GROUP_INDEX_DTYPE_SUPPORT_LIST 增加 DT_INT64。 2. **Host 侧(Tiling/定义)**:tiling 校验集合 GROUPIDX_SUPPORT_DTYPE_SET 增加 DT_INT64,GroupedDynamicMxQuantTilingParam 新增 groupIndexType 字段,并在 SetTilingKeyParam 中将其编入 tiling key;grouped_dynamic_mx_quant_def.cpp 的数据类型组合表扩展为 int32/int64 与所有输入、输出类型的组合(共16组)。 3. **Binary 配置**:ascend950/grouped_dynamic_mx_quant_binary.json 为各 x 输入类型(fp16/bf16)与输出类型(fp8_e4m3fn、fp8_e5m2、fp4_e2m1、fp4_e1m2)组合补充了 group_index 为 int64 的 _int64 二进制算子配置。 4. **Kernel 侧**:GroupedDynamicMxQuantCombine 模板新增 GroupIndexT 类型参数,GlobalTensor<GroupIndexT> 读取分组索引;公共切分基类 GroupedSplitBase::GroupedSplit 同步模板化 GroupIndexT;grouped_dynamic_mx_quant_struct.h 新增 TPL_GROUP_INDEX_INT32/TPL_GROUP_INDEX_INT64 模板实参选择;grouped_dynamic_mx_quant.cpp 入口通过 if constexpr 依据 tiling key 中的 groupIndexType 分发实例化。 5. **文档更新**:README 与 aclnnGroupedDynamicMxQuant / aclnnGroupedDynamicMxQuantV2 接口文档中 groupIndex 支持类型由 INT32 更新为 INT32、INT64。 6. **单测适配**:test_grouped_dynamic_mx_quant.cpp 中 kernel 调用补充新增的 groupIndexType 模板实参。 ## 关联的Issue 无。 ## 测试 - 对 group_index 均为 int32、int64 时逐用例执行了 tests/ut/op_kernel/test_grouped_dynamic_mx_quant.cpp 中现有用例验证(bf16→fp8/fp4、fp16→fp8/fp4 等多种输入输出组合),结果均通过。 - 新增/回归验证了 tiling key 中 groupIndexType 的取整与算子 bin 选择在 asc 引擎上的绑定正确性。 ## 文档更新 更新了以下文档: - quant/grouped_dynamic_mx_quant/README.md - quant/grouped_dynamic_mx_quant/docs/aclnnGroupedDynamicMxQuant.md - quant/grouped_dynamic_mx_quant/docs/aclnnGroupedDynamicMxQuantV2.md ## 类型标签 <!-- [x] 表示选中 --> - [x] 新特性 - [ ] Bug修复 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [x] AI辅助编写 See merge request: cann/ops-nn!9023 | 2 months ago | |
DynamicQuant等22个算子支持Ascend960dt Co-authored-by: TH_HW<taohai2@huawei.com> # message auto-generated for no-merge-commit merge: !11335 merge backBlue into master DynamicQuant等22个算子支持Ascend960dt Created-by: TH_HW Commit-by: TH_HW Merged-by: cann-robot Description: ## 描述 (+17812 / -2151)为一批 ops-nn 算子补齐 **Ascend 960DT(NPU Arch 9201)** 平台支持,并重构 GeGluV2 arch35 内核、为 Erfinv 增加 inplace 通路。 主要改动如下: 1. **Ascend960DT 平台适配(22 个算子)** - activation:Relu、ReluV2、ReluGrad、ReluGradV2、Sigmoid、SigmoidGrad、PRelu、PReluGradUpdate、SiluGrad、Softplus、Swish、SwishGrad、SwiGluGrad、GeGluV2。 - index:MapIndex、SparseSlice、QuantUpdateScatter。 - quant:Quantize、DynamicQuant、DynamicQuantV2、AntiMxQuant、GroupedDynamicMxQuant。 - 具体做法:CMakeLists.txt 的 SUPPORT_COMPUTE_UNIT / SUPPORT_TILING_DIR 增加 ascend960dt;*_def.cpp 增加 AddConfig("ascend960dt", ...);aclnn/op_api 与 infershape 增加 NpuArch::DAV_9201 / Ascend960DT 分支;kernel 增加 __NPU_ARCH__ == 9201 分支;新增 op_host/config/ascend960dt/ 下的算子二进制配置(共 22 个,如 relu_binary.json、p_relu.json 等);scripts/kernel/binary_config/ascendc_config.json 为相关算子登记 ascend960dt 计算单元与编译选项。 2. **GeGluV2 arch35 内核重构** - 将 arch35 模板按 erf / tanh 两类拆分,并补齐 align、align_last_axis_big、vreduce × fp16/bf16/fp32 变体,统一命名 *_arch35.h。 - tiling 新增 RegBase per-template per-element UB 预算模型(GetRegbasePerElem),并支持 ascend960dt。 - aclnnGeGlu 参数校验重构(CheckShape 支持 0D 输入与 dim 范围校验),新增 ST 用例(all_aclnnGeGlu(.V3).json)并调整 UT。 3. **Erfinv 支持 inplace**:新增 inplace dtype 支持列表与校验(GetInplaceDtypeSupportList / CheckInplaceDtypeValid),并补充 op_api UT。 4. **内核与接口修复** - SparseSlice:9201 路径改用 SetValue 写入 sliceStart/sliceEnd(替代 DataCopy),Reg::Reduce 使用完整命名空间限定。 - QuantUpdateScatter:9201 增加 FLOAT_OVERFLOW_MODE_CTRL 保护。 - ReluV2 infershape:Ascend960DT 不支持 NC1HWC0,UINT1 支持列表加入 Ascend960DT。 - DynamicQuant / Mx 量化:9201 上 fp8 scale 改为 bf16 乘法后再 cast 到 e8m0。 5. **代码规范**:统一 License 头注释格式、补齐文件末尾换行、调整 quant 系列 UT 的 CMakeLists;新增 MapIndex、SparseSlice 的 GE IR 图模式示例。 ## 关联的Issue 无。 ## 测试 - 新增 GeGluV2 ST 用例与 Erfinv inplace UT,补充/调整 GeGluV2 相关 UT。 - 新增 MapIndex / SparseSlice 的 GE IR 示例(examples/test_geir_*.cpp)。 - 通过 ascend960dt 编译与静态检查。 ## 文档更新 无。 ## 类型标签 <!-- [x] 表示选中 --> - [x] 新特性 - [ ] Bug修复 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [x] AI辅助编写 See merge request: cann/ops-nn!11335 | 1 month ago |
| Files | Last commit | Last update |
|---|---|---|
| 2 months ago | ||
| 1 month ago |