Fix windows iree+tensorflow build and verify tests.#2035
Fix windows iree+tensorflow build and verify tests.#2035stellaraccident wants to merge 5 commits intoiree-org:masterfrom
Conversation
stellaraccident
commented
May 28, 2020
- Switches us to MSVC for the supported windows compiler.
- Uses a couple of magic flags that keep the TF kernels from taking a lot of time to compile and inlining the world to bloat the binary size.
- The whole shebang builds for me now in a few minutes and produces a ~76MB compiler binary. While large, this is manageable for now.
- We still have a fragile relationship with which TF kernels are compiled in and what we can subsequently handle (relying on constant folding to paper over op support issues). We'll need to triage these one by one.
- There are a couple of bugs that seem MSVC/Windows specific -- will need to track down.
* Switches us to MSVC for the supported windows compiler. * Uses a couple of magic flags that keep the TF kernels from taking a lot of time to compile and inlining the world to bloat the binary size. * The whole shebang builds for me now in a few minutes and produces a ~76MB compiler binary. While large, this is manageable for now. * We still have a fragile relationship with which TF kernels are compiled in and what we can subsequently handle (relying on constant folding to paper over op support issues). We'll need to triage these one by one. * There are a couple of bugs that seem MSVC/Windows specific -- will need to track down.
|
PTAL |
|
Yay! No need to set the env beforehand is nice. I kinda always forget that. (Mostly using CMake though.) |
| build:rs --project_id=iree-oss | ||
|
|
||
| ############################################################################### | ||
| # Windows specific flags for building with VC. |
There was a problem hiding this comment.
This is awesome :D
I tested locally (threadripper 3970x so unfair comparison with other CPUs).
My builds before this were ~1h, with nearly all of the time spent compiling a long tail of TF kernels on a few threads. The build would run in parallel efficiently for ~10 minutes then be basically idle working on ~8 kernel files for 50 minutes.
Test steps (using Colab as the target since it pulls in most of the relevant deps):
bazel clean --expunge
python3 configure_bazel.py
python3 .\colab\start_colab_kernel.py
user.bazelrc (note that I use separate caches and output_user_root for separate repositories/branches to try to keep as much state cached per branch as possible)
startup --output_user_root=D:/dev/cache/bazeluserroot
build --disk_cache=D:/dev/cache/bazelcache --experimental_guard_against_concurrent_changes
build:debug --compilation_mode=dbg --copt=/O2 --per_file_copt=iree@/Od --strip=never
build --define=iree_tensorflow=true
Timing:
8:58 start
300s "Fetching @aws;"
9:03 finished fetching, build running (128 actions in parallel)
9:04 821/2656
9:05 3747/4793 (working on tf targets)
9:06 4005/4793 (tf kernels, core/util/batch_util.cc)
9:07 4885/5342 (starting llvm/lib/CodeGen/...)
9:08 5275/5726 (more LLVM)
9:09 5893/6256 (LLVM, MLIR, IREE)
9:10 6693/6842 (IREE, XLA, MLIR, linking IREE python bindings)
finished 9:10
There was a problem hiding this comment.
(super scientific :P looks like https://docs.bazel.build/versions/master/skylark/performance.html#profile-and-analyze-profile would give more concrete data)
| $ git clone https://github.com/google/iree.git | ||
| $ cd iree | ||
| $ git submodule update --init | ||
| $ git submodule update --initss |
There was a problem hiding this comment.
Is there a typo here now? (this is pending merge, can fixup after)
There was a problem hiding this comment.
ugh. for some reason vscode stopped accepting ctrl+s and I was looking everywhere for where the extra 's''s went. sorry :(