Skip to content
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

Only apply LTO to rustdoc at stage 2 #136586

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Feb 5, 2025

It doesn't make much sense at stage 1, and it was broken anyway. This was implemented in #135832. The issue with LTO and stage 1 rustdoc was reported here.

r? @onur-ozkan

@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 Feb 5, 2025
@Kobzol
Copy link
Contributor Author

Kobzol commented Feb 5, 2025

@bors try @rust-timer queue

Just to make sure that it doesn't regress perf.

@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 Feb 5, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 5, 2025
Only apply LTO to rustdoc at stage 2

It doesn't make much sense at stage 1, and it was broken anyway. This was implemented in rust-lang#135832. The issue with LTO and stage 1 rustdoc was reported [here](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/x.20test.20with.20lto.20.3D.20.22thin.22.20fails.20to.20build.20rustdoc.3F).

r? `@onur-ozkan`
@bors
Copy link
Contributor

bors commented Feb 5, 2025

⌛ Trying commit 046385b with merge f02aecb...

@jieyouxu
Copy link
Member

jieyouxu commented Feb 5, 2025

If LTO applied to rustdoc is broken at stage 1, won't it still be broken if applied at stage 2...? 🤔

@Kobzol
Copy link
Contributor Author

Kobzol commented Feb 5, 2025

It is only "broken" because we also skip LTO in stage 1 for librustc_driver.so and friends, upon which rustdoc depends. So we need to do the same for rustdoc too, otherwise it will miss the LTO bitcode.

@saethlin
Copy link
Member

saethlin commented Feb 5, 2025

because we also skip LTO in stage 1 for librustc_driver.so and friends

So does this mean my lto = "thin" setting in config.toml is ineffectual for x build library and I need to do a stage2 to build to see optimizations that are remotely similar to a distributed build?

@jieyouxu
Copy link
Member

jieyouxu commented Feb 5, 2025

That seems strange in general, if that is indeed the case... 🤔

@Kobzol
Copy link
Contributor Author

Kobzol commented Feb 5, 2025

because we also skip LTO in stage 1 for librustc_driver.so and friends

So does this mean my lto = "thin" setting in config.toml is ineffectual for x build library and I need to do a stage2 to build to see optimizations that are remotely similar to a distributed build?

If you're talking about LTO optimizing librustc_driver.so, then yes, it is currently only performed for stage 2, not lower stages. The CI performance is much more affected by PGO + BOLT (~30%) than LTO (5-10%) though.

@bors
Copy link
Contributor

bors commented Feb 5, 2025

☀️ Try build successful - checks-actions
Build commit: f02aecb (f02aecb6948aa43ec48735055369961182d0a915)

@rust-timer

This comment has been minimized.

Copy link
Member

@onur-ozkan onur-ozkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM other than a non-blocker nit

src/bootstrap/src/core/build_steps/tool.rs Outdated Show resolved Hide resolved
It doesn't make much sense at stage 1, and it was broken anyway.
@Kobzol Kobzol force-pushed the lto-rustdoc-fix-stage-1 branch from 046385b to cfa3518 Compare February 5, 2025 21:21
@onur-ozkan
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 6, 2025

📌 Commit cfa3518 has been approved by onur-ozkan

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 6, 2025
@lqd
Copy link
Member

lqd commented Feb 6, 2025

perf results will be ready in 20 mins

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f02aecb): comparison URL.

Overall result: no relevant changes - 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 benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary -1.1%, secondary 0.3%)

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)
6.4% [6.4%, 6.4%] 1
Improvements ✅
(primary)
-1.1% [-1.1%, -1.1%] 1
Improvements ✅
(secondary)
-2.7% [-2.8%, -2.7%] 2
All ❌✅ (primary) -1.1% [-1.1%, -1.1%] 1

Cycles

Results (primary 2.7%, secondary 3.2%)

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)
2.7% [2.1%, 3.3%] 5
Regressions ❌
(secondary)
3.2% [2.5%, 3.9%] 15
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.7% [2.1%, 3.3%] 5

Binary size

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

Bootstrap: 778.541s -> 779.409s (0.11%)
Artifact size: 328.82 MiB -> 328.83 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 6, 2025
@lqd
Copy link
Member

lqd commented Feb 6, 2025

@Kobzol: it's likely unrelated because they're not doc benchmarks, but look at these cycles results what the eff

@Kobzol
Copy link
Contributor Author

Kobzol commented Feb 6, 2025

Yeah it's most probably unrelated. Probably solar flares.

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 7, 2025
…ur-ozkan

Only apply LTO to rustdoc at stage 2

It doesn't make much sense at stage 1, and it was broken anyway. This was implemented in rust-lang#135832. The issue with LTO and stage 1 rustdoc was reported [here](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/x.20test.20with.20lto.20.3D.20.22thin.22.20fails.20to.20build.20rustdoc.3F).

r? `@onur-ozkan`
@bors
Copy link
Contributor

bors commented Feb 7, 2025

⌛ Testing commit cfa3518 with merge 433a03d...

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Contributor

bors commented Feb 7, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 7, 2025
@onur-ozkan
Copy link
Member

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)


What the hack?

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 8, 2025
@jieyouxu
Copy link
Member

jieyouxu commented Feb 8, 2025

There was I think a github actions outage at that time or sth. Or sometimes a job just doesn't get picked up for whatever reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants