iree-org / iree

A retargetable MLIR-based machine learning compiler and runtime toolkit.

Home Page:http://iree.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need suggestion on cmake option IREE_BUILD_TORCH_MLIR_SUPPORT

cathyzhyi opened this issue · comments

Describe the bug
This change #8840 breaks the iree-compiler-api standalone build https://github.com/google/iree/runs/6022078200?check_suite_focus=true because the IREE_BUILD_TORCH_MLIR_SUPPORT is not ON in this path https://github.com/google/iree/blob/abe06bbd9637c663637694c19f5d26397b7a1ca7/llvm-external-projects/iree-compiler-api/CMakeLists.txt#L33.

There are 2 ways to fix this:

  1. keep IREE_BUILD_TORCH_MLIR_SUPPORT default ON and duplicate the IREE_BUILD_TORCH_MLIR_SUPPORT option before this line https://github.com/google/iree/blob/abe06bbd9637c663637694c19f5d26397b7a1ca7/llvm-external-projects/iree-compiler-api/CMakeLists.txt#L45
  2. flip the meaning of the flag and set it to default OFF. This can avoid duplicating the cmake option.

In #8896, we chose to go ahead with option 1 as it's the smallest change needed and can unblock other work. Need suggestion on whether this is the proper fix.

Option 1 (as implemented in that PR) SGTM.

We could also move the option up or down, out of this "experimental" section: https://github.com/google/iree/blob/b4c3716385b93b55b1f9b58e4bd7945093280192/CMakeLists.txt#L63-L70

Maybe a new section just under IREE_BUILD_PYTHON_BINDINGS or in the block with IREE_BUILD_SAMPLES, IREE_BUILD_TRACY, etc.

Thanks for the feedback. Moved the option in #8995.