From 743133332b6c317884bf34596ff627ac8547767a Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Tue, 13 Oct 2026 13:55:19 +0000 Subject: [PATCH] infini-gram: add riscv64 wheel build Builds the real upstream pybind11 C++20 extension plus the bundled rust_indexing binary from source (no sdist upstream, so checked out at the release tag). No CUDA/GPU, pure Rust deps (zstd/crossbeam/ filebuffer/clap/glob), Apache-2.0. --- .github/workflows/build-infini-gram.yml | 97 +++++++++++++++++++++++++ docs/packages/infini-gram.yaml | 5 ++ 2 files changed, 102 insertions(+) create mode 100644 .github/workflows/build-infini-gram.yml create mode 100644 docs/packages/infini-gram.yaml diff --git a/.github/workflows/build-infini-gram.yml b/.github/workflows/build-infini-gram.yml new file mode 100644 index 000000000000..41eb74cc070c --- /dev/null +++ b/.github/workflows/build-infini-gram.yml @@ -0,0 +1,97 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on: https://github.com/liujch1998/infini-gram/blob/v2.6.0/pkg/pyproject.toml +name: Build infini-gram wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/infini-gram.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-infini-gram.yml' + - 'docs/packages/infini-gram.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-infini-gram.yml' + - 'docs/packages/infini-gram.yaml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +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: infini-gram + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build infini-gram ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 90 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + python: + - "cp312" + - "cp313" + - "cp314" + - "cp314t" + + env: + INFINI_GRAM_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout infini-gram v${{ env.INFINI_GRAM_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: liujch1998/infini-gram + ref: v${{ env.INFINI_GRAM_VERSION }} + persist-credentials: false + + - name: Build wheels + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + package-dir: pkg + output-dir: wheelhouse/ + env: + CIBW_BUILD: ${{ matrix.python }}-manylinux_riscv64 + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: infini-gram-${{ env.INFINI_GRAM_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish infini-gram ${{ 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 + with: + artifact-pattern: infini-gram-${{ matrix.version }}-*-manylinux_riscv64 diff --git a/docs/packages/infini-gram.yaml b/docs/packages/infini-gram.yaml new file mode 100644 index 000000000000..839b49150b96 --- /dev/null +++ b/docs/packages/infini-gram.yaml @@ -0,0 +1,5 @@ +package-name: infini-gram +source-code: https://github.com/liujch1998/infini-gram +license: Apache-2.0 +versions: +- version: 2.6.0