Repository navigation
warp-lang: Add version 1.16.0 #3
Workflow file for this run
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
| # SPDX-FileCopyrightText: 2026 The RISE Project | |
| # SPDX-License-Identifier: MIT | |
| --- | |
| # Based on upstream's Linux wheel pipeline, which compiles the Clang/LLVM SDK from source in a | |
| # manylinux container and then cuts one wheel per platform: | |
| # https://github.com/NVIDIA/warp/blob/v1.16.0/.github/workflows/build-llvm-sdk.yml | |
| # https://github.com/NVIDIA/warp/blob/v1.16.0/.gitlab-ci.yml | |
| name: Build warp-lang wheels (riscv64) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version glob to (re)build; empty builds every version of docs/packages/warp-lang.yaml not released yet' | |
| required: false | |
| default: '' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-warp-lang.yml' | |
| - 'docs/packages/warp-lang.yaml' | |
| push: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-warp-lang.yml' | |
| - 'docs/packages/warp-lang.yaml' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read # to fetch code (actions/checkout) | |
| env: | |
| # Pinned explicitly so the gpl_sources job pulls the same image the statically linked | |
| # libstdc++/libgcc in the wheel came from. | |
| MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 | |
| jobs: | |
| setup: | |
| uses: $/.github/workflows/_setup.yml | |
| with: | |
| package: warp-lang | |
| version: ${{ inputs.version }} | |
| build_wheels: | |
| needs: [setup] | |
| if: needs.setup.outputs.versions != '[]' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| name: Build warp-lang ${{ matrix.version }} py3-none-manylinux_riscv64 | |
| runs-on: ubuntu-24.04-riscv | |
| timeout-minutes: 1440 # full Clang/LLVM compile from source | |
| env: | |
| WARP_VERSION: ${{ matrix.version }} | |
| steps: | |
| - name: Checkout warp v${{ env.WARP_VERSION }} | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| repository: NVIDIA/warp | |
| ref: v${{ env.WARP_VERSION }} | |
| persist-credentials: false | |
| - name: Checkout python-wheels | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| path: python-wheels | |
| persist-credentials: false | |
| - name: Apply patches | |
| run: git apply python-wheels/patches/warp-lang/${{ env.WARP_VERSION }}/*.patch | |
| - name: Pull manylinux_riscv64 image | |
| run: docker pull "${MANYLINUX_RISCV64_IMAGE}" | |
| - name: Write the JIT smoke test | |
| run: | | |
| cat > "${RUNNER_TEMP}/smoke.py" <<'EOF' | |
| import numpy as np | |
| import warp as wp | |
| wp.init() | |
| print(wp.get_devices()) | |
| @wp.kernel | |
| def saxpy(a: float, x: wp.array(dtype=float), y: wp.array(dtype=float)): | |
| i = wp.tid() | |
| y[i] = a * x[i] + wp.sqrt(y[i]) | |
| x = wp.array(np.arange(16, dtype=np.float32), dtype=float, device="cpu") | |
| y = wp.array(np.full(16, 4.0, dtype=np.float32), dtype=float, device="cpu") | |
| wp.launch(saxpy, dim=16, inputs=[2.0, x, y], device="cpu") | |
| np.testing.assert_allclose(y.numpy(), 2.0 * np.arange(16) + 2.0, rtol=1e-6) | |
| print("JIT smoke test OK") | |
| EOF | |
| # Upstream ships no prebuilt Clang/LLVM SDK for riscv64, so --build-llvm compiles it here | |
| # instead of downloading one; --no-cuda is upstream's own CPU-only configuration. cmake and | |
| # ninja are pinned as in upstream's tools/llvm/ci/build-linux.sh, ahead of the image's own | |
| # cmake 4. libstdc++-static is CRB-only, and warp links -static-libstdc++/-static-libgcc. | |
| - name: Build warp and the wheel | |
| run: | | |
| docker run --rm -v "$(pwd):/work" -v "${RUNNER_TEMP}/smoke.py:/smoke.py:ro" \ | |
| -w /work -e WARP_VERSION "${MANYLINUX_RISCV64_IMAGE}" bash -c ' | |
| set -euxo pipefail | |
| dnf -y --enablerepo=crb install libstdc++-static | |
| pybin=/opt/python/cp312-cp312/bin | |
| "$pybin/pip" install -q --extra-index-url https://pypi.riseproject.dev/simple/ \ | |
| numpy build setuptools wheel cmake==3.31.6 ninja==1.11.1.3 | |
| export PATH="$pybin:$PATH" | |
| "$pybin/python3" build_lib.py --no-cuda --build-llvm | |
| file warp/bin/warp.so warp/bin/warp-clang.so | |
| readelf -A warp/bin/warp-clang.so || true | |
| ldd warp/bin/warp.so warp/bin/warp-clang.so | |
| "$pybin/python3" -m build --wheel --no-isolation \ | |
| -C--build-option=-Plinux-riscv64 -C--build-option=-Mmanylinux_2_39 | |
| for tag in cp312-cp312 cp313-cp313 cp314-cp314 cp314-cp314t; do | |
| "/opt/python/$tag/bin/python3" -m venv "/tmp/venv-$tag" | |
| "/tmp/venv-$tag/bin/pip" install -q \ | |
| --extra-index-url https://pypi.riseproject.dev/simple/ dist/*.whl | |
| (cd /tmp && "/tmp/venv-$tag/bin/python3" /smoke.py) | |
| done | |
| ' | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: warp-lang-${{ env.WARP_VERSION }}-py3-none-manylinux_riscv64 | |
| path: dist/*.whl | |
| if-no-files-found: error | |
| test_wheels: | |
| needs: [setup, build_wheels] | |
| if: needs.setup.outputs.versions != '[]' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| name: Test warp-lang ${{ matrix.version }} py3-none-manylinux_riscv64 | |
| runs-on: ubuntu-24.04-riscv | |
| timeout-minutes: 1440 # every kernel in the suite is JIT-compiled by Clang on the runner | |
| env: | |
| WARP_VERSION: ${{ matrix.version }} | |
| steps: | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: warp-lang-${{ env.WARP_VERSION }}-py3-none-manylinux_riscv64 | |
| path: dist | |
| - name: Pull manylinux_riscv64 image | |
| run: docker pull "${MANYLINUX_RISCV64_IMAGE}" | |
| - name: Run upstream's test suite against the wheel | |
| run: | | |
| docker run --rm -v "$(pwd)/dist:/dist:ro" -w /tmp "${MANYLINUX_RISCV64_IMAGE}" bash -c ' | |
| set -euxo pipefail | |
| pybin=/opt/python/cp312-cp312/bin | |
| "$pybin/pip" install -q --extra-index-url https://pypi.riseproject.dev/simple/ /dist/*.whl | |
| "$pybin/python3" -m warp.tests --maxjobs 4 | |
| ' | |
| gpl_sources: | |
| needs: [setup] | |
| if: needs.setup.outputs.versions != '[]' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| name: Collect GPL sources (gcc) for warp-lang ${{ matrix.version }} | |
| runs-on: ubuntu-24.04-riscv | |
| env: | |
| WARP_VERSION: ${{ matrix.version }} | |
| steps: | |
| - name: Collect gcc source RPM from manylinux_riscv64 | |
| uses: riseproject-dev/python-wheels/actions/collect-gpl-sources@main | |
| with: | |
| image: ${{ env.MANYLINUX_RISCV64_IMAGE }} | |
| packages: gcc | |
| output: gpl-sources.tar | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: warp-lang-${{ env.WARP_VERSION }}-gpl-sources | |
| path: gpl-sources.tar | |
| if-no-files-found: error | |
| publish: | |
| name: Publish warp-lang ${{ matrix.version }} | |
| needs: [setup, build_wheels, test_wheels, gpl_sources] | |
| 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: | |
| artifact-pattern: warp-lang-${{ matrix.version }}-*-manylinux_riscv64 | |
| gpl-sources-artifact: warp-lang-${{ matrix.version }}-gpl-sources | |
| gpl-sources-description: gcc |