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 commented on 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:
We're currently using:
cpython/configure.ac
Lines 2199 to 2212 in b60044b
Suggesting we should explore -split-strategy=cdsplit, -hugify, and -plt
zanieb commented on Jan 5, 2025
There's some commentary in #124948 (comment)
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.
liusy58 commented on Jan 7, 2025
Ask me everything if you need. And I am now working on BOLT, I also want to contribute to Python!
liusy58 commented on Jan 7, 2025
By the way, I wonder how you collect profiles? By instrumentation or perf ?
liusy58 commented on Jan 7, 2025
I strongly recommend that --split-all-cold should be added.
zanieb commented on 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-cpython team to run benchmarks https://github.com/faster-cpython/benchmarking-public
I have a few commits ready
liusy58 commented on Jan 8, 2025
Profiles are key to BOLT. You are on x86, right? I remember cdsplit is not supported on AArch64.
zanieb commented on Jan 8, 2025
I have machines with both architectures.
Are you suggesting an alternative approach to measuring the effect?
liusy58 commented on Jan 8, 2025
Yeah, maybe aarch64 can get more performance.
zanieb commented on 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 commented on 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 commented on Jan 15, 2025
FYI, We are getting BOLTed binary through instrumentation, not perf, when we actually build.
corona10 commented on Jan 15, 2025
I belive that we don't have to, if only the difference between baseline is flag :)
corona10 commented on Jan 15, 2025
(I am adding myself as assignee to catch up)
zanieb commented on 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 commented on Feb 9, 2025
Following up with more analysis here
hugify
cdsplit
cdsplit
split-all-cold
zanieb commented on Feb 9, 2025
I'm not sure what's up with sqlglot_normalize
zanieb commented on 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