-
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
Exposing use_cudnn #7536
Exposing use_cudnn #7536
Conversation
839a4ee
to
b7f1a75
Compare
b7f1a75
to
251c603
Compare
@chengduoZH We need an issue to describe the problem to be solved by this PR. |
@wangkuiyi Thanks! |
python/paddle/v2/fluid/nets.py
Outdated
pool_stride=1, | ||
pool_type=None): | ||
pool_type=None, | ||
pool_use_cudnn=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.
Just use_cudnn, as the last argument.
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++
Agree with @dzhwinter's comments should be fixed.
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
@@ -70,6 +70,13 @@ void ConvOp::InferShape(framework::InferShapeContext* ctx) const { | |||
framework::OpKernelType ConvOp::GetExpectedKernelType( | |||
const framework::ExecutionContext& ctx) const { | |||
bool use_cudnn = ctx.Attr<bool>("use_cudnn"); | |||
use_cudnn &= platform::is_gpu_place(ctx.GetPlace()); |
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 think use_cudnn
means that user wants to force use cudnn operator, if env does not support cudnn, the framework should throw an error but not implicit change to use other operator.
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.
Agree with the comment.
But we need a default policy right now, by default, we need to set use_cudnn
True.
As we discussed offline, we reach the agreement that place is also a user configuration. we need to overwrite our default policy, not user specified.
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.
ok, I get the point, seems we still need a priority mechanism to resolve such kind of problem in the future.
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
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
fix #7582
What this PR does includes:
use_cudnn
is setTrue
.use_cudnn = use_cudnn && is_gpu_place(ctx.GetPlace());