Skip to content

Finish severing integrations/tensorflow from the CI #13037

Closed

Description

@stellaraccident

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

  1. julianwa commented on Apr 12, 2023

    @julianwa
    Member

    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.

  2. moved this from Inbox to Needs Scheduling in (Deprecated) IREEon Apr 12, 2023
  3. stellaraccident commented on Apr 12, 2023

    @stellaraccident
    CollaboratorAuthor

    They are all shardable. Do what you need to do to track and get people working on it.

  4. stellaraccident commented on Apr 12, 2023

    @stellaraccident
    CollaboratorAuthor

    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.

  5. ScottTodd commented on Apr 12, 2023

    @ScottTodd
    Member
    • 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.

    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-tflite with a Python API? I'd like to

  6. jpienaar commented on Apr 12, 2023

    @jpienaar
    Member

    Are there similar plans to replace iree-import-tflite with a Python API?

    Yes, I'll try and get started on that today (also happy if anyone wants to jump in, but I can do it).

  7. ScottTodd commented on Apr 12, 2023

    @ScottTodd
    Member
    • 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.

    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

    1. Is https://github.com/openxla/iree/tree/main/integrations/tensorflow/iree_tf_compiler/TF still in use?
    2. Is iree-tf-opt still in use?

    If both are no longer used, we can delete them and integrations/tensorflow/iree-dialects/. Otherwise, we might want to first convert integrations/tensorflow/iree-dialects/ back into a symlink (I could revive #8681 for that).

  8. stellaraccident commented on Apr 12, 2023

    @stellaraccident
    CollaboratorAuthor
    • 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.

    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

    1. Is https://github.com/openxla/iree/tree/main/integrations/tensorflow/iree_tf_compiler/TF still in use?
    2. Is iree-tf-opt still in use?

    If both are no longer used, we can delete them and integrations/tensorflow/iree-dialects/. Otherwise, we might want to first convert integrations/tensorflow/iree-dialects/ back into a symlink (I could revive #8681 for that).

    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.

  9. pzread commented on Apr 12, 2023

    @pzread
    Contributor

    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.

    I'll look into dropping the dependency of build_tf_integrations from 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:

    1. Download the fixed imported MLIR from GCS
    2. Compile those MLIRs with iree-compile
    3. Run benchmarks with the compiled VMFB

    And if people want to update the MLIR for e2e benchmarks:

    1. Bump the pinned binary version in the update script
    2. Run the update script to generate the new MLIR and upload to GCS
    3. Update the GCS links in the e2e benchmark definitions

    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

  10. stellaraccident commented on Apr 12, 2023

    @stellaraccident
    CollaboratorAuthor

    In the short term the fastest way is probably just to install a pinned release of iree-import-tflite in our docker container.

    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).

    ${IREE_PYTHON3_EXECUTABLE} -m pip install iree-tools-tflite=={someversion}  -f https://openxla.github.io/iree/pip-release-links.html
    

    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.

  11. 18 remaining items

  12. added a commit that references this issue on Jul 11, 2023
  13. added a commit that references this issue on Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions