Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions .github/workflows/build-spconv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# 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/'
# 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:
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
11 changes: 11 additions & 0 deletions docs/packages/spconv.yaml
Original file line number Diff line number Diff line change
@@ -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
Loading