How are TFLite models generated from the MLIR tfl dialect IR?

359 views
Skip to first unread message

Simon King

unread,
Aug 1, 2021, 4:49:06 PM8/1/21
to TensorFlow Lite
Hi tflite team and friends,

I am working on a project of building TFLite models based on TFLite MLIR IR. According to one of your videos (https://youtu.be/R5LLIj8EMxw?t=1226 1), TFLite converter can translate tfl dialect MLIR IR to TFLite models. Therefore, I assume that the converter has integrated the tool that I need.

My questions are: (1) if I have the TFLite dialect IR, could I generate the tflite flatbuf file? (2) if the answer for (1) is yes, is there any resource that I can leverage? I know the mlir part of tflite is hosted in https://github.com/tensorflow/tensorflow/tree/5dcfc51118817f27fad5246812d83e5dccdc5f72/tensorflow/compiler/mlir/lite. But I don't know where to start.

Thanks!

Jaesung Chung

unread,
Aug 1, 2021, 7:59:31 PM8/1/21
to Simon King, TensorFlow Lite
Hi Simon King,

If you have the TFLite dialect IR-based module op in the MLIR, you can convert it through the following method:

MlirToFlatBufferTranslateFunction

Also I would recommend looking at the flatbuffer_* files under the tensorflow/compiler/mlir/lite directory.

Best regards,
Jaesung

--
You received this message because you are subscribed to the Google Groups "TensorFlow Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tflite+un...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tflite/c5e69eb5-314f-46b8-8bb6-5dac14538c4bn%40tensorflow.org.

Simon King

unread,
Aug 4, 2021, 2:54:54 PM8/4/21
to TensorFlow Lite, Jaesung Chung, Simon King
Thanks for your information!
Reply all
Reply to author
Forward
0 new messages