Pin the ISA that source builds target in the base images - #50
Merged
Conversation
rcannood
force-pushed
the
portable-native-builds
branch
from
August 21, 2026 05:17
67eb85e to
6cd865e
Compare
13 tasks
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.
Pin the instruction set that source builds target, instead of inheriting the build machine's.
hnswlibandannoypublish no wheels and theirsetup.pyadds-march=native, so whether an image runs anywhere depends on which CPU the GitHub runner happened to be. An image built on an AVX-512 runner dies withIllegal instructionon anything older.This is not hypothetical: in the last batch integration benchmark run,
kbet_pglost all 124 of its tasks to SIGILL whilekbet_pg_label-- same source, same pegasus version, different runner -- passed all 248.import hnswlibalone was enough to crash.scanorama_correctlost all 6 the same way via annoy. Both images have since been rebuilt and are fine again, which is exactly the problem.ANNOY_COMPILER_ARGSreplaces annoy's whole flag list, so it repeats annoy's own defaults with-march=nativeswapped out.HNSWLIB_NO_NATIVEonly drops the flag, soCFLAGS/CXXFLAGS/CPPFLAGSare what put a defined ISA back. Three variables because build backends disagree about which one they read.x86-64-v3(AVX2/FMA/BMI2) is satisfied by every de.NBI node and every AWS Batch instance type we use.x86-64-v2would be the fallback if anyone needs pre-2015 hardware.Verified on
base_python:hnswlibgoes from 47 AVX-512 instructions to 0 while keeping its AVX kernels (323ymmreferences, up from 316),annoylikewise, and both still import.