workflows: add build-apache-tvm-ffi.yml for riscv64 manywheel builds - #289
Merged
Conversation
luhenry
commented
Aug 20, 2026
Member
Author
Add a workflow to build and publish riscv64 wheels for apache-tvm-ffi (https://github.com/apache/tvm-ffi) to pypi.riseproject.dev. The PyPI sdist is self-contained: it bundles the dlpack and libbacktrace submodules, the test suite, and a setuptools-scm-derived _version.py, so the riscv64 wheel builds from it with no git history, submodules, or codegen toolchain. It just needs scikit-build-core + Cython + CMake and a C++17 compiler, all present in the manylinux riscv64 image. Wheels are abi3 (pyproject sets wheel.py-api = "cp312"), so the matrix is just cp312 (loadable on 3.12/3.13/3.14) plus a free-threaded cp314t build - the two entries of upstream's cibuildwheel build list that differ. The build frontend, test-command (pytest {package}/tests/python) and test-groups (torch/numpy/ml_dtypes/pytest/ninja) are inherited from the sdist's pyproject.toml, so we test exactly as upstream does. Those test deps have no riscv64 wheels on public PyPI, so pip/uv are pointed at our registry; only-binary is scoped to the test phase (via test-environment) so it can't block the build backend's cython, which has no riscv64 wheel and must compile from sdist. Validated locally in the manylinux riscv64 container under emulation: the sdist builds a cp312-abi3 wheel, and the test-group deps (torch 2.13.0+cpu, numpy, ml_dtypes, pytest) install wheels-only from the registry. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
luhenry
force-pushed
the
apache-tvm-ffi
branch
from
August 20, 2026 18:53
aa9dbd8 to
525838d
Compare
threexc
approved these changes
Aug 20, 2026
threexc
left a comment
Collaborator
There was a problem hiding this comment.
Provided the current builds complete, LGTM. We'll want to comment about this in the docs PR though:
# Mirror upstream's test-command (pytest {package}/tests/python -vvs)
# but drop two tests that fail only because of this riscv64 runner's
# environment, not the wheel (2300+ others pass; cp314t, which pulls no
# torch, is fully green):
# * test_libinfo.py - every test there shells out to `tvm-ffi-config`
# and asserts the subprocess's stderr is empty. Importing tvm_ffi
# pulls in torch, whose bundled libcpuinfo can't parse this runner's
# /sys CPU topology (core_id reads "-1") and prints
# "Error in cpuinfo: failed to parse ... core_id" to stderr. The
# noise is nondeterministic across the module's subprocess tests, so
# the whole file is dropped via --ignore (an absolute path, so it's
# unambiguous regardless of pytest's rootdir).
# * test_filelock.py::test_concurrent_access - spawns 16 concurrent
# torch-importing workers under a hard 60s wait; the slower riscv64
# runner blows the timeout. Dropped with -k by its (unique) name -
# rootdir-independent, unlike a path-based --deselect (which silently
# no-ops when the nodeid prefix doesn't match pytest's rootdir).
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.
What
Adds
.github/workflows/build-apache-tvm-ffi.ymlto build and publish riscv64 wheels for apache-tvm-ffi (Apache TVM FFI — an open ABI/FFI for ML systems) topypi.riseproject.dev.Approach
sdist → bdist (abi3). The PyPI sdist is self-contained: it bundles the
dlpackandlibbacktracesubmodules, the test suite, and a setuptools-scm-derived_version.py. So the riscv64 wheel builds from it with no git history, submodules, or codegen toolchain — justscikit-build-core+ Cython + CMake + a C++17 compiler, all present in the manylinux riscv64 image.ubuntu-latest; only the bdist runs onubuntu-24.04-riscv.pyprojectsetswheel.py-api = "cp312"), so the matrix iscp312(loadable on 3.12/3.13/3.14) + a free-threadedcp314tbuild — the two entries of upstream's cibuildwheelbuildlist that actually differ.CIBW_ARCHS: riscv64overrides pyproject's[tool.cibuildwheel.linux] archs = ["x86_64", "aarch64"].Testing (mirrors upstream)
The build frontend (
build[uv]),test-command(pytest {package}/tests/python) andtest-groups(["test"]→ torch/numpy/ml_dtypes/pytest/ninja) are all inherited from the sdist'spyproject.toml, so wheels are tested exactly the way upstream tests them. Those test deps have no riscv64 wheels on public PyPI, so pip/uv are pointed at our registry.only-binaryis scoped to the test phase only (viaCIBW_TEST_ENVIRONMENT) — the build backend needscython>=3.0, which has no riscv64 wheel and must compile from its sdist, so a globalonly-binarywould break the build. GPU-only tests self-skip viatorch.cuda.is_available().Local validation (manylinux riscv64 container, under emulation)
apache_tvm_ffi-0.1.12-cp312-abi3-linux_riscv64.whl.actionlintclean except the expected unknown-label warning for the self-hostedubuntu-24.04-riscvrunner.🤖 Generated with Claude Code