Repository navigation
Description
With #13025, we're pretty close to severing the integrations/tensorflow binary builds from our main CI. I propose the following steps. Each generates immediate value:
- Delete iree-import-xla: This was needed prior to Jax/et-al generating StableHLO and I am not aware of current cases which require this bridge component. @jpienaar
- Remove build_tf_integrations as a dependency for followon jobs (i.e. tests and benchmarks): iree-import-tf was the hard one and that is almost gone. We should just install iree-import-tflite (the only remaining one) from a pinned binary release for jobs that need it. @pzread
- Stop updating the tensorflow version as part of LLVM integrate.
- Delete integrations/tensorflow/iree-dialects and stop updating it during integrate: There is one dangling ref to it in iree_tf_compiler but it looks like it just wasn't removed from the BUILD file but is in fact unused. @ScottTodd
- Fix the MLIR bitcode export in the TF APIs (currently it doesn't register stablehlo so we are emitting text). @jpienaar (fixed in tensorflow/tensorflow@58ea274)
- Only trigger build_tf_integrations if a file changed in integrations/tensorflow/iree_tf_compiler.
- Move iree-import-tflite either to its own repo or into Tensorflow itself #13061 @jpienaar
- Clean up "Building TensorFlow frontend bindings" documentation @ScottTodd
The first three steps are relatively easy and would: a) decouple the project maintenance from TensorFlow version locks, and b) Remove 18 minutes from the critical path of each CI action.
The interlinks between these components are "stableish" -- either by policy or practicality, they don't drift much. I believe that we just need to start relying on this and remove them from lock-step. We should have a contingency plan for if there is a catastrophic compatibility breakage so that we can circumvent (which will typically involve upgrading something). I've observed that this so rarely happens in practice that we should not be paying an ongoing tax to keep things together now that things have settled.
Activity
julianwa commentedon Apr 12, 2023
I added this to a new Epic for tacking: #13043
@jpienaar for this particular issue, are there items in the checklist above that are separable and can be sharded out? Please convert those items to issues if so. I can help find people to work on this once we've got it factored.
stellaraccident commentedon Apr 12, 2023
They are all shardable. Do what you need to do to track and get people working on it.
stellaraccident commentedon Apr 12, 2023
As if on queue, the integrate this morning triggered an inscrutable tensorflow build error. I gave @ThomasRaoux permission to stop bumping tf as part of the integrate.
ScottTodd commentedon Apr 12, 2023
That would simplify the CI but could make it more difficult to test changes to the importer. That does seem worth it to me, but it is a departure from how our CI currently builds everything that it reasonably can from source.
Are there similar plans to replace
iree-import-tflitewith a Python API? I'd like tojpienaar commentedon Apr 12, 2023
Yes, I'll try and get started on that today (also happy if anyone wants to jump in, but I can do it).
Integrate LLVM at llvm/llvm-project@0dbcbfe0 (#13035)
ScottTodd commentedon Apr 12, 2023
That appears to still be used by https://github.com/openxla/iree/blob/main/integrations/tensorflow/iree_tf_compiler/TF/SavedModelToIreeABI.cpp and https://github.com/openxla/iree/blob/0462114c73eea5ed7a290392d72624a9b79ceff7/integrations/tensorflow/iree_tf_compiler/iree-tf-opt-main.cpp#L35-L37
iree-tf-optstill in use?If both are no longer used, we can delete them and
integrations/tensorflow/iree-dialects/. Otherwise, we might want to first convertintegrations/tensorflow/iree-dialects/back into a symlink (I could revive #8681 for that).stellaraccident commentedon Apr 12, 2023
I was going to drop all of that in a followup. Have it in a stash but just wanted a smaller revert surface in case if the main PR needs to be undone. There are no live refs to any of this, just incidental.
pzread commentedon Apr 12, 2023
I'll look into dropping the dependency of
build_tf_integrationsfrom the benchmark steps. In the short term the fastest way is probably just to install a pinned release of iree-import-tflite in our docker container.And later we can probably step forward to the idea below (from an offline discussion):
If we decide to use the pinned binary release to import models into MLIR for benchmarks, we can just switch to using the fixed imported MLIR as source models and not importing the models in every build.
The rationale: If iree-import-tf/tflite is just a wrapper of Python API with pinned release of tensorflow/tflite in CI, their MLIR output won't change unless we bump the pinned version.
So a script and clear document about how to re-generate and update the MLIR for e2e benchmarks from source models could be enough, in case we want to use a newer version of tensorflow to import the model.
Therefore, the e2e benchmarks in CI workflow will become:
And if people want to update the MLIR for e2e benchmarks:
Today we are already doing something like this for our benchmarks with PyTorch model
https://github.com/openxla/iree/blob/92cc535aebc48dbd238ad03fdd0449196ba4f27f/build_tools/python/e2e_test_framework/models/torch_models.py#L11-L16
stellaraccident commentedon Apr 12, 2023
Possibly just install a pinned binary here: https://github.com/openxla/iree/blob/main/build_tools/cmake/setup_local_python.sh. Also likely rename that to "setup_tf_deps.py" as that is what it is called to do (I just added it yesterday for this case).
Then you just remove the hardcoding in the cmake invocation for
-DIREE_IMPORT_TFLITE_PATH="${IREE_TF_BINARIES_DIR}/iree-import-tflite"and let it be found on the path.18 remaining items
Delete old TensorFlow Bazel code, docs, and flags. (#13437)
Merge "Python bindings and importers" page into "getting started". (i…
Delete old TensorFlow Bazel code, docs, and flags. (iree-org#13437)
Merge "Python bindings and importers" page into "getting started". (i…
Delete old TensorFlow Bazel code, docs, and flags. (iree-org#13437)
[tf] Use bytecode in emission.
[tf] Use bytecode in emission.
Integrate LLVM at llvm/llvm-project@0dbcbfe0 (iree-org#13035)
Delete `integrations/tensorflow/iree-dialects/` and `iree-tf-opt`. (i…
Delete unused iree-import-xla path (iree-org#13068)
Merge "Python bindings and importers" page into "getting started". (i…
Delete old TensorFlow Bazel code, docs, and flags. (iree-org#13437)
[tf] Use bytecode in emission
[tf] Use bytecode in emission. (#13360)
[tf] Use bytecode in emission. (iree-org#13360)