已关闭
[Requirement|需求建议]: block_sparse_attention新增mxfp4新特性 #4466
liwenguihw创建于  8月20日关闭于  8月21日
liwenguihw
liwenguihw成员
8月20日 创建

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

Backgroud(背景信息)

为支持BlockSparseAttention算子Mxfp4、MXFP8等量化功能,因此需要新增加aclnnBlockSparseAttentionV3接口,新增参数pQuantScaleOptional、quantMode和dstTypeMax。

Benefit / Necessity (价值/作用)

应用场景:多模态场景。

Design(设计方案)

新增aclnn接口名:aclnnBlockSparseAttentionV3
block_sparse_attention算子def文件新增pQuantScaleOptional、quantMode和dstTypeMax参数;

实现方案:
新增aclnn接口aclnnBlockSparseAttentionV3,较v2版本上新增pQuantScaleOptional、quantMode和dstTypeMax参数;其中pQuantScaleOptional是p的量化压缩因子,为FP8,HiFloat8预留参数,使能用户自定义静态量化scale;quantMode=0表示非量化,1表示FP8静态量化,2表示MXFP4 OCP量化,3表示MXFP4 CX量化(后续新增量化可根据quantMode进行区分);dstTypeMax目前是在MXFP4量化的CX量化时,让用户自定义量化量程,支持设置该值0.0,或者[6.0, 12.0],0.0:代表Amax(DType)为量化结果数据类型的最大值,[6.0, 12.0]:取值为6.0-12.0代表Amax(DType)为传入值。

likedislike
liwenguihwliwenguihw成员
8月20日 添加了label:requirement
liwenguihwliwenguihw成员
8月20日 将 liwenguihw 设为负责人
liwenguihwliwenguihw成员
8月20日 关联了pull request:【BSA_MXFP4】mxfp4新特性
CANN-robotCANN-robot成员
8月21日 关闭了 issue
liwenguihwliwenguihw成员
8月21日 issue状态由 进行中 改变为 已完成
CANN-robotCANN-robot成员
8月21日 添加了label:resolved