disable non-deterministic cudnn ctcloss (#22977)
Summary:
Associated issue: https://github.com/pytorch/pytorch/issues/21680
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22977
Differential Revision: D16357873
Pulled By: nairbv
fbshipit-source-id: 58711bac7d3e8390e868d594dc265ba053a1537c
diff --git a/aten/src/ATen/native/LossCTC.cpp b/aten/src/ATen/native/LossCTC.cpp
index 44e1e29..a8f91c9 100644
--- a/aten/src/ATen/native/LossCTC.cpp
+++ b/aten/src/ATen/native/LossCTC.cpp
@@ -364,7 +364,9 @@
Tensor res;
if (use_cudnn) {
- res = std::get<0>(at::_cudnn_ctc_loss(log_probs, targets, input_lengths, target_lengths, BLANK, ctx.deterministicCuDNN(), zero_infinity));
+ // non-deterministic ctc loss on cudnn disabled due to inconsistent results
+ // see: https://github.com/pytorch/pytorch/issues/21680
+ res = std::get<0>(at::_cudnn_ctc_loss(log_probs, targets, input_lengths, target_lengths, BLANK, /*deterministic=*/true, zero_infinity));
} else {
res = std::get<0>(at::_ctc_loss(log_probs, targets, input_lengths, target_lengths, BLANK, zero_infinity));
if (zero_infinity) {