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
[Improvement] Invoke mkldnn and cudnn BatchNorm when axis != 1 #18504
Merged
szha
merged 21 commits into
apache:master
from
wkcn:invoke_mkldnn_cudnn_bn_when_axis_ne_1
Jul 9, 2020
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
fac3b42
fix batch norm when fix_gamma is True
wkcn 34c6a3b
support gradient accumulation for batch norm
wkcn 11c8e26
mkldnn batchnorm support grad add
wkcn 830ba0d
unittest for bn
wkcn a9c91d2
fix bn arg
wkcn 8594642
fix lint
wkcn f9995b0
fix mkldnn
wkcn d380443
fix mkldnn bn
wkcn eaeae21
fix grad when fixing gamma
wkcn 25924c9
fix naive gpu bn
wkcn e3bb53c
fix lint
wkcn 9c00567
invoke mkldnn and cudnn batchnorm when axis != 1
wkcn 4cab1ed
backport 18500
wkcn 4bf0000
Merge branch 'master' into invoke_mkldnn_cudnn_bn_when_axis_ne_1
wkcn b78b4cb
change condition
wkcn e411890
fix
wkcn aad431b
fix
wkcn 939750f
add mkldnn_off for bn
wkcn 25e4666
remove mkldnn_off
wkcn 97c6746
recover save_000800.json
wkcn 38da95f
cast
wkcn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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.
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.
we are removing the check for
ndim == 4
here, and another lighter check forndim == 1 || ndim ==2 || ndim ==4
present inSupportMKLDNN
.Does that mean
ndim
can be anything >0 ? What are the allowed values forndim
?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.
Yes,
ndim
coulld be anything > 0.If the shape of input A is
shape
, the input will be shaped into(prod(shape[0:axis]), shape[axis], 1, prod(shape[axis+1:len(shape)]) )
.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.
Thanks for the explanation! Does the table continue further for ndims > 5? Or should we place a check for that?
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.
Yes, it supports ndim > 5 too.