Closed
【Feature】triton算子(chunk_kda_bwd_kernel_wy_dqkg_fused)迁移mindspeed-ops仓 #8
LinShuaAdd on  May 18Closed at  Sep 22
LinShuaCollaborators
May 18 Create

任务描述

基于fla-org/flash-linear-attention开源仓库的triton源码,迁移优化triton算子在NPU上跑通及性能优化。
本期任务的具体信息如下:
(1)算子名称:chunk_kda_bwd_kernel_wy_dqkg_fused
(2) fla-org/flash-linear-attention开放仓库的算子源码链接:
https://github.com/fla-org/flash-linear-attention/blob/v0.4.1/fla/ops/kda/chunk_bwd.py
(3) 迁移指导文档:https://gitcode.com/Ascend/triton-ascend/blob/main/docs/zh/programming_guide.md
参考 skill 地址:https://gitcode.com/Ascend/agent-skills/tree/master/skills/simple-vector-triton-gpu-to-npu
(4) 开发平台:Atlas 800T A2或者A3

验收标准

一、任务交付件
本期任务为基于fla-org/flash-linear-attention开放仓库代码进行功能扩展,请合入开发代码。主要开发点如下:
(1) triton算子针对NPU的适配修改优化后的代码
(2) 针对该triton算子的测试用例UT
二、验收标准:
1)精度/性能要求
精度:
对比GPU相同输入算子精度误差小于0.1%
若无GPU标杆,与CPU小算子对齐,精度误差小于0.1%
性能:
补充说明:具体性能对比数据呈现,按 CV类算子达到0.7x竞品, VV类算子达到0.9x竞品
以下以竞品A100为例说明计算具体的性能对比要求:

  • 1.先计算当前运行NPU设备与对应竞品GPU的算力换算比例
硬件规格 910B2 A100 910B2/A100
Cube算力 354 312 1.13x
Vector算力 11.06 19.5 0.56x
带宽 1800 2039 0.88x
  • 2.根据算力换算比例计算对应算子类在不同bound场景的实际性能要求

910B2 VS A100

bound场景 CV类算子(0.7X) VV类算子(0.9x)
Cube算力bound场景 0.8x 1.0X
Vector算力bound场景 0.4x 0.5X
Memory bound场景(HBM) 0.6x 0.8x

计算式子:以CV类算子的Cube算力bound场景为例:1.13 * 0.7 =0.8
2)实践文档:
triton算子介绍1篇
3)任务完成标准
本次任务完成标准为:
精度/性能(根据实际要求)达标,PR完成合入,实践文档提交到仓库issue。

PR 合入

本地完成测试验证后,向MindSpeed-Ops的master分支发起PR。

对接人

LinSHua

欢迎加入社区,感谢您对社区的贡献 🎉!

likedislike
LLinShuaCollaborators
May 18 Change title to "【Feature】triton算子(chunk_gla_fwd_o_gk)迁移mindspeed-ops仓", originally titled "【Feature】triton算子迁移mindspeed-ops仓".
LLinShuaCollaborators
May 18 Change title to "【Feature】triton算子(chunk_kda_bwd_kernel_wy_dqkg_fused)迁移mindspeed-ops仓", originally titled "【Feature】triton算子(chunk_gla_fwd_o_gk)迁移mindspeed-ops仓".
LLinShuaCollaborators
May 18 Modify description of issue
LLinShuaCollaborators
Jun 4 Added label: feature
Ronald1995Collaborators
Jun 11 Comments:

/label add good-first-issue

likedislike
ascend-robotascend-robotCollaborators
Jun 11 Added label: good-first-issue
wangx700
wangx700Collaborators
Jun 12 Comments:

/label add triage-review

likedislike
ascend-robotascend-robotCollaborators
Jun 12 Added label: triage-review
ryouyouuuu
ryouyouuuu
Jun 25 Comments:

认领这个任务

likedislike
Ronald1995Collaborators
Jun 25 Comments:

认领这个任务

@ryouyouuuu

抱歉,这个算子已经开发上库了,您可以认领其他任务。https://gitcode.com/org/Ascend/discussions/4

likedislike
Ronald1995Collaborators
Jun 25 Comments:

任务关闭

likedislike
zeshengzongzeshengzongCollaborators
Jul 2 associated Kanban: @zeshengzong的看板 20260702
ascend-robotascend-robotCollaborators
Jul 3 associated Kanban: MindStudio ISSUE管理
LliuzhexuCollaborators
Jul 11 Associated milestone: MindSpeed 26.2.0
LLinShuaCollaborators
Aug 7 Modify description of issue
梵高的呐喊
梵高的呐喊
Sep 17 Comments:

认领该任务

likedislike
xmzCollaborators
Sep 22 Comments:

该算子已开发上库,任务完成,关闭本 Issue。

证据:

  • 仓库维护者 @Ronald1995 于 2026-06-25 在本 Issue 回复「这个算子已经开发上库了」,并标注「任务关闭」。
  • PR #26([Feat] Add chunk kda backward op for Kimi Linear)已合入,后续 PR #105/#111 修复了精度问题。
  • master 已包含实现 mindspeed_ops/api/triton/chunk_kda_bwd.py(含 wy_dqkg_fused kernel)、UT tests/unit_tests/triton/test_chunk_kda_bwd.py、ATK 用例 tests/atk_tests/triton/chunk_kda_bwd/、算子文档 docs/zh/triton/chunk_kda_bwd.md。
likedislike
XxmzCollaborators
Sep 22 changed custom state from TODO to DONE
XxmzCollaborators
Sep 22 Close issue
ascend-robotascend-robotCollaborators
Sep 22 Added label: resolved