From eaf336acd22743e7236d61f5769a15dbf79ba4bb Mon Sep 17 00:00:00 2001 From: abetlen Date: Fri, 3 Apr 2026 00:20:01 -0700 Subject: [PATCH 1/4] fix(ci): avoid duplicate py3-none release builds --- .github/workflows/build-and-release.yaml | 37 +++++++---------------- .github/workflows/build-wheels-cuda.yaml | 4 ++- .github/workflows/build-wheels-metal.yaml | 13 ++++---- 3 files changed, 20 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 6cbac0cb1c..dcd8e4d73a 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -11,7 +11,9 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, windows-2022, macos-14, macos-15] + # Use explicit Apple Silicon and Intel macOS runners so each job + # produces a distinct wheel artifact. + os: [ubuntu-22.04, windows-2022, macos-15, macos-15-intel] steps: - uses: actions/checkout@v4 @@ -82,7 +84,9 @@ jobs: # Keep native arm64 builds on a portable CPU baseline instead of # tuning wheels to the hosted runner. CIBW_ENVIRONMENT: CMAKE_ARGS="-DGGML_NATIVE=off" - CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-*" + # wheel.py-api = "py3" means one aarch64 build covers every supported + # CPython version, so building more just duplicates the artifact name. + CIBW_BUILD: "cp38-*" with: output-dir: wheelhouse @@ -93,27 +97,8 @@ jobs: path: ./wheelhouse/*.whl build_wheels_riscv64: - name: Build riscv64 wheels (${{ matrix.shard.name }}) + name: Build riscv64 wheels runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - shard: - - name: cp310 - build: "cp310-*" - artifact: wheels_riscv64_cp310 - - name: cp311 - build: "cp311-*" - artifact: wheels_riscv64_cp311 - - name: cp312 - build: "cp312-*" - artifact: wheels_riscv64_cp312 - - name: cp313 - build: "cp313-*" - artifact: wheels_riscv64_cp313 - - name: cp314 - build: "cp314-*" - artifact: wheels_riscv64_cp314 steps: - uses: actions/checkout@v4 with: @@ -133,16 +118,16 @@ jobs: # Build riscv64 wheels against a conservative baseline instead of # enabling RVV-related extensions from the build container. CIBW_ENVIRONMENT: CMAKE_ARGS="-DGGML_NATIVE=off -DGGML_RVV=off -DGGML_RV_ZFH=off -DGGML_RV_ZVFH=off -DGGML_RV_ZICBOP=off -DGGML_RV_ZIHINTPAUSE=off" - # Split the emulated riscv64 build into one Python version per job - # to minimize wall-clock time without changing the release artifacts. - CIBW_BUILD: ${{ matrix.shard.build }} + # wheel.py-api = "py3" means one riscv64 build covers every supported + # CPython version, so sharding by interpreter only duplicates assets. + CIBW_BUILD: "cp310-*" with: output-dir: wheelhouse - name: Upload wheels as artifacts uses: actions/upload-artifact@v4 with: - name: ${{ matrix.shard.artifact }} + name: wheels_riscv64 path: ./wheelhouse/*.whl build_sdist: diff --git a/.github/workflows/build-wheels-cuda.yaml b/.github/workflows/build-wheels-cuda.yaml index 17daaa12a2..548076300c 100644 --- a/.github/workflows/build-wheels-cuda.yaml +++ b/.github/workflows/build-wheels-cuda.yaml @@ -21,7 +21,9 @@ jobs: run: | $matrix = @{ 'os' = @('ubuntu-22.04') #, 'windows-2022') - 'pyver' = @("3.9", "3.10", "3.11", "3.12") + # wheel.py-api = "py3" makes the CUDA wheel interpreter-agnostic, + # so one builder per toolkit version is sufficient. + 'pyver' = @("3.9") 'cuda' = @("12.1.1", "12.2.2", "12.3.2", "12.4.1") #, "12.5.1", "12.6.1") 'releasetag' = @("basic") } diff --git a/.github/workflows/build-wheels-metal.yaml b/.github/workflows/build-wheels-metal.yaml index 98f511e4a6..0a0b391cd7 100644 --- a/.github/workflows/build-wheels-metal.yaml +++ b/.github/workflows/build-wheels-metal.yaml @@ -7,11 +7,8 @@ permissions: jobs: build_wheels: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-14, macos-15] + name: Build wheels on macos-15 + runs-on: macos-15 steps: - uses: actions/checkout@v4 @@ -38,14 +35,16 @@ jobs: CIBW_REPAIR_WHEEL_COMMAND: "" CIBW_ARCHS: "arm64" CIBW_ENVIRONMENT: CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_APPLE_SILICON_PROCESSOR=arm64 -DGGML_METAL=on -DCMAKE_CROSSCOMPILING=ON" - CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*" + # wheel.py-api = "py3" means one Metal wheel covers every supported + # CPython version, so extra selectors only repeat the same artifact. + CIBW_BUILD: "cp39-*" with: package-dir: . output-dir: wheelhouse2 - uses: actions/upload-artifact@v4 with: - name: wheels-mac_${{ matrix.os }} + name: wheels-mac path: ./wheelhouse2/*.whl release: From eb693c2a24face7dd09d687052c7ab922c5e9dd2 Mon Sep 17 00:00:00 2001 From: abetlen Date: Fri, 3 Apr 2026 00:31:58 -0700 Subject: [PATCH 2/4] fix(ci): keep macos-14 apple silicon runners --- .github/workflows/build-and-release.yaml | 7 ++++--- .github/workflows/build-wheels-metal.yaml | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index dcd8e4d73a..5570507318 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -11,9 +11,10 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - # Use explicit Apple Silicon and Intel macOS runners so each job - # produces a distinct wheel artifact. - os: [ubuntu-22.04, windows-2022, macos-15, macos-15-intel] + # Keep the Apple Silicon release build on macos-14 and use an explicit + # Intel runner for the x86_64 wheel so each macOS job produces a + # distinct artifact. + os: [ubuntu-22.04, windows-2022, macos-14, macos-15-intel] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/build-wheels-metal.yaml b/.github/workflows/build-wheels-metal.yaml index 0a0b391cd7..a735a957dd 100644 --- a/.github/workflows/build-wheels-metal.yaml +++ b/.github/workflows/build-wheels-metal.yaml @@ -7,8 +7,8 @@ permissions: jobs: build_wheels: - name: Build wheels on macos-15 - runs-on: macos-15 + name: Build wheels on macos-14 + runs-on: macos-14 steps: - uses: actions/checkout@v4 From bc5cfa6b4af5e73c94d84fb410586ca6eb210cb6 Mon Sep 17 00:00:00 2001 From: abetlen Date: Fri, 3 Apr 2026 00:40:25 -0700 Subject: [PATCH 3/4] fix(ci): keep metal matrix on macos-14 and macos-15 --- .github/workflows/build-wheels-metal.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheels-metal.yaml b/.github/workflows/build-wheels-metal.yaml index a735a957dd..4157469a28 100644 --- a/.github/workflows/build-wheels-metal.yaml +++ b/.github/workflows/build-wheels-metal.yaml @@ -7,8 +7,11 @@ permissions: jobs: build_wheels: - name: Build wheels on macos-14 - runs-on: macos-14 + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-14, macos-15] steps: - uses: actions/checkout@v4 @@ -43,6 +46,7 @@ jobs: output-dir: wheelhouse2 - uses: actions/upload-artifact@v4 + if: matrix.os == 'macos-14' with: name: wheels-mac path: ./wheelhouse2/*.whl From e83f607b724e6fe803400468a141b0b3a9ebdede Mon Sep 17 00:00:00 2001 From: abetlen Date: Fri, 3 Apr 2026 00:45:58 -0700 Subject: [PATCH 4/4] docs: update changelog for py3-none ci fix --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bc8d6654b..6b214fe939 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- fix(ci): Avoid duplicate `py3-none` release builds across wheel workflows by @abetlen in #2172 + ## [0.3.20] - refactor: Replace deprecated llama.cpp references in library, docs, and examples by @abetlen in #2170