-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[BUGFIX] Fix MKLDNN BatchNorm with even number of channels (#19150) #19299
Conversation
Even number of channels results in data reordering before batch norm operation. Therefore, if BatchNorm data array is view of another array and the data is stored in MKLDNN format, the data needs to be converted to the default format.
Hey @akarbown , Thanks for submitting the PR
CI supported jobs: [website, centos-gpu, centos-cpu, miscellaneous, unix-cpu, windows-cpu, sanity, windows-gpu, edge, unix-gpu, clang] Note: |
@mxnet-bot run ci [edge] |
Jenkins CI successfully triggered : [edge] |
@mxnet-bot run ci [edge] |
Jenkins CI successfully triggered : [edge] |
@mxnet-bot run ci [edge] |
Jenkins CI successfully triggered : [edge] |
@PatricZhao , @TaoLv could you please review it! |
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.
Thank you for the fix : )
Could you please update the test cases for MKLDNN-BatchNorm with even number of channels in tests/python/mkl/test_mkldnn.py#L297 ?
for shape in [(2, 3), (2, 4), (2, 3, 2, 2), (2, 4, 2, 2)]:
Done! |
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. Thank you!
thanks for the fix. please make sure to port to other branches (e.g. v1.x, v1.8.x, master) as appropriate. |
…19150) #19299 #19425 (#19428) * Fix MKLDNN BatchNorm with even number of channels (#19150) Even number of channels results in data reordering before batch norm operation. Therefore, if BatchNorm data array is view of another array and the data is stored in MKLDNN format, the data needs to be converted to the default format. * Add or updated test to verify Batchnorm odd & even number of channels * Fix for Batchnorm odd & even chnls number context
…) #19299 #19425 (#19445) * Fix MKLDNN BatchNorm with even number of channels (#19150) Even number of channels results in data reordering before batch norm operation. Therefore, if BatchNorm data array is view of another array and the data is stored in MKLDNN format, the data needs to be converted to the default format. * Add or updated test to verify Batchnorm odd & even number of channels * Fix for Batchnorm odd & even chnls number context
…19299 (#19425) * Fix MKLDNN BatchNorm with even number of channels (#19150) Even number of channels results in data reordering before batch norm operation. Therefore, if BatchNorm data array is view of another array and the data is stored in MKLDNN format, the data needs to be converted to the default format. * Add or updated test to verify Batchnorm odd & even number of channels * Fix for Batchnorm odd & even chnls number context
) apache#19299 (apache#19425) * Fix MKLDNN BatchNorm with even number of channels (apache#19150) Even number of channels results in data reordering before batch norm operation. Therefore, if BatchNorm data array is view of another array and the data is stored in MKLDNN format, the data needs to be converted to the default format. * Add or updated test to verify Batchnorm odd & even number of channels * Fix for Batchnorm odd & even chnls number context
) apache#19299 (apache#19425) * Fix MKLDNN BatchNorm with even number of channels (apache#19150) Even number of channels results in data reordering before batch norm operation. Therefore, if BatchNorm data array is view of another array and the data is stored in MKLDNN format, the data needs to be converted to the default format. * Add or updated test to verify Batchnorm odd & even number of channels * Fix for Batchnorm odd & even chnls number context
) apache#19299 (apache#19425) * Fix MKLDNN BatchNorm with even number of channels (apache#19150) Even number of channels results in data reordering before batch norm operation. Therefore, if BatchNorm data array is view of another array and the data is stored in MKLDNN format, the data needs to be converted to the default format. * Add or updated test to verify Batchnorm odd & even number of channels * Fix for Batchnorm odd & even chnls number context
…he#19150) apache#19299 apache#19425 (apache#19445) * Fix MKLDNN BatchNorm with even number of channels (apache#19150) Even number of channels results in data reordering before batch norm operation. Therefore, if BatchNorm data array is view of another array and the data is stored in MKLDNN format, the data needs to be converted to the default format. * Add or updated test to verify Batchnorm odd & even number of channels * Fix for Batchnorm odd & even chnls number context
Even number of channels results in data reordering before batch
norm operation. Therefore, if BatchNorm data array is view of
another array and the data is stored in MKLDNN format, the data
needs to be converted to the default format.
It fixes: #19150.
Checklist
Essentials