STT-tensorflow/tf/tensorflow/compiler/mlir
2021-01-21 15:40:33 -08:00
..
g3doc initial 2021-01-21 09:06:36 -08:00
hlo sync to master 2021-01-21 15:40:33 -08:00
lite sync to master 2021-01-21 15:40:33 -08:00
python initial 2021-01-21 09:06:36 -08:00
tensorflow sync 2021-01-21 11:13:01 -08:00
tfjs initial 2021-01-21 09:06:36 -08:00
tfr initial 2021-01-21 09:06:36 -08:00
tools/kernel_gen initial 2021-01-21 09:06:36 -08:00
tosa initial 2021-01-21 09:06:36 -08:00
utils initial 2021-01-21 09:06:36 -08:00
xla initial 2021-01-21 09:06:36 -08:00
BUILD initial 2021-01-21 09:06:36 -08:00
glob_lit_test.bzl initial 2021-01-21 09:06:36 -08:00
init_mlir.cc initial 2021-01-21 09:06:36 -08:00
init_mlir.h initial 2021-01-21 09:06:36 -08:00
mlir_bridge_rollout_policy.cc initial 2021-01-21 09:06:36 -08:00
mlir_bridge_rollout_policy.h initial 2021-01-21 09:06:36 -08:00
mlir_graph_optimization_pass_registration.cc initial 2021-01-21 09:06:36 -08:00
mlir_graph_optimization_pass_test.cc initial 2021-01-21 09:06:36 -08:00
mlir_graph_optimization_pass.cc initial 2021-01-21 09:06:36 -08:00
mlir_graph_optimization_pass.h initial 2021-01-21 09:06:36 -08:00
op_or_arg_name_mapper.cc initial 2021-01-21 09:06:36 -08:00
op_or_arg_name_mapper.h initial 2021-01-21 09:06:36 -08:00
README.md initial 2021-01-21 09:06:36 -08:00
runlit.cfg.py initial 2021-01-21 09:06:36 -08:00
runlit.site.cfg.py initial 2021-01-21 09:06:36 -08:00
tf_mlir_opt_main.cc initial 2021-01-21 09:06:36 -08:00
tf_mlir_translate_main.cc initial 2021-01-21 09:06:36 -08:00

MLIR dialects and utilities for TensorFlow, TensorFlow Lite and XLA.

This module contains the MLIR (Multi-Level Intermediate Representation) dialects and utilities for

  1. TensorFlow
  2. XLA
  3. TF Lite

See MLIR's website for complete documentation.

Getting started

Building dialects and utilities here follow the standard approach using bazel as the rest of TensorFlow.

Using local LLVM repo

To develop across MLIR core and TensorFlow, it is useful to override the repo to use a local version instead of fetching from head. This can be achieved as below but note, the BUILD files are not automatically generated from or CMake used, so if your change requires a BUILD file change (or you are using a different version of LLVM than set in tensorflow/workspace.bzl's LLVM_COMMIT) then manual BUILD file changes may be required.

LLVM_SRC=...

# Create basic workspace file
echo 'workspace(name = "llvm-project")' > $LLVM_SRC/WORKSPACE
# and copy over the bazel BUILD files.
cp third_party/llvm/llvm.autogenerated.BUILD $LLVM_SRC/llvm/BUILD
cp third_party/mlir/BUILD $LLVM_SRC/mlir
cp third_party/mlir/test.BUILD $LLVM_SRC/mlir/test/BUILD

bazel build --override_repository=llvm-project=$LLVM_SRC \
  -c opt tensorflow/compiler/mlir:tf-opt