-
Notifications
You must be signed in to change notification settings - Fork 15k
[MLIR][Standalone] test Standalone against install distributions #157944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: users/makslevental/mono
Are you sure you want to change the base?
[MLIR][Standalone] test Standalone against install distributions #157944
Conversation
6cff170
to
6b77807
Compare
✅ With the latest revision this PR passed the Python code formatter. |
56936a0
to
efe7ace
Compare
mlir/test/Examples/standalone/test.install-distribution-dir.toy
Outdated
Show resolved
Hide resolved
92b9aa0
to
5fd5500
Compare
It's worth mentioning that these tests become the slowest tests:
Given the stubgen fiasco, I think it's worth it. |
857cb13
to
dcc9b4a
Compare
Note, this PR depends on #158090 because currently (HEAD) the |
8ec2384
to
a331d64
Compare
a331d64
to
64f5d11
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know much about CMake, so my comments aren't very helpful.
@@ -53,7 +53,7 @@ | |||
|
|||
tool_dirs = [config.standalone_tools_dir, config.llvm_tools_dir] | |||
tools = [ | |||
"mlir-opt", | |||
ToolSubst("mlir-opt", pre=";", post=";", unresolved="fatal"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what this does, but why only change this one and not the others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way these bare string tool substitutions work is regex replace with some path to the actual executable. So what happens is all the run strings that look like # RUN: mlir-opt ...
turn into # RUN: /install/bin/mlir-opt ...
. That's fine generally but it's a problem here because
-DLLVM_DISTRIBUTION_COMPONENTS="...;mlir-opt;..."
get's turned into
-DLLVM_DISTRIBUTION_COMPONENTS="...;/install/bin/mlir-opt;..."
The pre
/post
args function as barriers:
llvm-project/llvm/utils/lit/lit/llvm/subst.py
Lines 57 to 63 in bfe6b3b
pre: If specified, the substitution will not find matches where | |
the character immediately preceding the word-boundary that begins | |
`key` is any of the characters in the string `pre`. | |
post: If specified, the substitution will not find matches where | |
the character immediately after the word-boundary that ends `key` | |
is any of the characters specified in the string `post`. |
why only change this one and not the others?
I also changed mlir-tblgen
in the other lit.cfg.py
. I could do it for the rest as well but that can be a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, I changed this to be actually ToolSubst("mlir-opt", post=";", unresolved="fatal")
.
@@ -65,6 +65,12 @@ if (MLIR_INCLUDE_INTEGRATION_TESTS) | |||
|
|||
endif() | |||
|
|||
option(MLIR_RUN_STANDALONE_INSTALL_TESTS "Run Standalone example install tests." ON) | |||
if(MLIR_RUN_STANDALONE_INSTALL_TESTS AND "${CMAKE_INSTALL_PREFIX}" STREQUAL "") | |||
message(WARNING "Standalone example install tests will install into root!\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by root
? The GIT root? /
? The build directory root?
Usually, when I do automatic installs for CI, I set it to %build/install
, so that it's guaranteed to be writable by the build process and in the same filesystem (ex. the source directory may be NFS and slow).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If CMAKE_INSTALL_PREFIX
is empty and you do ninja install
it'll try to install to /lib
, /include
, etc. That's what this means - that if you've enabled MLIR_RUN_STANDALONE_INSTALL_TESTS
but you've not explicitly set CMAKE_INSTALL_PREFIX
to be something then you probably made a mistake.
One of the two tests is probably redundant - we can just have the distribution tests because it (I believe) subsumes the full install (I'm assuming that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me this seems more like an integration test that should run on a buildbot somewhere rather than within lit. Especially given the time it takes to run this test. I remember this test already being the longest running test for MLIR on many-core machines and thus stretching the runtime. The MLIR tests for me currently take about 10-15 seconds with this test enabled (at least on premerge). Adding a test that takes five minutes I don't think is tenable to run within premerge. That is at least a 20% increase in runtime for every single PR that tests MLIR for a single test which represents a huge amount of CI load.
Otherwise, two other lower level comments:
- Passing through the
CMAKE_INSTALL_PREFIX
from the parent CMake is weird. This patch can probably do what libc++ does and install to a directory inside the build directory. ninja install-distribution
is probably the target you actually want to be running here.
If you pass a new
Fair enough. I can disable it by default and land a PR to zorg with |
I'm not saying to adjust |
And I'm saying that currently that will have no effect because we do not use that string to reconfigure CMAKE_INSTALL_PREFIX and that if we did that it would be bad for the user. |
4f1236f
to
536bdbf
Compare
This PR adds two tests that exercise standalone build:
test full install
, which tests building the standalone example using a full install;test install distribution
, which tests building the standalone example usingDLLVM_DISTRIBUTION_COMPONENTS=...
(specifically the one mentioned here).The tests are gated by a CMake arg
MLIR_RUN_STANDALONE_INSTALL_TESTS
.