-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[ROCM] added a cudnn switch of conv2d for rocm platform #31836
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
Conversation
|
Thanks for your contribution! |
python/paddle/nn/layer/conv.py
Outdated
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.
这里写成类似这样的形式
use_cudnn = True if (core.is_compiled_with_cuda() and
cudnn_version is not None) else False
python/paddle/nn/layer/conv.py
Outdated
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.
加一行注释,解释一下这里这么修改的原因,例如
// add environment of ROCM_CONV2D_DISABLE_CUDNN to disable use_cudnn in Conv2D
// If use_cudnn is not defined, default value is True, then self._use_cudnn = self._use_cudnn
qili93
left a comment
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, api test will be covered by CPU CI and CUDA CI
python/paddle/fluid/layers/nn.py
Outdated
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.
If ROCM_CONV2D_DISABLE_CUDNN is not a built-in variable in ROCM but created by Paddle, I suggest following the naming rule like other environments like "FLAGS_xxx_xxx".
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.
Plus, it's better to get the value by fluid.get_flags instead of os.getenv
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.
update
e1cf412 to
ae72bcd
Compare
qili93
left a comment
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
zhiqiu
left a comment
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 for paddle.fluid.layers.conv2d
PR types
Others
PR changes
Others
Describe
added a cudnn switch of conv2d for rocm platform