cuDNN LSTM cells
Would it be possible to use the CuDNNLSTM cells implemented by Tensorflow (https://www.tensorflow.org/api_docs/python/tf/contrib/cudnn_rnn/CudnnLSTM) in order to gain on performance?
In the current implementation of the deep speech model, BasicLSTMCell are being used - in comparison, according to the nvidia study, the optimized CuDNN LSTM should be ~6x faster.
Interesting!
When we initially set up the system CudnnLSTM didn't exist. So we simply used BasicLSTMCell.
If the 6x factor is true. It would be a huge win.
On the issue regarding non-cuda systems: https://github.com/tensorflow/tensorflow/issues/6072
TensorFlow 1.4 (current version required and also used by Mozilla's fork) does not play well with CudnnLSTM cells and the documentation is terrible, although I can confirm the 6X speedup based on some simple initial benchmarks.
It is reasonably straight forward to get the checkpoints to save the CudnnLSTM weights and biases in the TensorFlow format, rather than an opaque one. However, using an optimizer other than SGD results in:
https://github.com/tensorflow/tensorflow/issues/6620
which is...less straight forward.
Note that the CudnnLSTM API has also significantly changed in TensorFlow version 1.5.
@kdavis-mozilla, is there any timeline for this ? 6X speedup will be really amazing !!
@praveeny1986 No timeline so far, but we are having a "work week" next week; so, the team can talk about it in person there.
This issue is blocked by https://github.com/tensorflow/tensorflow/issues/23269
TF 1.14 (and, currently, nightly) now have support for variable sequence lengths in cudnn_rnn. I'm running some preliminary experiments to benchmark it, on top of the TF 1.13/tf.data changes.
Runs using 7 GPUs, with another unrelated TTS job using the 8th GPU:
| without CuDNN | with CuDNN | speedup | |
|---|---|---|---|
| Time for 1st epoch | 10h24min (37487 seconds) | 6h58min (25120 seconds) | 1.5x |
| Time for other epochs | 2h (7200 seconds) | 2h30min (9000 seconds) | 0.8x |
I think the resource competition on the machine makes these results hard to evaluate, so I'll do some runs using all 8 GPUs taking the whole node in the future.
TF 1.14.0-rc0 is out. Self-reminder to do some experiments using it rather than TF-Nightly-GPU.
This was implemented and merged a while ago.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.