Repository navigation
Build wheels for a portable x86-64-v2 baseline; bump to 0.2.8 - #19
Merged
Merged
Conversation
.cargo/config.toml sets target-cpu=native, so CI-built wheels were compiled for the GitHub runner's CPU, which has AVX-512. The published wheels then crash with SIGILL on CPUs without it (verified: bmp 0.2.7 on an AVX2-only AMD CPU, on every Python 3.9-3.15). Keep native for local builds, and have the publish workflow overwrite the config with target-cpu=x86-64-v2 before building each wheel. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Published wheels crash with
SIGILL(illegal instruction) on CPUs without AVX-512..cargo/config.tomlsets-C target-cpu=native, so the wheels built bypublish-to-pypi.ymlare compiled for the GitHub runner's CPU, which supports AVX-512.Checked with the published
bmp 0.2.7wheels on an AMD Threadripper PRO 3955WX (AVX2, no AVX-512): importing the extension crashes with exit code 132 on every Python from 3.9 to 3.15. Each_bmp*.socontains 900-2700 AVX-512 instructions. The 0.2.6 wheels did the same.Change
publish-to-pypi.yml: before eachBuild wheelsstep (Linux, Windows, macOS), overwrite.cargo/config.tomlwithtarget-cpu=x86-64-v2(SSE4.2, POPCNT), which essentially all x86-64 CPUs support..cargo/config.tomlis unchanged, so local builds still usetarget-cpu=native.Why x86-64-v2
The source has no explicit SIMD besides
_mm_prefetch(baseline x86-64); all vector code is compiler autovectorization. On a synthetic workload (150k docs, 1500 queries, one AMD Zen 2 machine, Python 3.12) I measured:target-cpuSo no measurable gain from the newer baselines there. It's one workload on one CPU; if you'd rather have AVX2 (
x86-64-v3) as the floor, it's a one-word change in the workflow step.Verification (Linux x86_64, Python 3.15)
I ran the exact
run:command from the workflow step, thenmaturin build --release --manifest-path python/Cargo.toml. The wheel contains 0 AVX2 instructions, versus 6414 for a build with the unmodified config. In both cases an index-and-search run returns the same documents and scores as before. I did not run the publish workflow itself, or build on Windows or macOS.🤖 Generated with Claude Code