|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | - | - |
| common/ | | 04-Jul-2025 | - | 121 | 71 |
| experimental/tac/ | | 04-Jul-2025 | - | 8,800 | 6,051 |
| ir/ | | 04-Jul-2025 | - | 10,084 | 7,646 |
| metrics/ | | 04-Jul-2025 | - | 789 | 547 |
| python/ | | 04-Jul-2025 | - | 1,391 | 1,039 |
| quantization/ | | 04-Jul-2025 | - | 12,439 | 8,942 |
| sparsity/ | | 04-Jul-2025 | - | 169 | 114 |
| tests/ | | 04-Jul-2025 | - | 35,567 | 31,911 |
| transforms/ | | 04-Jul-2025 | - | 15,573 | 11,259 |
| utils/ | | 04-Jul-2025 | - | 3,974 | 2,751 |
| BUILD | D | 04-Jul-2025 | 39.1 KiB | 1,268 | 1,208 |
| README.md | D | 04-Jul-2025 | 1.5 KiB | 36 | 28 |
| converter_gen.cc | D | 04-Jul-2025 | 22.2 KiB | 581 | 403 |
| emit_error_reporter.cc | D | 04-Jul-2025 | 1 KiB | 28 | 9 |
| emit_error_reporter.h | D | 04-Jul-2025 | 1.4 KiB | 40 | 16 |
| flatbuffer_export.cc | D | 04-Jul-2025 | 91.8 KiB | 2,297 | 1,817 |
| flatbuffer_export.h | D | 04-Jul-2025 | 2.5 KiB | 56 | 21 |
| flatbuffer_export_flags.h | D | 04-Jul-2025 | 1.3 KiB | 32 | 9 |
| flatbuffer_import.cc | D | 04-Jul-2025 | 60.8 KiB | 1,519 | 1,239 |
| flatbuffer_import.h | D | 04-Jul-2025 | 2.2 KiB | 48 | 17 |
| flatbuffer_operator.cc | D | 04-Jul-2025 | 12.4 KiB | 335 | 266 |
| flatbuffer_operator.h | D | 04-Jul-2025 | 3.3 KiB | 82 | 35 |
| flatbuffer_to_mlir.cc | D | 04-Jul-2025 | 3.7 KiB | 103 | 77 |
| flatbuffer_to_mlir.h | D | 04-Jul-2025 | 1.2 KiB | 33 | 10 |
| flatbuffer_to_string.cc | D | 04-Jul-2025 | 4.4 KiB | 143 | 98 |
| flatbuffer_translate.cc | D | 04-Jul-2025 | 8 KiB | 199 | 146 |
| flatbuffer_translate.h | D | 04-Jul-2025 | 2 KiB | 45 | 18 |
| flatbuffer_translate_flags.h | D | 04-Jul-2025 | 1.3 KiB | 32 | 9 |
| json_to_flatbuffer.cc | D | 04-Jul-2025 | 2 KiB | 64 | 42 |
| mlir_tflite_runner.cc | D | 04-Jul-2025 | 6.3 KiB | 163 | 114 |
| tf_tfl_passes.cc | D | 04-Jul-2025 | 21.6 KiB | 480 | 290 |
| tf_tfl_passes.h | D | 04-Jul-2025 | 3.2 KiB | 71 | 30 |
| tf_tfl_translate.cc | D | 04-Jul-2025 | 12.8 KiB | 319 | 242 |
| tf_tfl_translate_cl.cc | D | 04-Jul-2025 | 6.6 KiB | 174 | 99 |
| tf_tfl_translate_cl.h | D | 04-Jul-2025 | 2.6 KiB | 63 | 29 |
| tf_to_tfl_flatbuffer.cc | D | 04-Jul-2025 | 14.6 KiB | 348 | 281 |
| tf_to_tfl_flatbuffer.h | D | 04-Jul-2025 | 4.1 KiB | 84 | 42 |
README.md
1# The new MLIR based TensorFlow to TensorFlow Lite converter
2
3This directory contains:
4
51. [MLIR](https://github.com/llvm/llvm-project/tree/main/mlir) dialects,
6 transformation passes and utilities for TensorFlow Lite.
7
8## API:
9
10The API for converting TensorFlow models to TensorFlow Lite will be through
11`tf.lite.TFLiteConverter`. All the conversion code is open sourced, and
12the API will be integrated soon.
13
14### The conversion process from TensorFlow to TensorFlow Lite includes the
15following major passes:
16
17- Import from GraphDef, in .pb or .pbtxt format, into MLIR.
18- Raise to Control-flow-graph. Converts TF Control Flow dialect to TF dialect.
19- The Canonicalization pass iteratively applies canonicalization
20transformations in a greedy way until no further changes occur.
21Canonicalization includes constant folding.
22- The Legalize pass converts TensorFlow operations to TensorFlow Lite
23ones. The operations that cannot be mapped to TensorFlow Lite dialect
24are left as TensorFlow operations. Unsupported op handling follows the
25proposed TFLite mechanism.
26- Optimizations are performed in both the TF & TFLite dialect; aiming for small
27size and high performance (among the core value proposition of
28TensorFlow Lite models).
29- The Export pass writes out TensorFlow Lite FlatBuffer format. This pass
30operates on MLIR TensorFlow Lite dialect and is simple/direct translation.
31
32See
33https://github.com/tensorflow/tensorflow/blob/master/tensorflow/compiler/mlir/lite/tf_tfl_passes.cc
34for the full list of MLIR passes for conversion from TensorFlow to TensorFlow
35Lite.
36