This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[Feature] Add oneDNN support for interleaved_matmul_selfatt_* operators (fp32/int8) #20163
Merged
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
Hey @bgawrych , Thanks for submitting the PR
CI supported jobs: [unix-cpu, clang, unix-gpu, windows-cpu, centos-gpu, website, centos-cpu, sanity, miscellaneous, windows-gpu, edge] Note: |
lanking520
added
pr-awaiting-testing
PR is reviewed and waiting CI build and test
pr-work-in-progress
PR is still work in progress
and removed
pr-awaiting-testing
PR is reviewed and waiting CI build and test
labels
Apr 14, 2021
lanking520
added
pr-awaiting-testing
PR is reviewed and waiting CI build and test
pr-work-in-progress
PR is still work in progress
and removed
pr-work-in-progress
PR is still work in progress
pr-awaiting-testing
PR is reviewed and waiting CI build and test
labels
Apr 15, 2021
lanking520
added
pr-awaiting-testing
PR is reviewed and waiting CI build and test
pr-work-in-progress
PR is still work in progress
and removed
pr-work-in-progress
PR is still work in progress
pr-awaiting-testing
PR is reviewed and waiting CI build and test
labels
Apr 15, 2021
@mxnet-bot run ci [windows-cpu] |
Jenkins CI successfully triggered : [windows-cpu] |
lanking520
added
pr-awaiting-testing
PR is reviewed and waiting CI build and test
and removed
pr-work-in-progress
PR is still work in progress
pr-awaiting-testing
PR is reviewed and waiting CI build and test
labels
Apr 15, 2021
sfraczek
approved these changes
Apr 19, 2021
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.
lgtm
@szha Can we merge it? |
@bgawrych thanks for the contribution |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
This change adds oneDNN support for two operators:
Both operators will be used when backend MKLDNN/MKLDNN_QUANTIZE will be chosen - there is no change in terms of performance between MKL fp32 vs. oneDNN fp32, but the main advantage is utilizing int8 data type
10 iterations of BERT-Large (gluon-nlp v0.10.x) [Intel(R) Core(TM) i9-9940X CPU @ 3.30GHz]:
MKL implementation (fp32 as int8 is not supported):
oneDNN implementation (int8):
_contrib_interleaved_matmul_selfatt_qk => _sg_mkldnn_selfatt_qk
_contrib_interleaved_matmul_selfatt_qk => _sg_mkldnn_selfatt_valatt
We can observe that this change positively influenced other operators as there is less dequantization/quantization overhead and memory reorders
Great contribution of @grygielski to this change
Checklist
Essentials