Repository navigation
Clean up several CMake options configured for our CI builds. - #5197
Conversation
This will test our default configuration on our "standard" `cmake_linux_x86-swiftshader` build. * samples were not tested on CI before, but they should be * docs build is tested implicitly by doc publication, does not need to be built here * python bindings are tested by builds that use the frontends (`cmake_bazel_linux_x86-swiftshader_tensorflow_integrations`)
| -DIREE_BUILD_SAMPLES=OFF \ | ||
| -DIREE_BUILD_DOCS=ON \ | ||
| -DIREE_BUILD_PYTHON_BINDINGS=ON .. | ||
| "$CMAKE_BIN" -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo .. |
There was a problem hiding this comment.
I like the idea that we should have a "standard" build that covers the default configuration options. That makes sure that if someone turns something on by default it's covered by CI. I think I left more options implicit when I first set this up, but during review someone (you?) suggested explicitly specifying the defaults. But maybe that was because at that point we had some things still disabled, so it made more sense to be explicit about what we were enabling.
- python bindings are tested by builds that use the frontends
These builds are way slower and people frequently don't (and shouldn't) wait for them. So not sure if it's actually a good idea to remove them from here.
- docs build is tested implicitly by doc publication, does not need to be built here
I disagree with this. Doc publication is only done occasionally. This is the only build that would check it on presubmit. Much better to get the quick feedback if this doesn't take long to build. In fact, the build has been failing for > a week (#5124).
So given that standing up a new build is somewhat of a pain, I would vote for leaving this one as explicitly enabling things and just flip samples to ON
There was a problem hiding this comment.
But maybe that was because at that point we had some things still disabled, so it made more sense to be explicit about what we were enabling.
Yep. Now that we're pretty stable I'd like to be more careful with setting options.
These builds are way slower and people frequently don't (and shouldn't) wait for them. So not sure if it's actually a good idea to remove them from here.
There are less than 10 tests in bindings/python/, and I have a strong suspicion that few changes outside of that directory would break only those builds/tests. If a change actually affects those tests differently, that change should wait for the appropriate presubmits.
There was a problem hiding this comment.
Pressed enter early...
I'm on the fence for IREE_BUILD_DOCS. I think build_tools/cmake/rebuild.sh should really be simple and not set any options. If build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader/build.sh wants to do something special, it shouldn't use that script. "Building the docs" with the CMake option on presubmit also didn't help catch that issue.
There was a problem hiding this comment.
"Building the docs" with the CMake option on presubmit also didn't help catch that issue.
My point is that that build isn't particularly carefully monitored it seems, so I wouldn't rely on it to catch issues (this one is an issue in parsing, so wouldn't be caught here).
There are less than 10 tests in bindings/python/, and I have a strong suspicion that few changes outside of that directory would break only those builds/tests. If a change actually affects those tests differently, that change should wait for the appropriate presubmits.
But it seems silly (and unfair) that someone should have to wait for us to build all of tensorflow so they can get feedback on python stuff, which for the most part requires no building of anything.
I think build_tools/cmake/rebuild.sh should really be simple and not set any options
Why? The explicit purpose of this script is "run things just as the CI would". It only exists as a separate script so that it can be run locally to decouple "I'm a CI VM just setting everything up for the first time" and "I want to test everything just as the CI does". I'll admit that our current collection of scripts is confusing and maybe this one should be under build_tools/kokoro, but I maintain that there's value in separating those two things.
There was a problem hiding this comment.
I'd really like to see these options removed here, but added back with some comments.
| "$CMAKE_BIN" -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo \ | ||
| -DIREE_BUILD_COMPILER=ON \ | ||
| -DIREE_BUILD_TESTS=ON \ | ||
| -DIREE_BUILD_SAMPLES=OFF \ |
There was a problem hiding this comment.
Two tests are failing on CMake but passing on Bazel?
RUNNING TEST: custom-opt -split-input-file /tmpfs/src/github/iree/iree/samples/custom_modules/dialect/test/custom_ops.mlir | custom-opt -split-input-file | IreeFileCheck /tmpfs/src/github/iree/iree/samples/custom_modules/dialect/test/custom_ops.mlir
----------------
/tmpfs/src/github/iree/iree/tools/run_lit.sh: line 115: IreeFileCheck: command not found
I'm trying to sort out why...
There was a problem hiding this comment.
Probably because Bazel is stricter about tracking deps and these ones aren't properly declared somehow. I think I've seen this as a flakey failure before.
There was a problem hiding this comment.
The direct deps are simple and appear correct: https://github.com/google/iree/blob/6ac002385f7cc6e4a3c997f84591e613c8238fc7/iree/samples/custom_modules/dialect/test/CMakeLists.txt#L13-L22
Seems like some part of https://github.com/google/iree/blob/main/build_tools/cmake/iree_lit_test.cmake isn't handling the current working directory in the same way as Bazel when running the tests (indirectly through several scripts). Other lit tests using tools like iree-opt have their tools at iree/tools/, while these have custom-opt at iree/samples/custom_modules/dialect/
There was a problem hiding this comment.
It looks like the iree/tools source directory is on the path:
EXPLICIT_PATH=/tmpfs/src/github/iree/iree/tools:/tmpfs/src/github/iree/build/iree/samples/custom_modules/dialect:
but there wouldn't be an IreeFileCheck there, only IreeFileCheck.sh. I suspect the condition in https://github.com/google/iree/blob/6ac002385f7cc6e4a3c997f84591e613c8238fc7/build_tools/cmake/iree_lit_test.cmake#L66-L67 doesn't work. Everything else would get iree/tools on the path because of another dep
There was a problem hiding this comment.
I've hacked at this for a while and made little progress. I can tell that if I change IreeFileCheck to IreeFileCheck.sh in the test files, the tests get further.
Adding a DEPENDS on FileCheck here: https://github.com/google/iree/blob/0c2f9e8b847109f6ec0186a34fad3ab5c135ea48/iree/tools/CMakeLists.txt#L388-L395
or as a DATA dep here: https://github.com/google/iree/blob/0c2f9e8b847109f6ec0186a34fad3ab5c135ea48/iree/samples/custom_modules/dialect/test/CMakeLists.txt#L13-L22
then helps find FileCheck (used by IreeFileCheck)
I'm pretty confused tracing through the various layers of scripts, build system configuration, and platform specific details here. Seems like #818 would help.
There was a problem hiding this comment.
That looks reasonable to me, actually. Removing the special case seems worth it.
There was a problem hiding this comment.
I think the issue is that the dependency information is lost, so I think depping on iree_tools_IreeFileCheck will no longer cause the custom command to run
There was a problem hiding this comment.
But maybe add_depencencies on the executable will work. I wasn't sure because it's imported, but let's see
There was a problem hiding this comment.
Ok I am once again deep in CMake confusion, but our current lit tests don't have targets you can build, so the whole dependency situation is tenuous anyway. I'll try out this fix
There was a problem hiding this comment.
Well adding an add_dependencies(iree_tools_IreeFileCheck _IreeFileCheck_Driver) causes a dependency cycle?!
CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
"_IreeFileCheck_Driver" of type UTILITY
depends on "_IreeFileCheck_Driver" (strong)
The component contains at least one cycle consisting of strong dependencies (created by add_dependencies) that cannot be broken.
I think this has to do with
Dependencies added to an imported target or an interface library are followed transitively in its place since the target itself does not build.
although I confess I don't actually understand what that sentence means...
Add back python bindings and docs to rebuild.sh.
|
Thanks for the help! Tested on Windows and the samples tests are passing there now too. I'll merge with a squashed commit since there are a bunch more commits now :P |
* 82d8765 Merge branch 'google' into main-to-google * b7e2b09 Remove special casing for IreeFileCheck in iree_lit_test.cmake (#5209) * b67af5a Clean up several CMake options configured for our CI builds. (#5197) * ea8b82d Integrate MLIR-EmitC at iml130/mlir-emitc@68547d0 (#5205) * 10d9ea1 Make CPU/GPU end-to-end testing in Linalg on tensors/buffers align. (#5203) * ff69d02 Move prepration of benchmark files to python script. (#5201) * 0c2f9e8 Bump Abseil-cpp submodule to LTS 20200923, Patch 3 (#5198) * 6ac0023 Add runtime tracing support to passes under IREE's PassManager usage. (#5160) * 2e41217 Bump Benchmark submodule to 39c8d58 (#5196) * 663ab93 Adjust UnixLinkerTool flags used for Apple targets. (#5164) * 963beb9 Plumb pooling ops through Linalg on tensors path. (#5136) * a33f72f Plumb depthwise convolution in Linalg on tensors. (#5189) * 2864ee4 Add restrictions for enabling generic op vectorization. (#5188) * 4f218a8 Make sure convolution vectorization is off when the option flag is off (#5187) * 44736b5 build_tools:cmake:riscv: Fix the system library path (#5175) * 96e9c49 Switching from mhlo::ConvertOp to ZeroExtendI for i1->i8 conversion. (#5119) * da4ad51 Fix and re-enable jax testing (#5183) * 301bc15 Merge google -> main (#5182) * 400719c Shuffling around/removing some HLO deps. * 9ba1d57 Enable MobileBert on GPU for the linalg on tensors path. (#5180) * 52f02af Resolve name conflicts while linking executables in LLVM. (#5179) * 4a732d3 Removing the post-partitioning conversion pass as it is unused. We've built up.. COPYBARA_INTEGRATE_REVIEW=#5212 from ScottTodd:main-to-google 82d8765 PiperOrigin-RevId: 364658113
* 82d8765 Merge branch 'google' into main-to-google * b7e2b09 Remove special casing for IreeFileCheck in iree_lit_test.cmake (#5209) * b67af5a Clean up several CMake options configured for our CI builds. (#5197) * ea8b82d Integrate MLIR-EmitC at iml130/mlir-emitc@68547d0 (#5205) * 10d9ea1 Make CPU/GPU end-to-end testing in Linalg on tensors/buffers align. (#5203) * ff69d02 Move prepration of benchmark files to python script. (#5201) * 0c2f9e8 Bump Abseil-cpp submodule to LTS 20200923, Patch 3 (#5198) * 6ac0023 Add runtime tracing support to passes under IREE's PassManager usage. (#5160) * 2e41217 Bump Benchmark submodule to 39c8d58 (#5196) * 663ab93 Adjust UnixLinkerTool flags used for Apple targets. (#5164) * 963beb9 Plumb pooling ops through Linalg on tensors path. (#5136) * a33f72f Plumb depthwise convolution in Linalg on tensors. (#5189) * 2864ee4 Add restrictions for enabling generic op vectorization. (#5188) * 4f218a8 Make sure convolution vectorization is off when the option flag is off (#5187) * 44736b5 build_tools:cmake:riscv: Fix the system library path (#5175) * 96e9c49 Switching from mhlo::ConvertOp to ZeroExtendI for i1->i8 conversion. (#5119) * da4ad51 Fix and re-enable jax testing (#5183) * 301bc15 Merge google -> main (#5182) * 400719c Shuffling around/removing some HLO deps. * 9ba1d57 Enable MobileBert on GPU for the linalg on tensors path. (#5180) * 52f02af Resolve name conflicts while linking executables in LLVM. (#5179) * 4a732d3 Removing the post-partitioning conversion pass as it is unused. We've built up.. PiperOrigin-RevId: 364658113
Uh oh!
There was an error while loading. Please reload this page.