已合并
Support sparse attention kv merge #6429
huzhipeng创建于 6月4日
Support sparse attention kv merge #6429
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 huzhipeng 的贡献)6月4日 添加了label:cann-cla/yes
CANN-robot
6月4日 评论:
6月4日 评论:
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
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| */*/docs/acl*.md | ✅ 黄俊健, 蔡雯雯, 周文芳 (3/2) | ✅ 周文芳 (1/1) |
| */*/op_host/*_def.cpp | ✅ 王永光, 黄俊健 (2/2) | ✅ 王永光 (1/1) |
| */*/op_host/op_api/aclnn*.h | ✅ 王永光, 黄俊健 (2/2) | ✅ 王永光 (1/1) |
| attention | ✅ yuhao_, 胡碧霞, 黄俊健 (3/2) | ✅ yuhao_, 胡碧霞 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
huzhipeng, thanks for your pull request. All authors of the commits have signed the CLA. 👍


attention/sparse_flash_attention_grad/basic_modules/sparse_flash_attention_grad_vec_op.h
已过期
@@ -470,3 +472,3 @@
470472 DumpGmZero(dqWorkspaceGm, dqSize);
471473 DumpGmZero(dkWorkspaceGm, dkSize);
472- DumpGmZero(dvWorkspaceGm, dvSize);
474+ if (!kvMerge) {
【检视】kvMerge在tiling时就可确定,建议提取成模板参数,kernel里使用if constexpr()方式减少代码跳转,提升性能


attention/sparse_flash_attention_grad/op_host/sparse_flash_attention_grad_infershape.cpp
已过期
@@ -65,3 +65,3 @@
6565 OP_CHECK_NULL_WITH_CONTEXT(context, queryShape);
6666 OP_CHECK_NULL_WITH_CONTEXT(context, keyShape);
67- OP_CHECK_NULL_WITH_CONTEXT(context, valueShape);
67+ if (valueShape == nullptr) {
【检视】此处为何value为空还要设置shape


此处折叠了67条消息 查看更多
monologue815
6月9日 评论:
6月9日 评论:
/lgtm


6月9日 添加了label:lgtm
6月9日 关闭了关联的issue
6月9日 合入了pull request
描述
本 PR 为 SparseFlashAttention / SparseFlashAttentionGrad 增加 KV merge 场景支持:当 value 输入为空时,算子按 value = key 处理,避免重复搬运 V;反向场景下不再输出独立 dValue,而是将 dKey + dValue 合并到 dKey 输出中。
关联的Issue
关联Issue #2988
文档更新
类型标签