| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[Feature][ops]Restrict FIA to MindIE-SD FP8 per-block path Co-authored-by: HAAZZZEEEE<wang-taicheng@qq.com> # message auto-generated for no-merge-commit merge: !439 merge restrict_fp8_path into dev [Feature][ops]Restrict FIA to MindIE-SD FP8 per-block path Created-by: HAAZZZEEEE Commit-by: HAAZZZEEEE Merged-by: ascend-robot Description: # Which issue(s) this PR fixes or accomplishes Fixes [#198](https://gitcode.com/Ascend/MindIE-SD/issues/198) # Purpose 目前EagleFusedInferAttentionScore编译包含的tiling key太多,导致ci编译时间裂化至3h+。 收口 EagleFusedInferAttentionScore 的运行时能力范围,只放行 MindIE-SD 所需的 FP8 E4M3FN per-block 路径,拒绝已删除的历史能力(noquant、anti-quant、INT8、HIFLOAT8、MXFP8、PA、mask、rope、prefix、sparse 等)。 具体改动: - **第一重 guard(host checker 入口)**:新增 FIAChecker::CheckMindIESDFp8PerblockScope,在 Process() 入口拦截非 FP8 per-block 的输入,拒绝 noquant / anti-quant / INT8 / HIFLOAT8 / MXFP8 / 非 7-7-7 quant mode / 非 BNSD/BSH/BSND/NTD layout / 非 D64/D128 / PA / mask / rope / prefix / sparse 等。 - **第二重 guard(tiling key 兜底)**:新增 FusedInferAttentionScoreTilingImpl::CheckMindIESDFp8PerblockTilingKey,在 GenTilingKey 最终 SetTilingKey 前再次校验,只放行 BNSD/BSH/NTD layout + D64/D128 + per-block quant + 无 mask/rope/PSE/PA/FD/prefix/S1 split 的 tiling key。 - **dequant checker 收口**:从 CheckDataTypeSupportFullquant 的全量 dtype 支持列表中移除 INT8 和 HIFLOAT8,只保留 (FLOAT8_E4M3FN, FLOAT8_E4M3FN, FLOAT16/BF16)。 - **tiling 模板收口**:删除 fused_infer_attention_score_template_tiling_key.h(2394 行),该文件包含了已废弃的 noquant、anti-quant、MLA、GQA、MXFP8 等历史 tiling key 模板。 - **CSV 用例刷新**:用收口后的 278 个 tiling UT case(277 FAILED + 1 SUCCESS)替换旧 CSV,旧 CSV 中标记为 SUCCESS 但能力已删除的 case 全部改为 FAILED。 - **Python 测试加强**:将 FP8 per-block NPU pytest 从 FP16 直调改为 fa_block_quant_preprocess 构造真实 FP8 E4M3FN per-block Q/K/V,新增 BF16 输出和 D64 case。 # Test Plan - 950/A5 环境: - bash tests/ops/eagle_fused_infer_attention_score/run_eagle_fia_arch35_ut.sh 完整运行,确认 277 个 FAILED case 均被 guard 正确拦截、1 个 SUCCESS case 通过。 - pytest tests/ops/fused_infer_attention_score/test_fused_infer_attention_score_v2.py -v 运行 FP8 per-block NPU cases。 # Test Report pass CI时间恢复到算子迁移前。(https://gitcode.com/Ascend/MindIE-SD/pull/407) See merge request: Ascend/MindIE-SD!439 | 30 天前 | |
[Feature][ops]Add mul_add fused operator support Co-authored-by: wangwei<daviwang2026@qq.com> # message auto-generated for no-merge-commit merge: !481 merge feature/mul_add_ops_dev into dev [Feature][ops]Add mul_add fused operator support Created-by: daviwang Commit-by: wangwei Merged-by: ascend-robot Description: # Purpose 新增 mul_add 融合算子,支持在昇腾 NPU 上执行融合乘加计算: - 算子接口:mindiesd::mul_add(a, b, c) -> y - 计算公式:y = a + b * c - 输入 shape:a/b = [batch, seq_len, hidden_size],c = [batch, 1, hidden_size] - 支持数据类型:FP16、BF16 - 支持计算平台:ascend910b、ascend910_93、ascend950 主要变更: 1. 在 csrc/ops/mul_add/ 下新增算子定义(OpDef)、shape/dtype 推导(proto)、tiling 计算及 AscendC kernel 实现。 2. 在 csrc/plugin/ 下新增 mul_add PTA plugin,并在 register_ops.cpp 中注册到 mindiesd torch 库。 3. 更新 csrc/CMakeLists.txt,将 mul_add.cpp 加入 PTAExtensionOPS 编译。 4. 更新 build/build_ops.sh 默认算子列表,确保默认构建包含 mul_add。 5. 在 tests/ops/mul_add/ 下新增单元测试,覆盖基础 shape、典型 LLM shape、小 shape 边界及 FP16 精度场景。 # Test Plan > 设计了哪些测试内容,指导他人如何对你的PR进行测试\ > Apply information to show others your test design and how to test your Pull Request 1. 编译 AscendC 算子: bash cd build bash build_ops.sh 2. 编译 PTA plugin: bash cd build bash build_plugin.sh 3. 运行 mul_add 单元测试(需在 NPU 环境): bash cd tests/ops/mul_add python test_mul_add.py 4. 可选:通过环境变量指定 NPU 卡号: ``bash MINDIESD_TEST_NPU_ID=7 python test_mul_add.py # Test Report • 测试覆盖: • 基础小 shape:(1, 4, 128) • 典型 LLM shape:(1, 7200, 4608)、(1, 256, 4608)、(1, 7200, 3072)、(1, 256, 3072) • 多组小 shape 边界:(1, 1, 64) ~ (1, 64, 1024) • FP16 精度:(1, 256, 3072) • 参考实现:ref = a.float() + b.float() * c.float() • 精度阈值:rtol=1e-2, atol=1e-2 - 运行环境:CANN 9.1.T560, Ascend950PR NPU, Python 3.11, aarch64 - 所有新增测试用例均通过: - test_mul_add_basic PASSED - test_mul_add_typical PASSED - test_mul_add_small_shapes PASSED - test_mul_add_fp16` PASSED - 最大误差:BF16 < 1e-2,FP16 < 1e-2 See merge request: Ascend/MindIE-SD!481 | 9 天前 | |
[Feature][ops]Add norm_rope_concat fused operator Co-authored-by: zhangtian6691844<zhangtiantian5@huawei.com> # message auto-generated for no-merge-commit merge: !455 merge feat/norm_rope_concat_dev into dev [Feature][ops]Add norm_rope_concat fused operator Created-by: zhangtian6691844 Commit-by: zhangtian6691844 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20251224 --> # Which issue(s) this PR fixes or accomplishes > **如问题已解决,按照下方示例附上ISSUE单号 / Apply bug or request issue as follow if the solved**\ > Fixes #ISSUE ID\ > **Fixes关键字会自动关闭issue,如问题部分解决请不要使用Fixes,可以用下方标签替代\ > Fixes will automatically close issue, please use the following tag if only part of the issue is solved**\ > Fix part of #ISSUE ID N/A — 新增特性,非问题修复。 # Purpose 为 MindIE-SD 新增 **NormRopeConcat 融合算子**,将三个高频操作(LayerNorm/RMSNorm、RoPE 旋转位置编码、KV Concat)融合为一个 AscendC 自定义算子,减少显存访问次数和 kernel launch 开销,提升大模型推理性能。 **算子功能:** - 对 Query/Key 输入执行 LayerNorm 或 RMSNorm(可选 affine) - 对 Query/Key 执行 RoPE 旋转位置编码(支持 interleave / half 两种模式) - 将 encoder KV 与当前 KV concat 拼接(支持 encoder 在前或在后) - 支持训练模式,输出 norm 的 mean/rstd 用于反向传播 - 支持 16 个输入、11 个输出,全部可选张量自动处理 **变更范围(18 files, +3819/-6 lines):** | 模块 | 文件 | 说明 | |------|------|------| | AscendC Host | csrc/ops/norm_rope_concat/op_host/ (6 files) | 算子定义、Shape/Dtype 推导、Tiling 策略 | | AscendC Kernel | csrc/ops/norm_rope_concat/op_kernel/ (4 files) | NPU 核函数实现 | | PyTorch 插件 | csrc/plugin/norm_rope_concat.{cpp,h} (2 files) | 插件适配层,调用 ACLNN 接口 | | 构建集成 | build/build_ops.sh, csrc/CMakeLists.txt, csrc/plugin/register_ops.cpp | 算子注册与编译 | | 单元测试 | tests/ops/norm_rope_concat/ (3 files) | Python 功能测试 + C++ Kernel UT | # Test Plan > 设计了哪些测试内容,指导他人如何对你的PR进行测试\ > Apply information to show others your test design and how to test your Pull Request 1. **编译验证** - AscendC 算子编译(ascend910_93 / ascend910b / ascend950 三芯片) - PyTorch 插件编链(libPTAExtensionOPS.so) - 构建环境:CANN 9.1.T560 + bisheng + PyTorch 2.x 2. **单元测试(Python)** - test_norm_rope_concat.py:覆盖 norm_type (NONE/LAYER_NORM/RMS_NORM)、rope_type (NONE/INTERLEAVE/HALF)、concat_order (BEFORE/AFTER)、训练模式等组合 - run_simple_test.py:快速冒烟测试 3. **C++ Kernel UT** - test_norm_rope_concat_kernel.cpp:验证 Tiling 数据传递与 kernel 逻辑正确性 4. **回归验证** - 已有算子(LA、AdaLA、RainFusionAttention 等)编译不受影响 - build_ops.sh 中 norm_rope_concat 作为 ascendc_ops 之一参与构建 # Test Report | 测试项 | 芯片 | 结果 | |--------|------|------| | AscendC 编译 (op_host_aclnn) | - | ✅ PASS | | AscendC 编译 (opsproto) | - | ✅ PASS | | AscendC 编译 (optiling) | - | ✅ PASS | | AscendC Kernel 生成 | ascend910_93 | ✅ PASS | | AscendC Kernel 生成 | ascend910b | ✅ PASS | | AscendC Kernel 生成 | ascend950 | ✅ PASS | | CANN-custom_ops .run 打包 | - | ✅ PASS | | PyTorch 插件编译链接 | - | ✅ PASS (100%) | | 已有算子兼容性 | - | ✅ 无影响 | **测试环境:** CANN 9.1.T560, Ascend950PR NPU, Python 3.11, aarch64 See merge request: Ascend/MindIE-SD!455 | 13 天前 | |
feat: quant_flash_attn and quant_flash_attn_metadata operators Co-authored-by: lijinxi<lijinxi2@huawei.com> # message auto-generated for no-merge-commit merge: !313 merge dev into dev feat: quant_flash_attn and quant_flash_attn_metadata operators Created-by: weixin_44144262 Commit-by: lijinxi Merged-by: ascend-robot Description: # Which issue(s) this PR fixes or accomplishes > Fix part of #136 # Purpose 新增mxfp4的fa算子,配套的还有一个aicpu的metadata算子 # Test Plan 运行tests/ops/quant_flash_attn/quant_flash_attn_golden.py测试单算子精度 # Test Report  See merge request: Ascend/MindIE-SD!313 | 2 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 30 天前 | ||
| 9 天前 | ||
| 13 天前 | ||
| 2 个月前 |