Skip to content

Port PGO/LTO/BOLT optimized build pipeline to Rust#112235

Merged
bors merged 1 commit intorust-lang:masterfrom
Kobzol:opt-dist
Jul 9, 2023
Merged

Port PGO/LTO/BOLT optimized build pipeline to Rust#112235
bors merged 1 commit intorust-lang:masterfrom
Kobzol:opt-dist

Conversation

@Kobzol
Copy link
Member

@Kobzol Kobzol commented Jun 3, 2023

This PR ports the stage-build.py PGO/LTO/BOLT optimization script from Python to Rust, to make it easier to use dependencies, and make it a bit more robust. The PR switches both the Linux and Windows dist runners to the Rust script and removes the old Python script.

Funnily enough, the Rust port has less lines of code than the Python script :) I think that clearly shows that the Python script really lacked dependencies.

@rustbot
Copy link
Collaborator

rustbot commented Jun 3, 2023

r? @Mark-Simulacrum

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jun 3, 2023
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Jun 3, 2023
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@Kobzol
Copy link
Member Author

Kobzol commented Jun 3, 2023

@bors try

@bors
Copy link
Collaborator

bors commented Jun 3, 2023

⌛ Trying commit 408578eea211c890c45c32baa3983dc1abd64776 with merge da5b8ab81a6270a5a4e49c3725bfde81a7faf6a7...

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jun 3, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 3, 2023
@Kobzol
Copy link
Member Author

Kobzol commented Jun 3, 2023

@bors try

@bors
Copy link
Collaborator

bors commented Jun 3, 2023

⌛ Trying commit 21c5a4f1533a34c1611ab68d1a835b1c8f3f8284 with merge 3babef129a16a88b15d4852eb488c50661b97be2...

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jun 3, 2023

💔 Test failed - checks-actions

@Kobzol
Copy link
Member Author

Kobzol commented Jun 4, 2023

@bors try

@bors
Copy link
Collaborator

bors commented Jun 4, 2023

⌛ Trying commit e81b1be849ddf3974e4b374fc2ced4b1fabf0562 with merge 53b17b880d3f17a78cd8ee30eb7833c2e27abe3e...

@Kobzol
Copy link
Member Author

Kobzol commented Jul 1, 2023

@bors try

@bors
Copy link
Collaborator

bors commented Jul 1, 2023

⌛ Trying commit 256ef913bfa09454a0644322f434f2cf3ffdec13 with merge 5ad9065b98fa007c9dd5ac8e5bce67eeccbcef6b...

@rust-log-analyzer

This comment was marked as outdated.

@bors
Copy link
Collaborator

bors commented Jul 1, 2023

☀️ Try build successful - checks-actions
Build commit: 5ad9065b98fa007c9dd5ac8e5bce67eeccbcef6b (5ad9065b98fa007c9dd5ac8e5bce67eeccbcef6b)

@Kobzol
Copy link
Member Author

Kobzol commented Jul 1, 2023

I decided to implement support for Windows in this PR, and also remove the old Python script, to make this PR "atomic". Both Linux and Windows CI has passed, along with all the dist tests. I'll now run a perf run just to make sure that perf. is still OK. I removed PGO training on core in this PR (which goes along the direction of removing training on stage 2 rustc, which was done recently), so the results will probably be slightly different.

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 1, 2023
@bors
Copy link
Collaborator

bors commented Jul 1, 2023

⌛ Trying commit afe26d37b87c2d491f2f04305569c89cfffb6730 with merge 7ad6e315ce5f70086a83e4a57150a941cb42f78b...

@bors
Copy link
Collaborator

bors commented Jul 1, 2023

☀️ Try build successful - checks-actions
Build commit: 7ad6e315ce5f70086a83e4a57150a941cb42f78b (7ad6e315ce5f70086a83e4a57150a941cb42f78b)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7ad6e315ce5f70086a83e4a57150a941cb42f78b): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.4%, -0.2%] 2
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.2% [1.2%, 1.2%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.3% [-3.0%, -0.4%] 5
Improvements ✅
(secondary)
-3.6% [-5.5%, -2.5%] 3
All ❌✅ (primary) -0.9% [-3.0%, 1.2%] 6

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.6% [-0.7%, -0.5%] 2
Improvements ✅
(secondary)
-10.9% [-11.9%, -10.3%] 6
All ❌✅ (primary) -0.6% [-0.7%, -0.5%] 2

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 661.138s -> 661.963s (0.12%)

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Jul 1, 2023
@Kobzol
Copy link
Member Author

Kobzol commented Jul 1, 2023

@rustbot ready

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 1, 2023
@Mark-Simulacrum
Copy link
Member

r=me with this rebased

@Kobzol
Copy link
Member Author

Kobzol commented Jul 9, 2023

@bors r=Mark-Simulacrum

@bors
Copy link
Collaborator

bors commented Jul 9, 2023

📌 Commit 91d2fb2 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Jul 9, 2023

⌛ Testing commit 91d2fb2 with merge 1861088...

@bors
Copy link
Collaborator

bors commented Jul 9, 2023

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing 1861088 to master...

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1861088): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 1
Improvements ✅
(primary)
-0.9% [-1.3%, -0.5%] 38
Improvements ✅
(secondary)
-0.8% [-2.3%, -0.3%] 11
All ❌✅ (primary) -0.9% [-1.3%, -0.5%] 38

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.3% [1.3%, 1.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.5% [2.1%, 2.9%] 2
Improvements ✅
(primary)
-1.5% [-1.5%, -1.5%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.5% [-1.5%, -1.5%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 655.641s -> 658.609s (0.45%)

@lqd
Copy link
Member

lqd commented Jul 9, 2023

This looks to me like the #113485 (comment) noise returning to steady state.

@lqd lqd mentioned this pull request Jul 9, 2023
@wesleywiser
Copy link
Member

This is really awesome work @Kobzol! 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.