We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In this situation:
Query shape is [batch_size, num_heads_q, seq_length, hidden_size] Key/Value shape is [batch_size, num_heads_kv, seq_length, top_k, hidden_size]
which means each query vector in a specific position select top_k k-v pairs, how could I use flash-attn to calculate it?
The text was updated successfully, but these errors were encountered:
You can expand the query top_k times and combine into the batch dimension, so that QKV have batch dimension batch_size * top_k
top_k
batch_size * top_k
Sorry, something went wrong.
No branches or pull requests
In this situation:
Query shape is [batch_size, num_heads_q, seq_length, hidden_size]
Key/Value shape is [batch_size, num_heads_kv, seq_length, top_k, hidden_size]
which means each query vector in a specific position select top_k k-v pairs, how could I use flash-attn to calculate it?
The text was updated successfully, but these errors were encountered: