Skip to content

blis: add build-blis.yml for riscv64 wheels - #517

Merged
luhenry merged 1 commit into
mainfrom
blis
Aug 27, 2026
Merged

blis: add build-blis.yml for riscv64 wheels#517
luhenry merged 1 commit into
mainfrom
blis

Conversation

@luhenry

@luhenry luhenry commented Aug 27, 2026

Copy link
Copy Markdown
Member

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 configure at build time. It ships a pregenerated blis/_src/make/<platform>-<arch>.jsonl per target, listing every object file's compiler/source/flags, and setup.py's ExtensionBuilder.compile_objects() replays it. get_arch_name() maps aarch64 to cortexa57, ppc64le to power9, and anything else that is not x86_64 to generic — so riscv64 selects linux-generic with no BLIS_ARCH override 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-simd on 45 of them), every source is .c, none live under an x86/avx/sse path, and include/linux-generic/blis.h pulls in no immintrin.h or 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 in pyproject.toml is inherited as-is (build frontend, auditwheel repair command); the only overrides are the riscv64 image and PIP_EXTRA_INDEX_URL, which the build needs so the numpy>=2.0.0,<3.0.0 build requirement resolves to our registry's numpy 2.5.2 riscv64 wheel rather than compiling from sdist. Upstream's job-level CC=clang/AR=llvm-ar env exists for the Windows leg only and never reaches the Linux container (their environment-pass is empty), so it is dropped here and the jsonl's own gcc is 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 as CIBW_TEST_COMMAND — the suite (blis/tests/) ships inside the wheel and --pyargs resolves 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 no cp3XXt blis 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_aarch64 with BLIS_ARCH=generic forced (same Rocky-family image, exercising the exact linux-generic.jsonl path riscv64 will take): pip wheel . produced blis-1.3.3-cp313-cp313-linux_aarch64.whl containing both blis/cy...so and blis/py...so plus the LICENSE, and python -m pytest --pyargs blis -Werror from an empty cwd passed 4/4. actionlint is clean apart from the usual unknown ubuntu-24.04-riscv label.

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.
@luhenry
luhenry merged commit 1863999 into main Aug 27, 2026
7 checks passed
@luhenry
luhenry deleted the blis branch August 27, 2026 09:07
@luhenry luhenry mentioned this pull request Aug 27, 2026
@luhenry luhenry linked an issue Aug 27, 2026 that may be closed by this pull request
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.

blis riscv64 support

1 participant