Skip to content
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

Refactor MultiHeadAttention cpu op #21055

Merged
merged 6 commits into from
Jun 19, 2024
Merged

Refactor MultiHeadAttention cpu op #21055

merged 6 commits into from
Jun 19, 2024

Conversation

tianleiwu
Copy link
Contributor

@tianleiwu tianleiwu commented Jun 15, 2024

Description

Refactoring of MultiHeadAttention op

  • Add some checking for cross attention of pass_past_in_kv to make sure there is no kv cache and bias.
  • Update interface of PackVIntoRotaryQKV so that it can be used by SparseAttention later.
  • Add test cases

Motivation and Context

To prepare the pull request for SparseAttention cpu op.

@tianleiwu tianleiwu marked this pull request as draft June 15, 2024 00:28
@tianleiwu tianleiwu marked this pull request as ready for review June 18, 2024 17:54
onnxruntime/test/python/transformers/test_mha.py Dismissed Show dismissed Hide dismissed
onnxruntime/test/python/transformers/test_mha.py Dismissed Show dismissed Hide dismissed
@tianleiwu tianleiwu marked this pull request as draft June 18, 2024 23:25
@tianleiwu tianleiwu marked this pull request as ready for review June 19, 2024 00:17
Comment on lines +356 to +357
# def test_mha_cuda(self, config):
# parity_check_mha(config)

Check notice

Code scanning / CodeQL

Commented-out code Note test

This comment appears to contain commented-out code.
@tianleiwu tianleiwu merged commit 769d379 into main Jun 19, 2024
96 of 99 checks passed
@tianleiwu tianleiwu deleted the tlwu/refactor_mha_cpu branch June 19, 2024 17:23
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.

2 participants