-
Notifications
You must be signed in to change notification settings - Fork 74k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opt out DEVICE_GPU_XLA_JIT and DEVICE_XLA_GPU from ResizeNearestNeigh… #31012
Merged
tensorflow-copybara
merged 4 commits into
tensorflow:master
from
yongfeng-nv:dilation-resize-oom
Aug 8, 2019
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4c59104
Opt out DEVICE_GPU_XLA_JIT and DEVICE_XLA_GPU from ResizeNearestNeigh…
yongfeng-nv 6eb772a
Revert "Opt out DEVICE_GPU_XLA_JIT and DEVICE_XLA_GPU from ResizeNear…
yongfeng-nv 559531b
Add ResizeNearestNeighborOp, ResizeBilinearOp, and ResizeBilinearGrad…
yongfeng-nv 4b81649
Add comments to explain the issue.
yongfeng-nv File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
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.
Normally we file a bug internally with some details on why the op is slow. Since you can't file an internal bug do you mind adding some comments on why these ops are slow / undesirable?
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.
To be precise, I am opting out these ops, no because they are slow, but because they create convolutions that CuDNN can't handle. I looked around for lists similar to OpIsSlow, but didn't find anything more proper. Please let me if there is a better way, or whether to create another list.
I have explained how the error is triggered in my first comment in this PR. I am attaching a python code reproducing the error. You can switch on/off XLA to observe the difference. Hopefully it is sufficient for a bug description.
import tensorflow as tf
import numpy as np
image = tf.placeholder(tf.float32, shape=[16, 256, 256, 16], name='image')
resize_nearest_neighbor = tf.image.resize_images(image, size=[512,512], method=tf.image.ResizeMethod.NEAREST_NEIGHBOR, align_corners=True)
feed_dict={image: np.random.random_sample([16, 256, 256, 16])}
sess = tf.Session()
with sess.as_default():
actual_resize_nearest_neighbor = resize_nearest_neighbor.eval(feed_dict)
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.
Sorry, I meant comments in the code.
Although I guess just liking to this discussion thread would be fine too.
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.
@sanjoy, I have added comments that link to this thread.
BTW, I suppose that users can switch cluster/allow_slow_ops at run-time. Can you show me how to do that?
P.S. I will make merge to push forward #30336, as I don't change image_resize_ops.cc. I will need your help to review it again.
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!
TF users can't change these options directly. These bits are mainly used to control the behavior of
RecursiveCompilabilityChecker
by the various clients of the class (none of which are directly user facing).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.
Is there any further comment for me to address? If not, please approve the PR.
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.
I already approved it the last time, but it looks like a CI build failed. I'll re-trigger the CI.