diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-06-05 10:43:07 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-06-05 10:45:42 -0700 |
commit | b2e56707ecbc6dc4b130a50424f5b85956f58720 (patch) | |
tree | c8ca04ffb37fc5153c470f46c0d8fab6ed1f86f4 /tensorflow/stream_executor/cuda | |
parent | a7c026e08864417b35dbe3c9e4b246725ad6ba59 (diff) |
Do not enable tensor ops for cuDNN RNN unless explicitly specified.
PiperOrigin-RevId: 199321021
Diffstat (limited to 'tensorflow/stream_executor/cuda')
-rw-r--r-- | tensorflow/stream_executor/cuda/cuda_dnn.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tensorflow/stream_executor/cuda/cuda_dnn.cc b/tensorflow/stream_executor/cuda/cuda_dnn.cc index 55c1083a61..f6564df0d0 100644 --- a/tensorflow/stream_executor/cuda/cuda_dnn.cc +++ b/tensorflow/stream_executor/cuda/cuda_dnn.cc @@ -1031,7 +1031,15 @@ class CudnnRnnDescriptor : public dnn::RnnDescriptor { rnn_mode, direction_mode, num_layers)); #if CUDNN_VERSION >= 7000 - if (RnnTensorOpMathEnabled()) { + // Require explicit algorithm config to enable tensor cores. Some configs + // return CUDNN_NOT_SUPPORTED when tensor ops are enabled (which is against + // the idiom that enabling tensor ops is only a hint: see nvbugs/2172799). + // We can only reasonably expect the user to handle the subsequent failure + // in profile mode, which is run with algorithms returned from + // GetRnnAlgorithms() (which are non-default and explicitly set whether to + // use tensor ops). + if (RnnTensorOpMathEnabled() && + !algorithm_config.algorithm().is_default()) { cudnnMathType_t math_type = algorithm_config.algorithm().tensor_ops_enabled() ? CUDNN_TENSOR_OP_MATH |