-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[v1.7.x] ElementWiseSum fix for oneDNN #18777
Conversation
Hey @bgawrych , Thanks for submitting the PR
CI supported jobs: [clang, unix-cpu, windows-cpu, sanity, edge, miscellaneous, windows-gpu, website, centos-cpu, unix-gpu, centos-gpu] Note: |
src/operator/tensor/elemwise_sum.cc
Outdated
for (const NDArray& in : inputs) { | ||
// if ndarray is in default storage and MKLDNN is available, | ||
// need to make sure cpu layout data is used, instead of MKL layout | ||
if (in.storage_type() == kDefaultStorage) { |
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.
&& in.IsMKLDNNData()
src/operator/tensor/elemwise_sum.cc
Outdated
// if ndarray is in default storage and MKLDNN is available, | ||
// need to make sure cpu layout data is used, instead of MKL layout | ||
if (in.storage_type() == kDefaultStorage) { | ||
in_data.push_back(in.Reorder2Default()); |
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.
what about emplace_back
Thanks for the fix. Looks that master branch also needs this fix. |
Thanks for the fix , problem is solved. |
@mxnet-bot run ci [unix-cpu] |
Jenkins CI successfully triggered : [unix-cpu] |
@wuxun-zhang @xinyu-intel Can you look again? I've changed fix by reordering conditions in (I think) proper way |
@bgawrych thx, can you please add a simple python test case for this fix? I think it should be more clear. |
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
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
please add a test case too
@pengzhao-intel Done :) |
@pengzhao-intel @bgawrych Missing in v1.x Was it intentional? |
Yes, it's better to include this PR. @anko-intel |
* Fix ElementwiseSum for DNNL * Fix sanity and replace push_back with emplace_back * Change order of the data format conditions * Add NOLINT to avoid readability error * Add test for oneDNN ElemwiseSum Co-authored-by: Bart Gawrych <gawrych.bartlomiej@intel.com>
* Fix ElementwiseSum for DNNL * Fix sanity and replace push_back with emplace_back * Change order of the data format conditions * Add NOLINT to avoid readability error * Add test for oneDNN ElemwiseSum Co-authored-by: Bart Gawrych <gawrych.bartlomiej@intel.com>
* Fix ElementwiseSum for DNNL * Fix sanity and replace push_back with emplace_back * Change order of the data format conditions * Add NOLINT to avoid readability error * Add test for oneDNN ElemwiseSum Co-authored-by: Bart Gawrych <gawrych.bartlomiej@intel.com>
* Fix ElementwiseSum for DNNL * Fix sanity and replace push_back with emplace_back * Change order of the data format conditions * Add NOLINT to avoid readability error * Add test for oneDNN ElemwiseSum Co-authored-by: Bart Gawrych <gawrych.bartlomiej@intel.com>
* Fix ElementwiseSum for DNNL * Fix sanity and replace push_back with emplace_back * Change order of the data format conditions * Add NOLINT to avoid readability error * Add test for oneDNN ElemwiseSum Co-authored-by: Bart Gawrych <gawrych.bartlomiej@intel.com> Co-authored-by: Bart Gawrych <gawrych.bartlomiej@intel.com>
* Fix ElementwiseSum for DNNL * Fix sanity and replace push_back with emplace_back * Change order of the data format conditions * Add NOLINT to avoid readability error * Add test for oneDNN ElemwiseSum Co-authored-by: Bart Gawrych <gawrych.bartlomiej@intel.com> Co-authored-by: Bart Gawrych <gawrych.bartlomiej@intel.com>
Description
This PR fixes bug which occurs when training gluonCV deeplab with oneDNN support.
Original issue: dmlc/gluon-cv#1368
To reproduce:
where train.py comes from https://gluon-cv.mxnet.io/_downloads/1f67ebbf3e0adc5c6fa863a3bc7672a6/train.py (from https://gluon-cv.mxnet.io/build/examples_segmentation/train_fcn.html )
Checklist
Essentials
Comments
Author of the fix is @anko-intel with my small help