Skip to content

Commit 22e2879

Browse files
danielhanchendanielhanchen
andauthored
CI: run the GPU build legs on demand only (#7)
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. Co-authored-by: danielhanchen <unslothshared@gmail.com>
1 parent d9ad778 commit 22e2879

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

.github/workflows/build.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ jobs:
116116
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
117117
118118
ubuntu-latest-cmake-vulkan:
119+
if: ${{ github.event_name == 'workflow_dispatch' }}
119120
runs-on: ubuntu-latest
120121

121122
steps:
@@ -180,7 +181,7 @@ jobs:
180181
181182
build-and-push-docker-images:
182183
name: Build and push container images
183-
if: ${{ github.event_name != 'pull_request' }}
184+
if: ${{ github.event_name == 'workflow_dispatch' }}
184185
runs-on: ${{ matrix.runner }}
185186

186187
permissions:
@@ -341,13 +342,10 @@ jobs:
341342

342343
strategy:
343344
matrix:
344-
include:
345-
- build: "cpu"
346-
defines: "-DGGML_NATIVE=OFF -DSD_BUILD_SHARED_LIBS=ON -DSD_BUILD_SHARED_GGML_LIB=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON"
347-
- build: "cuda12"
348-
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"
349-
- build: "vulkan"
350-
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"
345+
# cuda12 and vulkan are dispatch-only: nothing here ships (our
346+
# prebuilts come from unsloth-sd-prebuilt.yml) and they cost 142 min.
347+
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"}]') }}
348+
351349
steps:
352350
- name: Clone
353351
id: checkout
@@ -446,6 +444,7 @@ jobs:
446444
sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-${{ matrix.build }}-x64.zip
447445
448446
windows-latest-rocm:
447+
if: ${{ github.event_name == 'workflow_dispatch' }}
449448
runs-on: windows-2022
450449

451450
env:
@@ -577,6 +576,7 @@ jobs:
577576
sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-rocm-${{ env.ROCM_VERSION }}-x64.zip
578577
579578
ubuntu-latest-rocm:
579+
if: ${{ github.event_name == 'workflow_dispatch' }}
580580
runs-on: ubuntu-24.04
581581

582582
env:

0 commit comments

Comments
 (0)