I know that @bondhugula has a flow that works, and there was recently a long thread on IREE’s discord where we helped a motivated user extract what we had done. In our last meetup, he discussed pulling some kind of documentation together with findings and approach, but I am not aware of anything publicly yet (to a level of completeness that will be helpful).
The above (correct) directory does reveal a number of starting points, and I suspect that many people here can help with specific questions. The two tools you are looking for to start out with are tf-translate to convert in/out of MLIR and tf-opt.
(Disclaimer: I am primarily a user of tensorflow, not involved with what is prioritized in this area)
The primary lowerings is towards MHLO and then from there to LinAlg, SCF, Affine. But different approaches across here and in IREE too I believe. As Stella mentioned we need to pull the documentation for this together still. @mehdi_amini also still has a pending date to talk about this at ODM.
Your assumption isn’t right! MLIR is used via the llvm-project external repository that TensorFlow depends on. This is usually just a few weeks behind the llvm trunk. All MLIR/TF stuff is actively maintained/tested.
What I cannot find is the compilation instructions for the code. I have installed bazel, but when I execute ./configure it never asks me where to search for LLVM/MLIR, and of course I have no idea how to launch the compilation (there is no top-level Makefile). Is there some quick guide on this somewhere? Or maybe you have a script that automates it?
It gets updated to head about 2x a day during work week
There is, but none documented there specifically: you’d have to change the bazel workspace file to point to local checkout instead, or you could try overriding the repo ( External dependencies - Bazel main) and would need to copy over the build files needed (the build files are not autogenerated nor is cmake used there; I haven’t used this approach though but could be least changes).
I normally just modify the checked out version from its cached location for small changes. Given the update frequency this is normally sufficient for me (rsync or just plain co from one to another). But I also mostly use a different build system and so haven’t tried much using bazel.
This would be a good addition to a MD doc there if folks find a good way that works well.
--override_repository=llvm-project=<your llvm-project copy>
(you’ll have to copy three BUILD files - one for llvm-project and two for mlir into your llvm-project repo - see tensorflow/workspace.bzl under llvm-project external dep).