From 1b13cbf13e46548469ab44cef746aa0f705e6b4a Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Wed, 14 Oct 2026 00:26:55 +0000 Subject: [PATCH 1/3] bigdl-nano: Add version 2.4.0 bigdl-nano is pure Python plus three prebuilt shared libraries that python/nano/setup.py downloads from analytics-zoo GitHub releases for x86_64/macOS only: jemalloc 5.3.0, gperftools 2.10 (tcmalloc) and libjpeg-turbo 3.0.0 (libturbojpeg). Those releases are built from source in the manylinux image and dropped where setup.py looks for them, then the wheel is built the way upstream's release.sh does it (bdist_wheel --plat-name ... --python-tag py3). Tested on cp311: 2.4.0 pins setuptools<66, whose pkg_resources needs pkgutil.ImpImporter, so bigdl.nano cannot be imported on Python 3.12+ on any architecture. The test mirrors upstream's nano-init test and also round-trips a JPEG header through the bundled libturbojpeg. BigDL has since been renamed intel/ipex-llm and Nano was dropped; 2.4.0 is the last stable bigdl-nano release. --- .github/workflows/build-bigdl-nano.yml | 176 +++++++++++++++++++++++++ docs/packages/bigdl-nano.yaml | 5 + 2 files changed, 181 insertions(+) create mode 100644 .github/workflows/build-bigdl-nano.yml create mode 100644 docs/packages/bigdl-nano.yaml diff --git a/.github/workflows/build-bigdl-nano.yml b/.github/workflows/build-bigdl-nano.yml new file mode 100644 index 000000000000..f51bcc47a1bc --- /dev/null +++ b/.github/workflows/build-bigdl-nano.yml @@ -0,0 +1,176 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# Based on https://github.com/intel-analytics/BigDL/blob/v2.4.0/python/nano/dev/release.sh +# and the "Run Nano-init test" step of +# https://github.com/intel-analytics/BigDL/blob/v2.4.0/.github/workflows/nano_unit_tests_basic.yml +name: Build bigdl-nano wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/bigdl-nano.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-bigdl-nano.yml' + - 'docs/packages/bigdl-nano.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-bigdl-nano.yml' + - 'docs/packages/bigdl-nano.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 + # python/nano/setup.py bundles prebuilt x86_64 builds of these releases (lib_urls); + # they are built from source here instead. + JEMALLOC_VERSION: '5.3.0' + GPERFTOOLS_VERSION: '2.10' + LIBJPEG_TURBO_VERSION: '3.0.0' + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + with: + package: bigdl-nano + 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 bigdl-nano ${{ matrix.version }} py3-none-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 60 + + env: + BIGDL_NANO_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout BigDL v${{ env.BIGDL_NANO_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: intel-analytics/BigDL + ref: v${{ env.BIGDL_NANO_VERSION }} + sparse-checkout: python/nano + persist-credentials: false + + - name: Pull manylinux_riscv64 image + run: docker pull "${MANYLINUX_RISCV64_IMAGE}" + + - name: Build jemalloc, tcmalloc and libturbojpeg, then the wheel + run: | + docker run --rm -v "$(pwd):/work" -w /work -e JEMALLOC_VERSION -e GPERFTOOLS_VERSION -e LIBJPEG_TURBO_VERSION "${MANYLINUX_RISCV64_IMAGE}" bash -c ' + set -euxo pipefail + dnf install -y -q bzip2 + mkdir -p /tmp/src + curl -fsSL "https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2" | tar xj -C /tmp/src + curl -fsSL "https://github.com/gperftools/gperftools/releases/download/gperftools-${GPERFTOOLS_VERSION}/gperftools-${GPERFTOOLS_VERSION}.tar.gz" | tar xz -C /tmp/src + curl -fsSL "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/${LIBJPEG_TURBO_VERSION}/libjpeg-turbo-${LIBJPEG_TURBO_VERSION}.tar.gz" | tar xz -C /tmp/src + jemalloc=/tmp/src/jemalloc-${JEMALLOC_VERSION} + gperftools=/tmp/src/gperftools-${GPERFTOOLS_VERSION} + libjpeg_turbo=/tmp/src/libjpeg-turbo-${LIBJPEG_TURBO_VERSION} + (cd "$jemalloc" && ./configure && make -j"$(nproc)" build_lib_shared) + (cd "$gperftools" && ./configure && make -j"$(nproc)" libtcmalloc.la) + cmake -S "$libjpeg_turbo" -B /tmp/src/libjpeg-turbo-build -DCMAKE_BUILD_TYPE=Release -DENABLE_STATIC=OFF -DWITH_JAVA=OFF + cmake --build /tmp/src/libjpeg-turbo-build -j"$(nproc)" --target turbojpeg + libs=python/nano/src/bigdl/nano/libs + mkdir -p "$libs" + install -m755 -T "$jemalloc/lib/libjemalloc.so.2" "$libs/libjemalloc.so" + install -m755 -T "$(readlink -f "$gperftools/.libs/libtcmalloc.so")" "$libs/libtcmalloc.so" + install -m755 -T "$(readlink -f /tmp/src/libjpeg-turbo-build/libturbojpeg.so)" "$libs/libturbojpeg.so.0.2.0" + cp LICENSE python/nano/LICENSE + cp "$jemalloc/COPYING" python/nano/LICENSE.jemalloc + cp "$gperftools/COPYING" python/nano/LICENSE.gperftools + cp "$libjpeg_turbo/LICENSE.md" python/nano/LICENSE.libjpeg-turbo.md + cp "$libjpeg_turbo/README.ijg" python/nano/LICENSE.libjpeg-turbo-ijg + cd python/nano + pybin=/opt/python/cp311-cp311/bin + "$pybin/pip" install -q -U setuptools wheel + "$pybin/python3" setup.py bdist_wheel --plat-name manylinux_2_39_riscv64 --python-tag py3 + ' + + # bigdl-nano 2.4.0 cannot be imported on Python 3.12+ on any arch: it pins + # setuptools<66, whose pkg_resources needs the removed pkgutil.ImpImporter. + - name: Test the wheel + run: | + docker run --rm -v "$(pwd):/work" -w /tmp "${MANYLINUX_RISCV64_IMAGE}" bash -c ' + set -exo pipefail + dnf install -y -q util-linux + /opt/python/cp311-cp311/bin/python3 -m venv /tmp/venv + . /tmp/venv/bin/activate + pip install -q --extra-index-url https://pypi.riseproject.dev/simple/ --only-binary numpy /work/python/nano/dist/*.whl numpy + python - < Date: Thu, 15 Oct 2026 12:16:49 +0000 Subject: [PATCH 2/3] build-bigdl-nano: raise libjpeg-turbo's CMake policy floor libjpeg-turbo 3.0.0's CMakeLists.txt pins cmake_minimum_required below CMake 4's removed floor, so the manylinux_riscv64 image's CMake 4.4.4 refused to configure it ("Compatibility with CMake < 3.5 has been removed"). CMAKE_POLICY_VERSION_MINIMUM=3.5 is the escape hatch CMake's own error message names. --- .github/workflows/build-bigdl-nano.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-bigdl-nano.yml b/.github/workflows/build-bigdl-nano.yml index f51bcc47a1bc..5fb383ba77a6 100644 --- a/.github/workflows/build-bigdl-nano.yml +++ b/.github/workflows/build-bigdl-nano.yml @@ -86,7 +86,7 @@ jobs: libjpeg_turbo=/tmp/src/libjpeg-turbo-${LIBJPEG_TURBO_VERSION} (cd "$jemalloc" && ./configure && make -j"$(nproc)" build_lib_shared) (cd "$gperftools" && ./configure && make -j"$(nproc)" libtcmalloc.la) - cmake -S "$libjpeg_turbo" -B /tmp/src/libjpeg-turbo-build -DCMAKE_BUILD_TYPE=Release -DENABLE_STATIC=OFF -DWITH_JAVA=OFF + cmake -S "$libjpeg_turbo" -B /tmp/src/libjpeg-turbo-build -DCMAKE_BUILD_TYPE=Release -DENABLE_STATIC=OFF -DWITH_JAVA=OFF -DCMAKE_POLICY_VERSION_MINIMUM=3.5 cmake --build /tmp/src/libjpeg-turbo-build -j"$(nproc)" --target turbojpeg libs=python/nano/src/bigdl/nano/libs mkdir -p "$libs" From b512360399a0e53fc5e7e7b997bc7b381a2fb3c9 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Sun, 25 Oct 2026 17:54:37 +0000 Subject: [PATCH 3/3] build-bigdl-nano: upgrade pip in the test venv before install The cp311 interpreter's python -m venv seeds pip from its bundled ensurepip wheel (24.0), which vendors packaging 21.3 and has no manylinux_*_riscv64 tag at all (gotcha 640). It rejected our own correctly-tagged bigdl_nano-2.4.0-py3-none-manylinux_2_39_riscv64.whl with "is not a supported wheel on this platform" before even looking at its contents. --upgrade-deps pulls in pip >=24.1, whose packaging 24.1 added riscv64 support. --- .github/workflows/build-bigdl-nano.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-bigdl-nano.yml b/.github/workflows/build-bigdl-nano.yml index 5fb383ba77a6..0bd96e015ab8 100644 --- a/.github/workflows/build-bigdl-nano.yml +++ b/.github/workflows/build-bigdl-nano.yml @@ -111,8 +111,12 @@ jobs: docker run --rm -v "$(pwd):/work" -w /tmp "${MANYLINUX_RISCV64_IMAGE}" bash -c ' set -exo pipefail dnf install -y -q util-linux - /opt/python/cp311-cp311/bin/python3 -m venv /tmp/venv + /opt/python/cp311-cp311/bin/python3 -m venv --upgrade-deps /tmp/venv . /tmp/venv/bin/activate + # CLAUDE.md gotcha 640: venv seeds pip from ensurepip (24.0 on cp311, which + # vendors packaging 21.3 and has no manylinux_*_riscv64 tag at all), rejecting + # our own correctly-tagged wheel with "is not a supported wheel on this + # platform". --upgrade-deps pulls in a current pip (>=24.1) that knows riscv64. pip install -q --extra-index-url https://pypi.riseproject.dev/simple/ --only-binary numpy /work/python/nano/dist/*.whl numpy python - <