Skip to content

Commit d2472d1

Browse files
csarofeensoumith
authored andcommitted
Disable cudnn dilated convolutions for kepler. (pytorch#1308)
1 parent a8e6610 commit d2472d1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

torch/csrc/autograd/functions/convolution.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ auto ConvForward::apply(const variable_list& inputs) -> variable_list {
125125

126126
bool use_cudnn = false;
127127
#ifdef WITH_CUDNN
128-
use_cudnn = (input->isCuda() && (!is_dilated() || CUDNN_VERSION >= 6000)) && cudnn_enabled;
128+
cudaDeviceProp* prop =
129+
THCState_getCurrentDeviceProperties(state);
130+
use_cudnn = (input->isCuda() && (!is_dilated() || CUDNN_VERSION >= 6000) && (!is_dilated() || prop->major >= 5) ) && cudnn_enabled;
129131
#endif
130132

131133
std::unique_ptr<Tensor> output;
@@ -212,7 +214,9 @@ auto ConvBackward::apply(const variable_list& grad_outputs) -> variable_list {
212214

213215
bool use_cudnn = false;
214216
#ifdef WITH_CUDNN
215-
use_cudnn = (input->isCuda() && (!is_dilated() || CUDNN_VERSION >= 6000)) && cudnn_enabled;
217+
cudaDeviceProp* prop =
218+
THCState_getCurrentDeviceProperties(state);
219+
use_cudnn = (input->isCuda() && (!is_dilated() || CUDNN_VERSION >= 6000) && (!is_dilated() || prop->major >= 5) ) && cudnn_enabled;
216220
#endif
217221

218222
std::unique_ptr<Tensor> grad_input;

0 commit comments

Comments
 (0)