Skip to content

Use full LTO for all builds #343

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

Merged
merged 1 commit into from
Jan 13, 2025
Merged

Use full LTO for all builds #343

merged 1 commit into from
Jan 13, 2025

Conversation

Fidget-Spinner
Copy link
Contributor

@Fidget-Spinner Fidget-Spinner commented Jan 11, 2025

Closes #342

GCC defaults to full LTO with --with-lto=yes passed. Clang defaults to ThinLTO with --with-lto=yes passed. You need --with-lto=full to enable full LTO.

@@ -320,7 +320,7 @@ jobs:
if: ${{ steps.should_run.outputs.should_run != 'false' }}
run: |
cd cpython
./configure ${{ inputs.pgo == true && '--enable-optimizations --with-lto=yes' || '' }} ${{ inputs.tier2 == true && '--enable-experimental-jit=interpreter' || '' }} ${{ inputs.jit == true && '--enable-experimental-jit=yes' || '' }} ${{ inputs.nogil == true && '--disable-gil' || '' }}
./configure ${{ inputs.pgo == true && '--enable-optimizations --with-lto=full' || '' }} ${{ inputs.tier2 == true && '--enable-experimental-jit=interpreter' || '' }} ${{ inputs.jit == true && '--enable-experimental-jit=yes' || '' }} ${{ inputs.nogil == true && '--disable-gil' || '' }}
Copy link
Contributor Author

@Fidget-Spinner Fidget-Spinner Jan 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit tricky. Apple Clang defaults to ThinLTO on recent versions as well. So after this commit, we would need to be careful when benchmarking and make sure it's comparing to a recent CPython commit (and not an old one prior to this commit).

I'm still in favour of this change anyways, because full LTO produces more reproducible benchmarking results, based on our experience in python/cpython#122580

@mdboom
Copy link
Contributor

mdboom commented Jan 13, 2025

We can merge this and then re-run all of the baselines (3.10, 3.11, 3.13) on macOS, and then backfill all of the comparisons.

Copy link
Contributor

@mdboom mdboom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mdboom mdboom merged commit 204029f into faster-cpython:main Jan 13, 2025
4 checks passed
@Fidget-Spinner Fidget-Spinner deleted the full_lto branch January 15, 2025 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clang builds not using full LTO
2 participants