-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Adds profile guided optimization script. #17369
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
base: main
Are you sure you want to change the base?
Conversation
|
@MichaReiser could you checkout if this is a valid start for pgo? |
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| AIR311 | 1828 | 0 | 1828 | 0 | 0 |
| AIR301 | 134 | 134 | 0 | 0 | 0 |
| PERF403 | 12 | 6 | 6 | 0 | 0 |
| RUF043 | 2 | 2 | 0 | 0 | 0 |
Formatter (stable)
✅ ecosystem check detected no format changes.
Formatter (preview)
✅ ecosystem check detected no format changes.
|
Anything more that should be fixed? Was thinking if this works out good we could test adding it to the release pipeline. |
|
Sorry, I haven't had time to look at this yet (I was out all last week and we're getting close to an important release. That's why my time is a bit limited at the moment). But this PR is still on my todo list |
|
No problem, just didn't want it to be forgotten :) |
|
Any update on when this may be reviewed? |
|
Sorry, I'm very busy at the moment. It's on my list but I don't know when I'll get to it |
1 similar comment
|
Sorry, I'm very busy at the moment. It's on my list but I don't know when I'll get to it |
|
Are you still interested or should we close this? |
|
I saw ntBre say in another issue he’s off on PTO for a week, so you might not get a response till then |
|
I think we're definitely still interested, just need to find enough time to review it and think about how we'd want to incorporate it into our release process, as Micha mentioned on the issue. Thank you for your work on this! |
|
This PR is now more then 5 month old so I guess it only adds noise at this point. |
|
I still find it a valuable source to understand how to add a PGO script. |
Summary
This PR adds a script to generate a pgo optimized binary of ruff, see #7055 for more detail.
I initially only implemented the script on
x86_64-unknown-linux-gnuso people can try it out, if we think this is more interesting it should probably be added to the release pipeline. from what I can see you get a general 3-10% improvement of runtime speed then running the pgo-binaries, as well as a somewhat smaller binary size.The script fetches a large popular python codebases and uses that as training data (see
pgo_profile.json),this is an example of the performance for a cold run on pytorch's source, where the pgo is 12% faster.
Test Plan
I tested this by running
ensure you have cargo-pgo installed and configured.
run
python ./scripts/pgo.py