You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
python-build-standalone recently added -hugify and -split-strategy=cdsplit (astral-sh/python-build-standalone#462), though the performance benefits were not validated.
My intent is to do some benchmarking for each flag.
As an update, I set up an x86-64 bare metal machine with LLVM 19 and am running benchmarks for the flags I described above. I'm not including LTO in the baseline, should I?
As an update, I set up an x86-64 bare metal machine with LLVM 19 and am running benchmarks for the flags I described above. I'm not including LTO in the baseline, should I?
I belive that we don't have to, if only the difference between baseline is flag :)
Activity
zanieb commentedon Jan 5, 2025
There was a talk in March 2024 at the LLVM Performance Workshop; I can't find a copy of the talk online but the slides are available at https://llvm.org/devmtg/2024-03/slides/practical-use-of-bolt.pdf
It includes the following suggestions:
-split-functions,-split-strategy=cdsplit-reorder-functions=cdsort-reorder-blocks=ext-tsp-hugify-plt-icf-indirect-call-promotionWe're currently using:
cpython/configure.ac
Lines 2199 to 2212 in b60044b
Suggesting we should explore
-split-strategy=cdsplit,-hugify, and-pltzanieb commentedon Jan 5, 2025
There's some commentary in #124948 (comment)
python-build-standalonerecently added-hugifyand-split-strategy=cdsplit(astral-sh/python-build-standalone#462), though the performance benefits were not validated.My intent is to do some benchmarking for each flag.
liusy58 commentedon Jan 7, 2025
Ask me everything if you need. And I am now working on BOLT, I also want to contribute to Python!
liusy58 commentedon Jan 7, 2025
By the way, I wonder how you collect profiles? By instrumentation or perf ?
liusy58 commentedon Jan 7, 2025
I strongly recommend that
--split-all-coldshould be added.zanieb commentedon Jan 7, 2025
I was going to collect benchmarks with https://github.com/python/pyperformance (i.e., not instrumentation) on my Linux machine.
I think I can also post branches and ask the
faster-cpythonteam to run benchmarks https://github.com/faster-cpython/benchmarking-publicI have a few commits ready
-hugify: a2e6596-split-strategy=cdsplit: 4afb98a-split-all-cold: 3edb8c2liusy58 commentedon Jan 8, 2025
Profiles are key to BOLT. You are on x86, right? I remember cdsplit is not supported on AArch64.
zanieb commentedon Jan 8, 2025
I have machines with both architectures.
Are you suggesting an alternative approach to measuring the effect?
liusy58 commentedon Jan 8, 2025
Yeah, maybe aarch64 can get more performance.
zanieb commentedon Jan 10, 2025
As an update, I set up an x86-64 bare metal machine with LLVM 19 and am running benchmarks for the flags I described above. I'm not including LTO in the baseline, should I?
zanieb commentedon Jan 11, 2025
Here are my initial results https://gist.github.com/zanieb/eee897b77597f93d0d3e0c2081dbc712
Script at https://github.com/zanieb/cpython-bench/tree/34680389f94795b7b42d8c8dc784be34f0b14ce2
corona10 commentedon Jan 15, 2025
FYI, We are getting BOLTed binary through instrumentation, not perf, when we actually build.
corona10 commentedon Jan 15, 2025
I belive that we don't have to, if only the difference between baseline is flag :)
corona10 commentedon Jan 15, 2025
(I am adding myself as assignee to catch up)
zanieb commentedon Jan 16, 2025
A second round of benchmarks with more samples comes out a little different https://gist.github.com/zanieb/8614bcb40b0db24dd678f2983146fb43
The effect depends on the workload.
zanieb commentedon Feb 9, 2025
Following up with more analysis here
hugify
cdsplit
cdsplit
split-all-cold
zanieb commentedon Feb 9, 2025
I'm not sure what's up with
sqlglot_normalizezanieb commentedon Feb 10, 2025
I did another benchmark with all three of the aforementioned flags added. It looks like together, there's a more consistent speedup.
https://gist.github.com/zanieb/2e043b5f1f415a0b1e98fcf72465c0fa