I am trying to run the notebook https://www.tensorflow.org/text/tutorials/text_classification_rnn from the TensorFlow website.
The code has LSTM and Bidirectional layers
When the GPU is enabled the time is 56 minutes/epoch.
When I am only using the CPU is 264 seconds/epoch.
I am using MacBook Pro 14 (10 CPU cores, 16 GPU cores) and TensorFlow-macos 2.8 with TensorFlow-metal 0.5.0. I face the same problem for TensorFlow-macos 2.9 too.
My environment has:
tensorflow-macos 2.8.0
tensorflow-metal 0.5.0
tensorflow-text 2.8.1
tensorflow-datasets 4.6.0
tensorflow-deps 2.8.0
tensorflow-hub 0.12.0
tensorflow-metadata 1.8.0
When I am using CNNs the GPU is fully enabled and 3-4 times faster than when only using the CPU.
Any idea where is the problem when using LSTMs and Bidirectional?