Skip to content

Commit 4f70008

Browse files
committed
ci: add macOS metal and linux avx512 builds
1 parent 8e9f3a4 commit 4f70008

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ env:
4141
jobs:
4242
ubuntu-latest-cmake:
4343
runs-on: ubuntu-latest
44+
strategy:
45+
matrix:
46+
include:
47+
- build: "avx2"
48+
defines: "-DGGML_AVX2=ON -DSD_BUILD_SHARED_LIBS=ON"
49+
- build: "avx512"
50+
defines: "-DGGML_NATIVE=OFF -DGGML_AVX512=ON -DGGML_AVX=ON -DGGML_AVX2=ON -DGGML_FMA=ON -DGGML_F16C=ON -DSD_BUILD_SHARED_LIBS=ON"
4451

4552
steps:
4653
- name: Clone
@@ -60,7 +67,7 @@ jobs:
6067
run: |
6168
mkdir build
6269
cd build
63-
cmake .. -DGGML_AVX2=ON -DSD_BUILD_SHARED_LIBS=ON
70+
cmake .. ${{ matrix.defines }}
6471
cmake --build . --config Release
6572
6673
- name: Get commit hash
@@ -82,18 +89,25 @@ jobs:
8289
run: |
8390
cp ggml/LICENSE ./build/bin/ggml.txt
8491
cp LICENSE ./build/bin/stable-diffusion.cpp.txt
85-
zip -j 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 ./build/bin/*
92+
zip -j 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 }}-${{ matrix.build }}.zip ./build/bin/*
8693
8794
- name: Upload artifacts
8895
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
8996
uses: actions/upload-artifact@v4
9097
with:
91-
name: 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
98+
name: 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 }}-${{ matrix.build }}.zip
9299
path: |
93-
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
100+
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 }}-${{ matrix.build }}.zip
94101
95102
macOS-latest-cmake:
96103
runs-on: macos-latest
104+
strategy:
105+
matrix:
106+
include:
107+
- build: "cpu"
108+
defines: "-DGGML_AVX2=ON -DCMAKE_OSX_ARCHITECTURES=\"arm64;x86_64\" -DSD_BUILD_SHARED_LIBS=ON"
109+
- build: "metal"
110+
defines: "-DGGML_AVX2=ON -DSD_METAL=ON -DCMAKE_OSX_ARCHITECTURES=\"arm64;x86_64\" -DSD_BUILD_SHARED_LIBS=ON"
97111

98112
steps:
99113
- name: Clone
@@ -113,7 +127,7 @@ jobs:
113127
sysctl -a
114128
mkdir build
115129
cd build
116-
cmake .. -DGGML_AVX2=ON -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DSD_BUILD_SHARED_LIBS=ON
130+
cmake .. ${{ matrix.defines }}
117131
cmake --build . --config Release
118132
119133
- name: Get commit hash
@@ -135,15 +149,15 @@ jobs:
135149
run: |
136150
cp ggml/LICENSE ./build/bin/ggml.txt
137151
cp LICENSE ./build/bin/stable-diffusion.cpp.txt
138-
zip -j 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 ./build/bin/*
152+
zip -j 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 }}-${{ matrix.build }}.zip ./build/bin/*
139153
140154
- name: Upload artifacts
141155
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
142156
uses: actions/upload-artifact@v4
143157
with:
144-
name: 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
158+
name: 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 }}-${{ matrix.build }}.zip
145159
path: |
146-
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
160+
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 }}-${{ matrix.build }}.zip
147161
148162
windows-latest-cmake:
149163
runs-on: windows-2025

0 commit comments

Comments
 (0)