From 8a59339125d625ea753546a25bdbe4b6ea54c501 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Tue, 17 Nov 2026 23:47:35 +0000 Subject: [PATCH 1/2] spconv: add riscv64 build (CPU-only, cumm backend) Build-from-checkout, mirroring upstream's documented CPU-only install path (SPCONV_DISABLE_JIT=1, CUMM_CUDA_VERSION empty). Depends on cumm (cumm>=0.7.11,<0.8.0), now published on pypi.riseproject.dev, via PIP_EXTRA_INDEX_URL. Local x86_64 rehearsal (public cumm 0.7.11 CPU wheel + --no-build-isolation) built cleanly; a pybind11 ABI mismatch between that older public cumm wheel and a freshly-installed pybind11 surfaced during the rehearsal's deeper smoke import, unrelated to this package's own build mechanics -- see the .queue.yml note for detail and what to check if riscv64 CI hits the same symptom against our own cumm wheel. --- .github/workflows/build-spconv.yml | 105 +++++++++++++++++++++++++++++ docs/packages/spconv.yaml | 11 +++ 2 files changed, 116 insertions(+) create mode 100644 .github/workflows/build-spconv.yml create mode 100644 docs/packages/spconv.yaml diff --git a/.github/workflows/build-spconv.yml b/.github/workflows/build-spconv.yml new file mode 100644 index 00000000000..6b441ad5ccf --- /dev/null +++ b/.github/workflows/build-spconv.yml @@ -0,0 +1,105 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow mirrors upstream's own documented CPU-only install path +# (README.md "pip install spconv for CPU only (Linux Only)"): SPCONV_DISABLE_JIT=1 +# builds the pccm/cumm-generated extension at wheel-build time instead of on +# first import, and CUMM_CUDA_VERSION= picks the CPU-only variant of its cumm +# build dependency, matching our cumm port (build-cumm.yml). +name: Build spconv wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/spconv.yaml not released yet' + required: false + default: '' + cancel-in-progress: + description: Cancel an in-progress run in the same concurrency group. + required: false + type: boolean + default: true + pull_request: + branches: [main] + paths: + - '.github/workflows/build-spconv.yml' + - 'docs/packages/spconv.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-spconv.yml' + - 'docs/packages/spconv.yaml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: ${{ case(github.event_name == 'pull_request', true, github.event_name == 'workflow_dispatch', inputs['cancel-in-progress'], false) }} + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + with: + package: spconv + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build spconv ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 90 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + env: + SPCONV_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout spconv v${{ env.SPCONV_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: traveller59/spconv + ref: v${{ env.SPCONV_VERSION }} + persist-credentials: false + + - name: Build wheels + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + output-dir: wheelhouse/ + only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + env: + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + CIBW_ENVIRONMENT: 'CUMM_CUDA_VERSION= SPCONV_DISABLE_JIT=1 PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/' + CIBW_TEST_COMMAND: python -c "import spconv; import spconv.algo; print(spconv.__version__)" + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: spconv-${{ env.SPCONV_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish spconv ${{ matrix.version }} + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + permissions: + contents: write + pull-requests: write + uses: $/.github/workflows/_publish-wheel.yml + secrets: + app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }} + with: + matrix: ${{ needs.setup.outputs.matrix }} + artifact-pattern: spconv-${{ matrix.version }}-*-manylinux_riscv64 diff --git a/docs/packages/spconv.yaml b/docs/packages/spconv.yaml new file mode 100644 index 00000000000..761d34861ca --- /dev/null +++ b/docs/packages/spconv.yaml @@ -0,0 +1,11 @@ +package-name: spconv +source-code: https://github.com/traveller59/spconv +license: Apache-2.0 +versions: +- version: 2.3.8 + files: + - python: 3.9:manylinux + - python: 3.10:manylinux + - python: 3.11:manylinux + - python: 3.12:manylinux + - python: 3.13:manylinux From 0844fefd302b3a520e5e2fa14bfdc22715d42d1d Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Wed, 18 Nov 2026 02:37:21 +0000 Subject: [PATCH 2/2] build-spconv: drop spconv.algo from the smoke test Real riscv64 CI (run 44202562155, job 134460257373): all 4 build legs (cp310-cp313) built, auditwheel-repaired and installed fine, then died at the test step with ModuleNotFoundError: No module named 'spconv.core_cc.cumm.conv'; 'spconv.core_cc.cumm' is not a package. Confirmed against the real upstream source, not guessed: cloned traveller59/spconv v2.3.8's setup.py only adds the cu/convcu pccm units (namespaces cumm.gemm.main/cumm.conv.main) to the extension when CUMM_CPU_ONLY_BUILD is false; cumm v0.7.11's own constants.py forces that flag true whenever CUMM_CUDA_VERSION is set to an empty string, exactly what CIBW_ENVIRONMENT already sets per upstream's documented CPU-only recipe. spconv/algo.py imports both at module level with no CPU-only guard, so `import spconv.algo` fails in any CPU-only build. Downloaded and unzipped the official PyPI spconv==2.3.8 manylinux x86_64 wheel to confirm this is not riscv64-specific: its core_cc .pyi stub tree has no cumm/conv or cumm/gemm entries either, matching this build exactly. Our riscv64 wheel is behaving identically to upstream's own published CPU wheel; drop the module from the smoke test rather than chase a gap that is not ours to fix. Signed-off-by: Ludovic Henry --- .github/workflows/build-spconv.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-spconv.yml b/.github/workflows/build-spconv.yml index 6b441ad5ccf..6c93338e04b 100644 --- a/.github/workflows/build-spconv.yml +++ b/.github/workflows/build-spconv.yml @@ -78,7 +78,19 @@ jobs: env: CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} CIBW_ENVIRONMENT: 'CUMM_CUDA_VERSION= SPCONV_DISABLE_JIT=1 PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/' - CIBW_TEST_COMMAND: python -c "import spconv; import spconv.algo; print(spconv.__version__)" + # Real riscv64 CI (run 44202562155, job 134460257373): all 4 legs built, repaired + # and installed fine, then died at this step with ModuleNotFoundError on + # spconv.core_cc.cumm.conv. Confirmed against upstream's own setup.py (cloned + # traveller59/spconv v2.3.8): with CUMM_CUDA_VERSION empty, cumm's constants.py + # forces CUMM_CPU_ONLY_BUILD, and setup.py only adds the cu/convcu pccm units + # (namespaces cumm.gemm.main/cumm.conv.main) to the extension when that flag is + # off - so a CPU-only build never compiles them in. spconv/algo.py imports both + # unconditionally at module level with no CPU-only guard. The official PyPI + # spconv==2.3.8 CPU wheel (manylinux_x86_64) has the identical gap: its core_cc + # .pyi stubs carry no cumm/conv or cumm/gemm tree either. import spconv.algo + # cannot work in any CPU-only build of this version, riscv64 included - this is + # not a build or packaging bug on our side. + CIBW_TEST_COMMAND: python -c "import spconv; print(spconv.__version__)" - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: