-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add test to check if CuDNN is enabled #1715
Conversation
Codecov Report
@@ Coverage Diff @@
## staging #1715 +/- ##
============================================
+ Coverage 0.00% 23.33% +23.33%
============================================
Files 87 87
Lines 9132 9132
============================================
+ Hits 0 2131 +2131
- Misses 0 7001 +7001
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -46,6 +46,11 @@ def test_get_cudnn_version(): | |||
assert get_cudnn_version() > "7.0.0" | |||
|
|||
|
|||
@pytest.mark.gpu | |||
def test_cudnn_enabled(): | |||
assert torch.backends.cudnn.enabled == True |
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.
assert torch.backends.cudnn.enabled
would also work here.
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 for reviewing Fatemeh
The problem with just using assert is that it also takes other values. For exampe if you have something like this:
def test_simple():
assert 1
assert True
assert "a"
assert False
you'll get 3 oks and one error.
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.
That is correct, in this scenario assert torch.backends.cudnn.enabled
can only be True
or False
, so we still get the desired behavior in either cases. But I agree, your way is better for being more explicit and readable. Dropping ==True
is only more concise.
Description
To make sure we have enabled in our test system cudnn.
This might help with the problem @pradnyeshjoshi is having
Related Issues
Checklist:
staging branch
and not tomain branch
.