Closed
[Documentation|文档反馈]: GQA场景解释 #5078
dlf123456Add on  Sep 8Closed at  Sep 8
dlf123456
dlf123456
Sep 8 Create

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

Document Link(文档链接)

https://gitcode.com/cann/ops-transformer/blob/9.2.0-beta.2/attention/chunk_kda_fwd/README.md

Issues Section(问题文档片段)

将每条序列按C=chunk_sizeC=chunk_sizeC=chunk_size划分为MMM个chunk。以第ccc个chunk为例,iii、jjj为chunk内token下标,lcl_cl
c
​
为该chunk最后一个有效token下标。公式省略batch和head下标;GQA场景中,每个Value head使用其对应的Query/Key head。

Existing Issues(存在的问题)

"GQA"首次出现未定义
建议:首次出现时写为 "Grouped Query Attention (GQA)" 或 "分组注意力(GQA)"。

likedislike
游震
游震Collaborators
Sep 8 Comments:

/assign @Wei_NaChuan

likedislike
CANN-robotCANN-robotCollaborators
Sep 8 Assign Wei_NaChuan as responsible person
weinachuanweinachuanCollaborators
Sep 8 Associated pull request
CANN-robotCANN-robotCollaborators
Sep 8 Close issue
CANN-robotCANN-robotCollaborators
Sep 8 Added label: resolved
周云飞
周云飞Collaborators
Oct 14 Comments:

关联 PR #11473 已合入 master,这里不仅补全缩写,还将术语纠正为分组值注意力(Grouped Value Attention,GVA)。当 HV>H 时,每组 HV/H 个连续 Value head 共享一个 Query/Key head,Value head h_v 对应 Q/K head floor(h_v/(HV/H)),见 映射说明。

因此原文的 GQA 不能直接按常见“多个 Query head 共享一个 KV head”理解;此处描述的是 Value head 与 Query/Key head 的分组关系。修改仅澄清已有计算语义。

likedislike