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

enable PGO on x86_64-apple-darwin #110639

Closed
wants to merge 2 commits into from
Closed

enable PGO on x86_64-apple-darwin #110639

wants to merge 2 commits into from

Conversation

csmoe
Copy link
Member

@csmoe csmoe commented Apr 21, 2023

r? @lqd

previous take #108837

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc 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) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Apr 21, 2023
@csmoe csmoe force-pushed the pgo-osx branch 2 times, most recently from 44684f3 to 922f251 Compare April 21, 2023 10:30
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@lqd
Copy link
Member

lqd commented Apr 21, 2023

The linking issue from the previous PR was not problematic, and easy to workaround locally. The resulting profiling data however caused errors depending on the binary tools used via cmake (between the llvm distributed tools and the osx devtools).
And then PGO wasn't able to find the data it needed when instrumenting, whereas on linux they're found immediately.

Compared to not using PGO on the same master commit, what are the benchmark results you're seeing locally with this PR ?

Until then, let's keep this as a draft, its not clear it's ready to be reviewed yet.
@rustbot author

@rustbot rustbot 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 Apr 21, 2023
@csmoe
Copy link
Member Author

csmoe commented Apr 21, 2023

Your previous PR wasn't problematic indeed, tried to rebase it with master, but a bit annoying to resolve conflicts in yaml file, so I created this one.

I work on an Apple M1 machine, still building.

The resulting profiling data however caused errors depending on the binary tools used via cmake

could you elaborate more about this?

@csmoe csmoe force-pushed the pgo-osx branch 3 times, most recently from b4b9a5f to 3bdbc8a Compare April 21, 2023 13:41
@jyn514
Copy link
Member

jyn514 commented Apr 22, 2023

Please run x test --stage 2 locally on this before enabling it by default. We don't test PGO in CI: #109535

@jyn514
Copy link
Member

jyn514 commented Apr 22, 2023

Actually that might not do the right thing; you need to get a PGO compiler to run the tests somehow, I don't know if x is able to do that. If not you may need to use build.rustc and x test --stage 0 in a second checkout.

@lqd
Copy link
Member

lqd commented Apr 23, 2023

Please run x test --stage 2 locally on this before enabling it by default

Tests, and benchmarks, yes. As I said before, I'm still working on this myself for rustc rather than LLVM, and I'm not sure similar changes would be enough: I have done this before and it wasn't enough just yet, but maybe I did it wrong; we'll see once we have some feedback about the results.

@lqd
Copy link
Member

lqd commented Apr 25, 2023

#110792 may add hurdles to this and #108837.

Our experimenting is fine, and good results could help in this discussion, but it seems unlikely that PGO would fit in the current runners time budget, under the exact same CI structure.

@csmoe
Copy link
Member Author

csmoe commented Apr 25, 2023

The initial motivation of this PR pair with #110605 is trying to dist PGO'ed rust toolchain for a huge monorepo, if rust-ci resources is restricted, a dry-run might be enough to make sure the PGO flow work on macos.

@jyn514
Copy link
Member

jyn514 commented Apr 25, 2023

I wouldn't trust --dry-run to tell you whether it will actually work or not. I don't like the idea of having code here that's only intended for external projects and we never use in CI.

@lqd
Copy link
Member

lqd commented Apr 25, 2023

to make sure the PGO flow work on macos

What results did you have locally:

  • do tests still pass with your PGOed compiler ?
  • what is the difference in performance (on rustc-perf benchmarks or your external huge monorepo, whichever is easier to gather) with your PGOed compiler, compared to the same rustc commit but built without PGO ?

@csmoe
Copy link
Member Author

csmoe commented Apr 25, 2023

I wouldn't trust --dry-run to tell you whether it will actually work or not. I don't like the idea of having code here that's only intended for external projects and we never use in CI.

To be clear, I'm not injecting unused code into rust-ci, but making the pgo flow more easier to reuse like a generic function.

Still testing locally, I'll post the benchmarks of rust-ci and the monorepo both here in the future.

@bors
Copy link
Contributor

bors commented May 27, 2023

☔ The latest upstream changes (presumably #112013) made this pull request unmergeable. Please resolve the merge conflicts.

@Dylan-DPC
Copy link
Member

@csmoe any updates on this?

@csmoe
Copy link
Member Author

csmoe commented Oct 24, 2023

@Dylan-DPC sorry, I'll retry this week.

@Dylan-DPC
Copy link
Member

cool no worries :)

@Dylan-DPC
Copy link
Member

Closing this as inactive. Feel free to reöpen this pr or create a new pr if you get the time to work on this. Thanks

@Dylan-DPC Dylan-DPC closed this Mar 15, 2024
@Dylan-DPC Dylan-DPC added S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 15, 2024
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 S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. 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.

7 participants