Skip to content

Allow GQA to output attention scores #25319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

derdeljan-msft
Copy link
Contributor

Description

  1. Add optional output to CPU impl of GQA op for storing attention scores (QK). Buffer is of shape (B, N, S, T) and can either be fp16 or fp32, depending on the type of other inputs
  2. Add output_post_softmax_qk attribute to GQA, which controls if attention scores should be saved before or after softmax is applied
  3. Add unit tests to cover this use case

1. Add optional output to CPU impl of GQA op for storing attention
   scores (QK). Buffer is of shape (B, N, S, T) and can either be fp16
   or fp32, depending on the type of other inputs
2. Add `output_post_softmax_qk` attribute to GQA, which controls if
   attention scores should be saved before or after softmax is applied
3. Add unit tests to cover this use case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant