Hello, I am new to MLIR, and trying to lower tf dialect to MHLO dialect.
I have done this by tf-opt
command and worked.
The problem is, I want to use tf-opt
with python binding.
Is there any way to use tf-opt with python, or integrate it with LLVM’s MLIR build?
I know MLIR-HLO project can be integrated with llvm-project/mlir. Would the similar way be possible?
Thank you!
There is an experimental API to import a GraphDef and run passes: tensorflow/tensorflow/python/compiler/mlir/mlir_test.py at master · tensorflow/tensorflow · GitHub
It does not provide directly tf-opt
in the sense that the input has to be a GraphDef. What would be an example of a python API you’d want to see?
Actually, my primary goal is to lower tf dialect to hlo dialect.
I was doing this with the following command:
../bazel-bin/tensorflow/compiler/mlir/tf-opt --tf-to-hlo-pipeline savedmodel.mlir -o hlo.mlir
So even if there is no tf-opt
for python, it would be OK as long as there is an API that can apply this --tf-to-hlo-pipeline
pass to tf dialect.
Thanks for your reply!