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
[DML EP] Attention Kernel #13371
Merged
Merged
[DML EP] Attention Kernel #13371
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…lease build will remove it from the stack, whenever it feels like
fdwr
reviewed
Oct 19, 2022
onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorAttention.cpp
Outdated
Show resolved
Hide resolved
fdwr
reviewed
Oct 19, 2022
onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorAttention.cpp
Outdated
Show resolved
Hide resolved
fdwr
reviewed
Oct 20, 2022
onnxruntime/core/providers/dml/OperatorAuthorHelper/Attributes.h
Outdated
Show resolved
Hide resolved
fdwr
reviewed
Oct 20, 2022
onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorAttention.cpp
Outdated
Show resolved
Hide resolved
fdwr
reviewed
Oct 20, 2022
onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorAttention.cpp
Outdated
Show resolved
Hide resolved
fdwr
reviewed
Oct 20, 2022
onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorAttention.cpp
Outdated
Show resolved
Hide resolved
fdwr
reviewed
Oct 20, 2022
onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorAttention.cpp
Outdated
Show resolved
Hide resolved
fdwr
reviewed
Oct 20, 2022
onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorAttention.cpp
Show resolved
Hide resolved
fdwr
reviewed
Oct 20, 2022
onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorAttention.cpp
Outdated
Show resolved
Hide resolved
fdwr
reviewed
Oct 20, 2022
onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorAttention.cpp
Outdated
Show resolved
Hide resolved
fdwr
reviewed
Oct 20, 2022
onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorAttention.cpp
Show resolved
Hide resolved
fdwr
reviewed
Oct 20, 2022
onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorAttention.cpp
Outdated
Show resolved
Hide resolved
fdwr
reviewed
Oct 20, 2022
onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorAttention.cpp
Outdated
Show resolved
Hide resolved
fdwr
reviewed
Oct 20, 2022
onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorAttention.cpp
Show resolved
Hide resolved
fdwr
reviewed
Oct 20, 2022
onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorAttention.cpp
Outdated
Show resolved
Hide resolved
fdwr
reviewed
Oct 20, 2022
onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorAttention.cpp
Outdated
Show resolved
Hide resolved
fdwr
reviewed
Oct 20, 2022
onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorAttention.cpp
Outdated
Show resolved
Hide resolved
fdwr
reviewed
Oct 20, 2022
onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorAttention.cpp
Outdated
Show resolved
Hide resolved
fdwr
reviewed
Oct 20, 2022
onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorAttention.cpp
Outdated
Show resolved
Hide resolved
fdwr
reviewed
Oct 21, 2022
onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorAttention.cpp
Show resolved
Hide resolved
fdwr
approved these changes
Oct 21, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linnealovespie
pushed a commit
that referenced
this pull request
Oct 28, 2022
### Description DML EP kernel for com.microsoft.attention operator. It has been implemented via DML_Graph. References for this implementation: 1. [Hugging Face Attention for BERT](https://github.com/huggingface/transformers/blob/310340d0d01929715b30863ee6f633974d75da16/src/transformers/models/bert/modeling_bert.py#L245-L284) 2. Chapter 3 of book Orielly: Natural Language Processing with Transformers, Revised Edition This PR also - includes a very tiny fix for QLinearSigmoid kernel, which is storing the temporary object into a named variable. - enables 4 L2 transformers LayerNorm, Gelu, MatMulScale, Attention. ### Motivation and Context - Why is this change required? What problem does it solve? One of the main operators used in Transformer-based model. It contributes to the overall perf of DML EP for Transformer models. - If it fixes an open issue, please link to the issue here. N/A Co-authored-by: Sumit Agarwal <sumitagarwal@microsoft.com> Co-authored-by: Dwayne Robinson <dwayner@microsoft.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
DML EP kernel for com.microsoft.attention operator. It has been implemented via DML_Graph. References for this implementation:
This PR also
Motivation and Context
One of the main operators used in Transformer-based model. It contributes to the overall perf of DML EP for Transformer models.