diff options
author | Yangzihao Wang <yangzihao@google.com> | 2017-08-01 22:10:20 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-08-01 22:14:12 -0700 |
commit | db596594b5653b43fcb558a4753b39904bb62cbd (patch) | |
tree | d62d0611711a8f97fb942ae3986f8b7cf571d0f7 /tensorflow/contrib/fused_conv | |
parent | b9ac2d7eb17022a677597a1f88a65d8d26278088 (diff) |
Allows cudnn convolution algorithms to proceed when only find one type of algorithm (between with scratch or without scratch).
Remove valid_ and set_is_valid() in dnn::ProfileResult, instead use (algorithm_ != kDefaultAlgorithm) to see if the result is valid.
PiperOrigin-RevId: 163931258
Diffstat (limited to 'tensorflow/contrib/fused_conv')
-rw-r--r-- | tensorflow/contrib/fused_conv/kernels/fused_conv2d_bias_activation_op.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/tensorflow/contrib/fused_conv/kernels/fused_conv2d_bias_activation_op.cc b/tensorflow/contrib/fused_conv/kernels/fused_conv2d_bias_activation_op.cc index d553d5a0a6..dc0701b234 100644 --- a/tensorflow/contrib/fused_conv/kernels/fused_conv2d_bias_activation_op.cc +++ b/tensorflow/contrib/fused_conv/kernels/fused_conv2d_bias_activation_op.cc @@ -444,17 +444,16 @@ void LaunchFusedConv2DBiasActivationOp<GPUDevice, T>::launch( } } } - OP_REQUIRES( - ctx, - best_result.is_valid() && best_result.algorithm() != kDefaultAlgorithm, - errors::NotFound("No algorithm worked!")); OP_REQUIRES(ctx, - best_result_no_scratch.is_valid() && - best_result_no_scratch.algorithm() != kDefaultAlgorithm, - errors::NotFound("No algorithm without scratch worked!")); - algorithm_config.set_algorithm(best_result.algorithm()); - algorithm_config.set_algorithm_no_scratch( - best_result_no_scratch.algorithm()); + best_result.is_valid() || best_result_no_scratch.is_valid(), + errors::NotFound("No algorithm worked!")); + if (best_result.is_valid()) { + algorithm_config.set_algorithm(best_result.algorithm()); + } + if (best_result_no_scratch.is_valid()) { + algorithm_config.set_algorithm_no_scratch( + best_result_no_scratch.algorithm()); + } AutoTuneConvBiasActivation::GetInstance()->Insert(conv_parameters, algorithm_config); } |