已关闭
[Bug-Report|缺陷反馈]: sparse_flash_attention算子的api文档 的attention_mode(int)和sparse_block_size 字段,建议细化说明 #27
yuanlang321创建于  2025年12月4日关闭于  2025年12月15日
yuanlang321
2025年12月4日 创建

Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.

Describe the current behavior / 问题描述 (Mandatory / 必填)

api接口说明:
https://gitcode.com/Ascend/op-plugin/blob/master/docs/context/torch_npu-npu_sparse_flash_attention.md

  1. attention_mode(int):可选参数,表示attention的模式,数据类型支持int64,仅支持传入2,表示MLA-absorb模式,即query和key的D包含rope和nope两部分,且key和value是同一份
    希望:这里理解有歧义,query和key 和参数一样,建议优化描述,

  2. sparse_block_size(int):可选参数,代表sparse阶段的block大小,在计算importance score时使用,数据类型支持int64。
    希望token_wise和block_wise的两个场景,细化说明

Environment / 环境信息 (Mandatory / 必填)

A2,CANN8.3.RC2

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

文档优化,

Describe the expected behavior / 预期结果 (Mandatory / 必填)

按照要求优化,

NA

Special notes for this issue/备注 (Optional / 选填)

likedislike
zzzyh22
2025年12月15日 评论:

@yuanlang321 已按照issue意见对资料进行修改,https://gitcode.com/Ascend/op-plugin/pull/3753

likedislike
yuanlang321
2025年12月15日 评论:

image.png
2.

image.png
image.png

likedislike
Yyuanlang321
2025年12月15日 issue状态由 TODO 改变为 DONE
Yyuanlang321
2025年12月15日 关闭了 issue