Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable TF remapper optimizer (#1418)
TF supports a remapper optimizer which remaps subgraphs onto more efficient implementations by replacing commonly occuring subgraphs with optimized fused monolithic kernels. However, its support is limited: (1) MatMul + BiasAdd (not Add) + Activation; (2) Float32 (but not float64); (3) Activation is Tanh; (4) MKL is built and used. This commit replaces Add by BiasAdd in the NN. The speed of a single op can be improved by about 20% when TF is using MKL and precision is set to float32. One can find `_MklNativeFusedMatMul` op in the profiler. See also: - https://www.tensorflow.org/guide/graph_optimization - https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/grappler/optimizers/remapper.cc (cherry picked from commit 8f2dc44)
- Loading branch information