This repository was 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
handle fallback correctly for write inplace when the array is MKLDNN. #10651
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
d119ae0
to
6455df4
Compare
@zheng-da could we add a unit test since you are able to reproduce the problem with this snippet? Also, if you could create a jira issue and stick it in the title of your PR, that'd be great 👍 |
yes, I'll add unit tests. I'm thinking of adding C++ unit tests to have more comprehensive tests to cover all different cases. |
6455df4
to
9ff7f0b
Compare
related to #10765 |
@zheng-da what's the progress of this PR? We need this fix for our tests. |
5 tasks
jinhuang415
pushed a commit
to jinhuang415/incubator-mxnet
that referenced
this pull request
May 29, 2018
…apache#10651) * handle writeinplace correctly for mkldnn arrays. * Add unit tests. * Fix a bug in mkldnn copy. * Fix a bug in ndarray copy. * Verify results.
rahul003
pushed a commit
to rahul003/mxnet
that referenced
this pull request
Jun 4, 2018
…apache#10651) * handle writeinplace correctly for mkldnn arrays. * Add unit tests. * Fix a bug in mkldnn copy. * Fix a bug in ndarray copy. * Verify results.
zheng-da
added a commit
to zheng-da/incubator-mxnet
that referenced
this pull request
Jun 8, 2018
…apache#10651) * handle writeinplace correctly for mkldnn arrays. * Add unit tests. * Fix a bug in mkldnn copy. * Fix a bug in ndarray copy. * Verify results.
zheng-da
added a commit
to zheng-da/incubator-mxnet
that referenced
this pull request
Jun 11, 2018
…apache#10651) * handle writeinplace correctly for mkldnn arrays. * Add unit tests. * Fix a bug in mkldnn copy. * Fix a bug in ndarray copy. * Verify results.
zheng-da
added a commit
to zheng-da/incubator-mxnet
that referenced
this pull request
Jun 13, 2018
…apache#10651) * handle writeinplace correctly for mkldnn arrays. * Add unit tests. * Fix a bug in mkldnn copy. * Fix a bug in ndarray copy. * Verify results.
anirudh2290
pushed a commit
that referenced
this pull request
Jun 13, 2018
…#10651) * handle writeinplace correctly for mkldnn arrays. * Add unit tests. * Fix a bug in mkldnn copy. * Fix a bug in ndarray copy. * Verify results.
zheng-da
added a commit
to zheng-da/incubator-mxnet
that referenced
this pull request
Jun 28, 2018
…apache#10651) * handle writeinplace correctly for mkldnn arrays. * Add unit tests. * Fix a bug in mkldnn copy. * Fix a bug in ndarray copy. * Verify results.
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
For non-MKLDNN operators, providing an MKLDNN array triggers fallback. In this case, the input array and the output array are no longer using the same memory even if the output requirement is write-inplace. For operators that handle write-inplace differently, this can potentially cause problems, as spotted in #9835
The fix in this PR is to change the original output requirement to WriteTo. @piiswrong is this an acceptable fix?
Thank @ashokei for finding the root cause of #9835
The code below can trigger the problem.
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.