Uh oh!
There was an error while loading. Please reload this page.
ci: Conditionally build parallel compiler on try - #59417
Conversation
rust-highfive
commented
Mar 25, 2019
(rust_highfive has picked a reviewer for you, use r? to override) |
alexcrichton
commented
Mar 25, 2019
@bors: try Let's see what happens... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
d6b926b to
50e89c3Compare50e89c3 to
70ad29cCompare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
b47a1c3 to
acf826eCompare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
acf826e to
f21a904Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ci: Conditionally build parallel compiler on `try` This commit configures Travis/AppVeyor to conditionally compile parallel compilers on `@bors: try`. This is an experiment currently to see how this plays out, but the intention is that if the commit message contains the term "parallel-compiler" then when `@bors: try` is issued it will perform differently than the try branch does today, building three compilers: Linux, macOS, and Windows. We currently have no `try` builders for macOS or Windows due to typical capacity issues, so it's intended that this is only very sparingly used from time to time when necessary. [parallel-compiler]
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
f21a904 to
c357a1aComparealexcrichton
commented
Apr 1, 2019
@bors: try |
bors
commented
Apr 1, 2019
⌛ Trying commit 4382c25 with merge 9743253127ed10bcfb5b046647599d211f0b0a0b... |
alexcrichton
commented
Apr 1, 2019
@bors: try Ok I'm gonna run a test real quick and see what happens if we just enable compiling a parallel compiler but it defaults to 1 thread instead of num_cpus. I'm curious what sort of perf slowdown we'll see |
bors
commented
Apr 1, 2019
⌛ Trying commit c4fa1e0 with merge cb23a46f60b0233f366367dd11b5fdc241bce328... |
Zoxc
commented
Apr 1, 2019
There's another parallel compiler bug introduced in #58929, but it should still work with a single thread. |
bors
commented
Apr 1, 2019
☀️ Try build successful - checks-travis |
alexcrichton
commented
Apr 1, 2019
Let's see if we can get some ballpark numbers... @rust-timer build cb23a46f60b0233f366367dd11b5fdc241bce328 |
rust-timer
commented
Apr 1, 2019
Success: Queued cb23a46f60b0233f366367dd11b5fdc241bce328 with parent eab3eb3, comparison URL. |
rust-timer
commented
Apr 2, 2019
Finished benchmarking try commit cb23a46f60b0233f366367dd11b5fdc241bce328 |
alexcrichton
commented
Apr 2, 2019
Ok so that looks like it's a blanket 2-3% slowdown across the board if we enable parallel compilation and peg rustc to just one thread. That's... frankly amazing! I think given those kind of numbers it might actually be feasible to just turn this on by default for all releases. We'd get a small slowdown which we'd quickly be able to recover many times over by bumping up the default number of threads. @Zoxc I'm curious, do you think that rustc might be ready for this transition? Concretely I'd imagine that we'd turn on the Later once ready we could default threads to greater than 1, but until then we could allow testing on nightly via the unstable |
alexcrichton
commented
Apr 2, 2019
I've also started some chat on zulip about this! |
|
alexcrichton
commented
Apr 2, 2019
Ah yes sorry my mistake! The interesting metric here indeed is wall time, not instructions executed. That comparison URL is located here and is indeed unfortunately less inspiring, showing a blanket ~10% slowdown, which I think is a bit too serious to land just now. @Zoxc in addition to the question above about whether the compiler is ready for this, are you aware of low hanging fruit for optimizing? |
alexcrichton
commented
Apr 2, 2019
Hm well so it's also probably worthwhile noting the magnitude of changes here, it looks like all 10%+ changes are in tiny crates, regressing from 5 to 6 seconds for example. Larger crates like servo ones do regress but still on the order of a second in a 15 second compilation already, so I don't think it's necessarily damning evidence |
mati865
commented
Apr 2, 2019
|
Zoxc
commented
Apr 2, 2019
Turning on I'm not aware of any low hanging fruit, there might be some though as I've mostly focused on making the code run in parallel. Maybe @nnethercote wants to help here and look for some excessive locking? I'm working on getting rid of |
nnethercote
commented
Apr 2, 2019
One distinct downside of (true, multi-thread) parallelization is that it makes benchmarking much harder. Wall time is the true metric of interest, but it's so noisy that e.g. 1% improvements/regression are impossible to spot. Currently we can use instruction counts as a proxy for wall time, because instruction counts have much less variation, and they're a pretty good proxy. But true parallelization will majorly reduce the usefulness of instruction counts as a metric. It's a hard problem, I'm not sure what to do about it. It's one reason why I'm biased toward trying to improve coarse-grained parallelization (e.g. pipelining) rather than fine-grained parallelization. |
alexcrichton
commented
Apr 2, 2019
@nnethercote that's a good point! I suspect though we can solve it by always passing |
alexcrichton
commented
Apr 2, 2019
nnethercote
commented
Apr 2, 2019
@alexcrichton: Let's assume we reach the point where we are shipping a parallel compiler. |
Zoxc
commented
Apr 3, 2019
Seems like the locks are to blame for most of the regressions. |
alexcrichton
commented
Apr 3, 2019
Ok I think that we've identified an actionable way to go (thanks @Zoxc) so I don't think we're going to want to take this approach where To that end I'm going to close this and I've opened up #59667 to track further work. |
This commit configures Travis/AppVeyor to conditionally compile parallel
compilers on
@bors: try. This is an experiment currently to see howthis plays out, but the intention is that if the commit message contains
the term "parallel-compiler" then when
@bors: tryis issued it willperform differently than the try branch does today, building three
compilers: Linux, macOS, and Windows. We currently have no
trybuilders for macOS or Windows due to typical capacity issues, so it's
intended that this is only very sparingly used from time to time when
necessary.
cc #48685, tracking issue for parallel compilation