Grappler ImplementationSelector fails to use CUDNN (for GRU & LSTM) when using tf.data.experimental.scan #50325
Labels
comp:data
tf.data related issues
stat:awaiting tensorflower
Status - Awaiting response from tensorflower
TF 2.5
Issues related to TF 2.5
type:bug
Bug
System information
Describe the current behavior
As you can see in the code here, the way CUDNN LSTM & GRU are implemented, is by adding two functions with the same name to the graph. Grappler's ImplementationSelector optimizer runs later and selects the correct implementation. However, when using
tf.data.experimental.scan
, from what I've previously seen (I don't quite remember well), the function gets renamed - which causes the implementation selector to fail.What actually happens is the non-CUDNN version is the default implementation - so it falls back to that one.
Describe the expected behavior
The layers should run using CUDNN, when possible.
Contributing
Standalone code to reproduce the issue
Unfortunately I couldn't think of a way to display this issue without Tensorboard, but here it is:
Here you can see
model.predict
uses CUDNN:And here you can see
foo(dataset)
does not use CUDNN:The text was updated successfully, but these errors were encountered: