⚡ Optimize release wheels with matched LTO and BOLT - #2476
Open
burgholzer wants to merge 5 commits into
Open
Conversation
Retain runtime and SDK interfaces while dropping unused ELF sections. Use persistent wheel compiler caching and the bundled Linux linker. Assisted-by: GPT-6 via Codex
This was referenced Sep 8, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Use full rather than thin LTO for Clang wheel builds and fail if explicitly requested wheel IPO is unavailable. Keep ordinary development defaults. Assisted-by: GPT-6 via Codex
Disable Windows wheel LTO and pin Linux images to the SDK build digests. Use assertion-enabled SDKs in regular C++ and Python CI. Assisted-by: GPT-6 via Codex
Use the LTO SDK with pinned Linux and macOS compilers and GNU ld for Linux BOLT links. Validate training, stripping, and repaired wheels. Split LLVM definitions correctly to preserve the nanobind platform ABI. Assisted-by: GPT-6 via Codex
Compare assertion-enabled and optimized builds with GCC 14. Record the BOLT memory reproduction and macOS ThinLTO tradeoff without extending local validation claims to hosted platforms. Assisted-by: GPT-6 via Codex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖
Description
Use full LTO in Core release wheels and the matched assertion-free Linux SDK; the macOS SDK uses cached ThinLTO to fit hosted build limits. Apply BOLT to Linux wheel binaries. Windows LTO stays disabled. Regular C++ and Python CI uses assertion-enabled SDKs; CD wheel jobs and their pull-request checks use the release variant.
Linux SDK and wheels share pinned manylinux 2.28 image digests from cibuildwheel 4.2.0; macOS selects Xcode 26.6. Linux BOLT links use GNU ld: mold 2.42.0 emitted invalid relocation symbol indices in the local full-LTO build. The SDK supplies the common optimizer and instrumentation runtime. Core trains DD, compiler, DDSIM/QIR JIT, and benchmark paths, uses LLVM stripping, repairs the wheel, regenerates RECORD hashes, and validates the repaired artifact before accepting it.
Keep section garbage collection for the DDSIM device and benchmark executable, shared sccache support across the container boundary, and the small packaged C++ SDK. Remove MSVC
/Zm10. Split LLVM's compiler definitions into proper CMake arguments so the explicit C++ ABI macro does not absorb subsequent flags and break nanobind imports.Local ARM64 comparison from identical LTO links and packaging: 43,964,801 → 39,808,676 bytes (9.5% smaller) with BOLT
-lite. Four held-out workloads improve by 1.4–3.4%. These are bounded measurements, not a cross-platform speedup claim. The broader BOLT rewrite increased wheel size by 40.6%, so it is not selected.A separate matched GCC 14 ARM64 comparison against the assertion-enabled/native-SDK policy measures 9.1% less time for vectors, 10.2% for matrix multiplication, 19.2% for OpenQASM to QCO, and 13.5% for Qiskit round trips. This measures assertions-off plus SDK/Core LTO and BOLT together, not assertion removal alone. The audit records the Linux BOLT OOM reproduction and swap validation, plus the macOS ThinLTO tradeoff and pending hosted checks.
Dependency gate: requires munich-quantum-software/portable-mlir-toolchain#94 and publication of its new archives, munich-quantum-software/setup-mlir#255, and munich-quantum-toolkit/workflows#464. Current workflow pins point to the companion review commits. Finalize the pins after those changes land; the current SDK release has no assertion-free assets.
Validation:
qirrunnermodule is skipped because it is not installed; training separately checks QIR JIT through DDSIM.The audit records measurements, packaging constraints, and the separate compiler-PGO investigation. AI assistance: implemented and validated with GPT-6 via Codex.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).