Merged
[ChunkKdaFwd] 新增 KDA 分块正向算子 #9979
[ChunkKdaFwd] 新增 KDA 分块正向算子 #9979
Merged
BartonFangAdd on Aug 12
BartonFang
BartonFangCollaborators
Aug 12

描述

新增 ChunkKdaFwd 正向算子,在一次主 kernel launch 内完成 gate cumsum、Prepare/PostWU、独立 FwdH 和 Finalize。支持 A2/A3/A5、BSND/BNSD/TND/NTD 输入布局、可选输出、safe gate 和 `state_v_first。

数值路径保持 BF16 矩阵输入、FP32 累加;三角矩阵求逆和跨 chunk 状态迭代保持 FP32,并关闭 HF32。未修改任何已有算子原型或 ABI。

关联的Issue

关联 Issue #4208:https://gitcode.com/cann/ops-transformer/issues/4208

测试

  • A2/A5 算子包构建通过。
  • A2/A5 功能与精度验证通过,覆盖 BSND/BNSD/TND/NTD、可选输出、BF16 gate 参数、varlen tail 和 state_v_first。
  • A2/A5 同输入交叉对比的 11 个有效输出通过既有精度标准。
  • A5 H96/T16K 关键场景连续 50 次执行二进制一致。
  • A5 关键场景完整 device 路径最大耗时 10.676 ms,满足不超过 11 ms 的性能门禁。
  • 隔离 wheel 安装、JIT 编译和 NPU 调用通过。
  • git diff --check、提交对象检查和 Python 语法检查通过。

文档更新

新增 ChunkKdaFwd README、设计文档、aclnn API 文档、接口索引。

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for BartonFang's contribution.)
BartonFangBartonFangCollaborators
Aug 12 Created pull request, commit 47d9adf7
atomgit-bot
atomgit-bot
Aug 12 Comments:

🤖 正在生成合并请求摘要,请稍候…

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Aug 12 Added label: stat/needs-squash
CANN-robotCANN-robotCollaborators
Aug 12 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Aug 12 Comments:

CLA Signature Pass

bartonfang, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
64 messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
Aug 13 Added label: lgtm
CANN-robotCANN-robotCollaborators
Aug 13 Closed associated issue
CANN-robotCANN-robotCollaborators
Aug 13 Merged pull request
weinachuanweinachuanCollaborators
Aug 24 Deleted associated issue: [Bug-Report|缺陷反馈]: chunk_kda_fwd存在部分多余注释需清除
weinachuanweinachuanCollaborators
Aug 24 Associated issue: [Requirement|需求建议]: 新增 ChunkKdaFwd 正向算子