• Home
Name Date Size #Lines LOC

..--

common/04-Jul-2025-12171

experimental/tac/04-Jul-2025-8,8006,051

ir/04-Jul-2025-10,0847,646

metrics/04-Jul-2025-789547

python/04-Jul-2025-1,3911,039

quantization/04-Jul-2025-12,4398,942

sparsity/04-Jul-2025-169114

tests/04-Jul-2025-35,56731,911

transforms/04-Jul-2025-15,57311,259

utils/04-Jul-2025-3,9742,751

BUILDD04-Jul-202539.1 KiB1,2681,208

README.mdD04-Jul-20251.5 KiB3628

converter_gen.ccD04-Jul-202522.2 KiB581403

emit_error_reporter.ccD04-Jul-20251 KiB289

emit_error_reporter.hD04-Jul-20251.4 KiB4016

flatbuffer_export.ccD04-Jul-202591.8 KiB2,2971,817

flatbuffer_export.hD04-Jul-20252.5 KiB5621

flatbuffer_export_flags.hD04-Jul-20251.3 KiB329

flatbuffer_import.ccD04-Jul-202560.8 KiB1,5191,239

flatbuffer_import.hD04-Jul-20252.2 KiB4817

flatbuffer_operator.ccD04-Jul-202512.4 KiB335266

flatbuffer_operator.hD04-Jul-20253.3 KiB8235

flatbuffer_to_mlir.ccD04-Jul-20253.7 KiB10377

flatbuffer_to_mlir.hD04-Jul-20251.2 KiB3310

flatbuffer_to_string.ccD04-Jul-20254.4 KiB14398

flatbuffer_translate.ccD04-Jul-20258 KiB199146

flatbuffer_translate.hD04-Jul-20252 KiB4518

flatbuffer_translate_flags.hD04-Jul-20251.3 KiB329

json_to_flatbuffer.ccD04-Jul-20252 KiB6442

mlir_tflite_runner.ccD04-Jul-20256.3 KiB163114

tf_tfl_passes.ccD04-Jul-202521.6 KiB480290

tf_tfl_passes.hD04-Jul-20253.2 KiB7130

tf_tfl_translate.ccD04-Jul-202512.8 KiB319242

tf_tfl_translate_cl.ccD04-Jul-20256.6 KiB17499

tf_tfl_translate_cl.hD04-Jul-20252.6 KiB6329

tf_to_tfl_flatbuffer.ccD04-Jul-202514.6 KiB348281

tf_to_tfl_flatbuffer.hD04-Jul-20254.1 KiB8442

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