Conversation
cython-blis compiles the vendored BLIS sources listed in a pregenerated blis/_src/make/<platform>-<arch>.jsonl. setup.py's get_arch_name() already maps any Linux machine that is not x86_64/aarch64/ppc64le to the portable `generic` config, whose 297 compile specs carry only -O3/-fPIC/-std=c99 and no arch-specific flags, sources or intrinsics — so riscv64 needs no BLIS_ARCH override and no patch. Mirrors upstream's cibuildwheel.yml, narrowed to manylinux_riscv64, plus the test invocation from their separate tests.yml (install the wheel, run the suite that ships inside it via `pytest --pyargs blis -Werror`). Free-threaded builds are excluded because upstream's [tool.cibuildwheel] skips `cp3??t-*` and PyPI carries no cp3XXt wheel. Validated locally in quay.io/pypa/manylinux_2_39_aarch64 with BLIS_ARCH=generic: the wheel builds, carries both blis.cy/blis.py extensions and dist-info/licenses/LICENSE, and the suite passes.
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.
Adds
.github/workflows/build-blis.yml, building riscv64 wheels for blis (explosion/cython-blis) 1.3.3 for cp312/cp313/cp314. Upstream publishes real per-interpreter compiled wheels for linux x86_64/aarch64, macOS and Windows, but nothing for riscv64.Why this is a plain port
cython-blis does not run BLIS's own
configureat build time. It ships a pregeneratedblis/_src/make/<platform>-<arch>.jsonlper target, listing every object file's compiler/source/flags, andsetup.py'sExtensionBuilder.compile_objects()replays it.get_arch_name()mapsaarch64tocortexa57,ppc64letopower9, and anything else that is not x86_64 togeneric— so riscv64 selectslinux-genericwith noBLIS_ARCHoverride and no patch. That config's 297 compile specs carry only-O3 -fPIC -std=c99 -fvisibility=default(plus-funsafe-math-optimizations -ffp-contract=fast -fopenmp-simdon 45 of them), every source is.c, none live under anx86/avx/ssepath, andinclude/linux-generic/blis.hpulls in noimmintrin.hor inline asm. It is portable C throughout.Shape
Build-from-checkout with cibuildwheel, mirroring upstream's cibuildwheel.yml narrowed to
manylinux_riscv64. Upstream's[tool.cibuildwheel]table inpyproject.tomlis inherited as-is (build frontend, auditwheel repair command); the only overrides are the riscv64 image andPIP_EXTRA_INDEX_URL, which the build needs so thenumpy>=2.0.0,<3.0.0build requirement resolves to our registry's numpy 2.5.2 riscv64 wheel rather than compiling from sdist. Upstream's job-levelCC=clang/AR=llvm-arenv exists for the Windows leg only and never reaches the Linux container (theirenvironment-passis empty), so it is dropped here and the jsonl's owngccis used.Upstream tests wheels in a separate workflow, tests.yml: install the wheel, delete the source tree, then
python -m pytest --pyargs blis -Werror. That is reproduced asCIBW_TEST_COMMAND— the suite (blis/tests/) ships inside the wheel and--pyargsresolves it from the installed package, so there is nothing for the checkout to shadow.Free-threaded builds are excluded: upstream's
[tool.cibuildwheel] skip = "cp38* cp39* cp3??t-*"rules them out and PyPI carries nocp3XXtblis wheel on any platform.Licensing
The wheel already ships
blis-1.3.3.dist-info/licenses/LICENSE, and that file explicitly covers the vendored BLIS sources — it names The University of Texas at Austin, Hewlett Packard Enterprise and AMD alongside ExplosionAI, all under 3-clause BSD. No licence patch is needed.Local validation
quay.io/pypa/manylinux_2_39_aarch64withBLIS_ARCH=genericforced (same Rocky-family image, exercising the exactlinux-generic.jsonlpath riscv64 will take):pip wheel .producedblis-1.3.3-cp313-cp313-linux_aarch64.whlcontaining bothblis/cy...soandblis/py...soplus the LICENSE, andpython -m pytest --pyargs blis -Werrorfrom an empty cwd passed 4/4.actionlintis clean apart from the usual unknownubuntu-24.04-riscvlabel.