From 43b39ad82b56c00c12cef778cbaeb9ec6ecb7c9f Mon Sep 17 00:00:00 2001 From: danielhanchen Date: Sat, 8 Aug 2026 11:17:34 +0000 Subject: [PATCH] CI: run the GPU build legs on demand only Nothing this workflow builds ships. Our prebuilts come from unsloth-sd-prebuilt.yml, which is CPU and Apple only by design because GPU hosts run diffusers/torch. No release here has ever carried a CUDA, ROCm or Vulkan asset, and build.yml's own release job fails on every push with "Resource not accessible by integration", so it has never published anything. Even a forced native GPU load does not use these: install_sd_cpp_prebuilt.py falls back to leejet upstream when our mirror cannot serve the host. Measured on run 31238801839, the GPU legs are 561 of 658 minutes, 85% of the run, and they are the source of the multi-GB artifacts that were filling Actions storage. Gated to workflow_dispatch: ubuntu-latest-cmake-vulkan, windows-latest-rocm, ubuntu-latest-rocm, the container images job, and the cuda12 and vulkan entries of windows-latest-cmake. What still runs on push and PR is the compile smoke signal worth keeping: ubuntu-latest-cmake, macOS-latest-cmake and windows CPU, about 29 minutes. The matrix entries cannot take a job-level if, so that one uses a fromJSON ternary. Verified both branches parse back to the original entries with the defines byte-identical, and that the file is otherwise unchanged outside the five gates. Side effect worth knowing: release needs the gated jobs, so on a master push it now skips instead of failing. It has never succeeded here, so this removes a standing red X rather than losing a capability. Reverting any single gate restores the old behaviour for that leg. --- .github/workflows/build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71401593c..12f46c563 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -116,6 +116,7 @@ jobs: sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-${{ steps.system-info.outputs.OS_NAME }}-${{ steps.system-info.outputs.OS_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}.zip ubuntu-latest-cmake-vulkan: + if: ${{ github.event_name == 'workflow_dispatch' }} runs-on: ubuntu-latest steps: @@ -180,7 +181,7 @@ jobs: build-and-push-docker-images: name: Build and push container images - if: ${{ github.event_name != 'pull_request' }} + if: ${{ github.event_name == 'workflow_dispatch' }} runs-on: ${{ matrix.runner }} permissions: @@ -341,13 +342,10 @@ jobs: strategy: matrix: - include: - - build: "cpu" - defines: "-DGGML_NATIVE=OFF -DSD_BUILD_SHARED_LIBS=ON -DSD_BUILD_SHARED_GGML_LIB=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON" - - build: "cuda12" - defines: "-DSD_CUDA=ON -DSD_BUILD_SHARED_LIBS=ON -DCMAKE_CUDA_ARCHITECTURES='61;70;75;80;86;89;90;100;120' -DCMAKE_CUDA_FLAGS='-Xcudafe \"--diag_suppress=177\" -Xcudafe \"--diag_suppress=550\"' -DGGML_NATIVE=OFF -DSD_BUILD_SHARED_GGML_LIB=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON" - - build: "vulkan" - defines: "-DSD_VULKAN=ON -DSD_BUILD_SHARED_LIBS=ON -DGGML_NATIVE=OFF -DSD_BUILD_SHARED_GGML_LIB=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON" + # cuda12 and vulkan are dispatch-only: nothing here ships (our + # prebuilts come from unsloth-sd-prebuilt.yml) and they cost 142 min. + include: ${{ github.event_name == 'workflow_dispatch' && fromJSON('[{"build":"cpu","defines":"-DGGML_NATIVE=OFF -DSD_BUILD_SHARED_LIBS=ON -DSD_BUILD_SHARED_GGML_LIB=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON"},{"build":"cuda12","defines":"-DSD_CUDA=ON -DSD_BUILD_SHARED_LIBS=ON -DCMAKE_CUDA_ARCHITECTURES=''61;70;75;80;86;89;90;100;120'' -DCMAKE_CUDA_FLAGS=''-Xcudafe \"--diag_suppress=177\" -Xcudafe \"--diag_suppress=550\"'' -DGGML_NATIVE=OFF -DSD_BUILD_SHARED_GGML_LIB=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON"},{"build":"vulkan","defines":"-DSD_VULKAN=ON -DSD_BUILD_SHARED_LIBS=ON -DGGML_NATIVE=OFF -DSD_BUILD_SHARED_GGML_LIB=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON"}]') || fromJSON('[{"build":"cpu","defines":"-DGGML_NATIVE=OFF -DSD_BUILD_SHARED_LIBS=ON -DSD_BUILD_SHARED_GGML_LIB=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON"}]') }} + steps: - name: Clone id: checkout @@ -446,6 +444,7 @@ jobs: sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-${{ matrix.build }}-x64.zip windows-latest-rocm: + if: ${{ github.event_name == 'workflow_dispatch' }} runs-on: windows-2022 env: @@ -572,6 +571,7 @@ jobs: sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-rocm-${{ env.ROCM_VERSION }}-x64.zip ubuntu-latest-rocm: + if: ${{ github.event_name == 'workflow_dispatch' }} runs-on: ubuntu-24.04 env: