-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Port pgo.sh to Python #103019
Port pgo.sh to Python #103019
Conversation
Would it make sense to port it to Rust instead? |
You're not the first one to ask 😅 It would definitely be possible, but I'm not sure if it's a good tradeoff here. It would definitely complicate the build process, because we would have to build the script and/or somehow integrate it into bootstrap. This script mostly calls external programs (well, @Mark-Simulacrum @jyn514 What would you prefer here? Rust or Python? |
This comment has been minimized.
This comment has been minimized.
Python seems fine to me; we run this in environments we control so there's not as much motivation to have as few dependencies as possible. |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #101403) made this pull request unmergeable. Please resolve the merge conflicts. |
8c38f5e
to
e87274f
Compare
e87274f
to
400af2b
Compare
77a5836
to
34a419e
Compare
b574e2e
to
6c01196
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit a719397c5d3d637807edb6c953cd9acaf963b747 with merge 2ab228588f97afe565aed325316268b90f0ca680... |
@rustbot ready |
💔 Test failed - checks-actions |
efc40e0
to
5b77cb4
Compare
@bors try @rust-timer queue |
⌛ Trying commit 5b77cb4 with merge 383be05d5680f29b331dca7795e09a8a2a1f6f80... |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (383be05d5680f29b331dca7795e09a8a2a1f6f80): comparison URL. Overall result: no relevant changes - no action neededBenchmarking 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 Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis 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.
CyclesThis benchmark run did not return any relevant results for this metric. |
This comment has been minimized.
This comment has been minimized.
@bors r=Mark-Simulacrum |
@Kobzol: 🔑 Insufficient privileges: Not in reviewers |
@rustbot ready |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (f55b002): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesThis benchmark run did not return any relevant results for this metric. |
This PR ports the
pgo.sh
multi stage build file from bash to Python, to make it easier to add new functionality and gather statistics. Main changes:pgo.sh
rewritten from Bash to Python. Jump from ~200 Bash LOC to ~650 Python LOC. Bash is, unsurprisingly, more concise for running scripts and binaries.A sample run can be seen here.
I tried to keep the code compatible with Python 3.6 and don't use dependencies, which required me to reimplement some small pieces of functionality (like formatting bytes). I suppose that it shouldn't be so hard to upgrade to a newer Python or install dependencies in the CI container, but I'd like to avoid it if it won't be needed.
The code is in a single file
stage-build.py
, so it's a bit cluttered. I can also separate it into multiple files, although having it in a single file has some benefits. The code could definitely be nicer, but I'm a bit wary of introducing a lot of abstraction and similar stuff, as long as the code is stuffed into a single file.Currently, the Python pipeline should faithfully mirror the bash pipeline one by one. After this PR, I'd like to try to optimize it, e.g. by caching the LLVM builds on S3.
r? @Mark-Simulacrum