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
FIx random gamma and space to depth tests. #50813
Conversation
Please review ! |
Also on a separate note, can someone guide me to correct forum or people with whom I can discuss about the usage of use_gpu flag in tensorflow/python/framework/test_util.py. |
Any updates on review ? Can this be merged ? |
Any updates ? |
Regarding |
Regarding use_gpu, I recommend not using it at all (that means you modifications look good here) - the test suites run on CPU and GPU separately, and in general the same code should produce identical results, irrespective of what device it runs on. ->thanks for clearing this. There are so many test cases where a loop of use_gpu of False, True is executed unnecessarily. We can avoid those loops in so many other places un less there is a requirement to compare CPU results vs GPU results. I can start by updating this random gamma test file. I will send updated patch soon. Also I think that it does make sense to have a test comparing random operators behavior between CPU and any other device because random number generator algorithm can be different. |
dd2f8fc
to
510c505
Compare
Hi @mdanatg - Updated files ready for review. Avoided unnecessary loop of use_gpu where not required and the current code will run all the tests on whatever device is connected. |
Btw on same lines, I will try to raise some more pull requests soon where we can avoid unnecessary loops of use_gpu of False, True. It will further speed up the execution time overall. |
510c505
to
119269a
Compare
Any updates ? Can this be merged now ? Locally ran all the tests on CPU too and they are passing after all the changes. |
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 for the delay, this slipped through the cracks.
I'm curious about the error you get when using tf.function - happy to help debug it down. But no need to block this PR on that. I forgot to double check, are you using e.g. self.evaluate(diff)
instead of diff.eval()
. The former is expected to work.
Yes got that but didn't want to confuse tf function with the intend of this pull request. Will surely take it up soon. Hope you saw the changes which will make the execution faster too of the tests by ensuring to not run the test twice where not required. How will this be merged now ? |
@mdanatg - I got it what needs to be done for tf function. But didn't want to mix those changes with the intend of this pull request. Will surely take it up in near future. Hope you saw the changes to avoid execution of same test twice and test execution time will be further faster now. How will this be merged now ? |
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.
Just noticed a small nit; the external linter didn't seem to catch it.
119269a
to
a688b2c
Compare
a688b2c
to
47fb652
Compare
Fix random gamma tests to use deprecated v1 graph mode so that test is executed in both CPU and accelerator. In eager mode, only highest priority same device will be selected. Avoid unnecessary loop of use_gpu wherever applicable. Space to depth testBatchSize0 verification fixed with common code. Also update common code of space to depth tests. Signed-off-by: puneeshkhanna <puneesh.khanna83@gmail.com>
47fb652
to
3e79ac2
Compare
Thanks, we just need to wait for the merge process to complete now. |
Some checks were not successful |
Looks like a tool failure, I started a retry - @gbaned might be able to help getting it unstuck. |
@mdanatg, @puneeshkhanna This PR is merged. Thank you. |
Fix random gamma tests to use deprecated v1 graph mode so
that test is executed in both CPU and accelerator because in eager
mode, same device will be be only selected irrespective of use_gpu
flag. Remove loop of use_gpu where not required.
Space to depth testBatchSize0 verification fixed with common
code.
Signed-off-by: puneeshkhanna puneesh.khanna83@gmail.com