Overview
Efficiency and performance are critical for edge deployments. TensorFlow Lite achieves this by means of fusing and optimizing a series of more granular TensorFlow operations (which themselves are composed of composite operations, like LSTM) into a single executable TensorFlow Lite unit.Many users have asked us for more granular control of the way operations can be fused to achieve greater performance improvements. Today, we are delivering just that by providing users with the ability to specify how operations can be fused.
Furthermore, this new capability allows for seamless conversion of TensorFlow Keras LSTM operations—one of our most requested features. And to top it off, you can now plug in a user-defined RNN conversion to TensorFlow Lite!
Fused operations are more efficient
As mentioned earlier, TensorFlow operations are typically composed of a number of primitive, more granular operations, such as . Executing a composite operation is equivalent to executing each of its constituent operations.until now!
Out-of-the-box RNN conversion and other composite operation support
Out-of-the-box RNN conversion
We now support conversion of , both of which are composite TensorFlow operations. This is the simplest way to get RNN-based models to take advantage of the efficient LSTM fused operations in TensorFlow Lite. See RNN implementations.For more information, please look at our RNN conversion to enable conversion of other composite TensorFlow operations into existing or custom TensorFlow Lite operations.
The following steps are needed to implement a TensorFlow operation fusion to TensorFlow Lite:
- Wrap the composite operation in a tf.function. In the TensorFlow model source code, identify and abstract out the composite operation into a tf.function with the .
- Invoke the TensorFlow Lite converter. Use the . For detailed steps with code examples, see .
Feedback
Please email with the component label “TFLiteConverter”.Acknowledgements
This work would not have been possible without the efforts of Renjie Liu, a key collaborator on this project since its inception. We would like to thank Raziel Alvarez for his leadership and guidance. We would like to thank Jaesung Chung, Scott Zhu, Sean Silva, Mark Sandler, Andrew Selle, Qiao Liang and River Riddle for important contributions. We would like to acknowledge Sarah Sirajuddin, Jared Duke, Lawrence Chan, Tim Davis and the TensorFlow Lite team as well as Tatiana Shpeisman, Jacques Pienaar and the Google MLIR team for their active support of this work.↗ Original-Artikel auf blog.tensorflow.org lesenVollständiger Original-BerichtAusführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf blog.tensorflow.org.
SOCIAL SHARE CARD GENERATOR