Attempt to run parallel frontend CI#158307
Conversation
It's added to give threads inside the compiler opportunity to use multiple cores simultaneously, which gives better chance for bugs to occur. |
| tests/codegen-llvm \ | ||
| tests/codegen-units \ | ||
| -- \ | ||
| --parallel-frontend-threads=4 --iteration-count=2 \ |
There was a problem hiding this comment.
Only tests/ui tests need to be run in this mode.
For non-TestMode::Ui suites --parallel-frontend-threads=4 doesn't do anything anyway, and running ui-fulldeps is just not important enough.
The second run can then --exclude tests/ui.
| tests/codegen-llvm \ | ||
| tests/codegen-units \ | ||
| -- \ | ||
| --parallel-frontend-threads=4 --iteration-count=2 \ |
There was a problem hiding this comment.
The N in --iteration-count=N depends on the available CI resources.
The more the better, of course, but right now even one iteration would be acceptable, I think (see "Enabling parallel UI test suite on CI" in rust-lang/compiler-team#1005).
Note that RUST_TEST_THREADS=1 makes things really slow.
I'll leave this for the infra team to decide.
There was a problem hiding this comment.
I will rerun the job again to check the time. Generally speaking, I would expect that this test job does not become the slowest job which is generally around 3h 15m.
|
r? @jieyouxu |
Oh, indeed.
I believe it can all be tweaked with a script though? For instance, we could use something like Which would improve performance drastically. This introduces machine-dependency, but maybe it's not big of an issue here |
|
@petrochenkov could you grant me bors capabilities, please? |
|
@bors delegate=try |
|
✌️ @heinwol, you can now perform try builds on this pull request! Warning You used the legacy format of the delegate command. You can now post |
|
@bors try jobs=optional-x86_64-gnu-parallel-frontend |
This comment has been minimized.
This comment has been minimized.
Attempt to run parallel frontend CI try-job: optional-x86_64-gnu-parallel-frontend
This comment has been minimized.
This comment has been minimized.
|
Oh actually test failure could be genuine: If we can fix this I can re-evaluate the CI time. @rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
| ENV SCRIPT python3 ../x.py --stage 2 test \ | ||
| tests/ui \ | ||
| -- \ | ||
| --parallel-frontend-threads=4 --iteration-count=2 \ |
There was a problem hiding this comment.
Suggestion: like what the MCP (rust-lang/compiler-team#1005), can we start with --parallel-frontend-threads=4 and --iteration-count=1 to get this PR landed sooner? We can tune the specific M and N in a follow-up PR later based on more measurements.
|
It's really strange: I can reliably reproduce this test failure each time, even in completely non-parallel scenario: ...
ENV RUST_CONFIGURE_ARGS \
--build=x86_64-unknown-linux-gnu \
--enable-sanitizers \
--enable-profiler \
--enable-compiler-docs \
--set llvm.libzstd=true
# --set rust.parallel-frontend-threads=4
ENV RUST_TEST_THREADS=1
ENV SCRIPT python3 ../x.py --stage 2 test \
tests/rustdoc-ui/doctest/no-capture.rsI couldn't find any related issues in test suite. Maybe we could just ignore this test for now? Otherwise we could add some additional normalization rule (not sure if it doesn't diminish the purpose of the test though) |
|
For me Only |
by setting `RUST_TEST_THREADS=1` for ui tests only
a20a4b8 to
1ae84f6
Compare
|
@bors try jobs=optional-x86_64-gnu-parallel-frontend |
This comment has been minimized.
This comment has been minimized.
Attempt to run parallel frontend CI try-job: optional-x86_64-gnu-parallel-frontend
|
That try job took 4h which is a bit concerning |
This comment has been minimized.
This comment has been minimized.
Attempt to run parallel frontend CI try-job: optional-x86_64-gnu-parallel-frontend
|
@bors try |
This comment has been minimized.
This comment has been minimized.
Attempt to run parallel frontend CI try-job: optional-x86_64-gnu-parallel-frontend
|
Things we can do to speedup the job:
|
View all comments
WIP
Supersedes #157705.
The issue with the original change was arguments
--parallel-frontend-threads=4 --iteration-count=2being compiletest-only. They were being passed to other parts of the test harness (e.g. libtest) as is. These parts, however, have no clue of the arguments, hence the errors.I've spent a lot of time on this and haven't found any reasonable way to fix this behavior. We could make bootstrap aware of these specific two arguments and have an additional internal logic for handling this. It's big of a hack, i reckon. The best decision i arrived at is to split testing into two parts: one for compiletest only and another for everything else. The issue is (AFAIK) we can't tell bootstrap (or x.py, at least) to "test the default stuff, but only for compiletest". When used like
x test tests/it runs all the tests in this directory, including non-default ones, and crashes as it can't find nodejs for doctests.--skip compiler/ --skip library/ --skip src/tools/ --skip tests/incremental ...is still not exhaustive list of exclusions.I went on with a whitelist instead of a blacklist. But we, again, can't tell what tests are "default". There's a mechanism in bootstrap::core::builder::Builder for showing "dry-run" test suites, but it's not available from the cli. For now, my whitelist is quite small and i have no idea what should it be like.
Also, i added
ENV RUST_TEST_THREADS=1just because it was introduced by @ zetanumbers; i'm not sure it's necessary. It ran ok in the previous iteration.Finally, i'm not sure it works for now, i'm still spending hours blindly guessing the maxumum working set of tests. I've decided to make the pr now just to have something done and seek advice.
r? @petrochenkov
try-job: optional-x86_64-gnu-parallel-frontend