-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[API2.0] add op for cudnn version query test=develop #26180
[API2.0] add op for cudnn version query test=develop #26180
Conversation
Thanks for your contribution! |
✅ This PR's description meets the template requirements! |
self.assertEqual((cudnn_version is None), True) | ||
|
||
def test_cudnn(self): | ||
cudnn_version = paddle.cudnn_version() |
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.
incomplete test?
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.
wo don't know ci machine cudnn version
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.
at least check if it returns an integer?
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.
Done
python/paddle/device.py
Outdated
] | ||
|
||
|
||
def cudnn_version(): |
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.
rename to get_cudnn_version()
to signify that it is a function not a variable?
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.
Done
self.assertEqual((cudnn_version is None), True) | ||
|
||
def test_cudnn(self): | ||
cudnn_version = paddle.cudnn_version() |
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.
at least check if it returns an integer?
|
||
|
||
class TestCudnnVersion(unittest.TestCase): | ||
def test_no_cudnn(self): |
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.
this can be merged into the test below, since you can not test both case in one go.
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.
Done
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.
maybe give some explanation of the return value, something like 7600 -> 7.6? otherwise LGTM.
@@ -73,6 +74,10 @@ int GetCUDADeviceCount() { | |||
return dev_cnt; | |||
} | |||
|
|||
/* Here is a very simple CUDA “pro tip”: cudaDeviceGetAttribute() is a much |
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.
why is this comment here? looks like that cudaDeviceGetAttribute
is not used anyway
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.
This comment is for GetCUDAComputeCapability, I change it to right position by the way
] | ||
|
||
|
||
def get_cudnn_version(): |
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.
the return value should be cached, as it will never change and this function may be called on each step for each OP that use it in dygraph mode.
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.
Done
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
51cda85
PR types
New features
PR changes
APIs
Describe
Add cudnn version query: def get_cudnn_version
this api return the version of cudnn.