3939 BRANCH_NAME : ${{ github.head_ref || github.ref_name }}
4040
4141jobs :
42- ubuntu-latest-cmake :
43- runs-on : ubuntu-latest
44-
45- steps :
46- - name : Clone
47- id : checkout
48- uses : actions/checkout@v3
49- with :
50- submodules : recursive
51-
52- - name : Dependencies
53- id : depends
54- run : |
55- sudo apt-get update
56- sudo apt-get install build-essential
57-
58- - name : Build
59- id : cmake_build
60- run : |
61- mkdir build
62- cd build
63- cmake .. -DGGML_AVX2=ON -DSD_BUILD_SHARED_LIBS=ON
64- cmake --build . --config Release
65-
66- - name : Get commit hash
67- id : commit
68- if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/main' ) || github.event.inputs.create_release == 'true' }}
69- uses : pr-mpt/actions-commit-hash@v2
70-
71- - name : Fetch system info
72- id : system-info
73- run : |
74- echo "CPU_ARCH=`uname -m`" >> "$GITHUB_OUTPUT"
75- echo "OS_NAME=`lsb_release -s -i`" >> "$GITHUB_OUTPUT"
76- echo "OS_VERSION=`lsb_release -s -r`" >> "$GITHUB_OUTPUT"
77- echo "OS_TYPE=`uname -s`" >> "$GITHUB_OUTPUT"
78-
79- - name : Pack artifacts
80- id : pack_artifacts
81- if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
82- run : |
83- cp ggml/LICENSE ./build/bin/ggml.txt
84- 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/*
86-
87- - name : Upload artifacts
88- if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
89- uses : actions/upload-artifact@v4
90- 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
92- 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
94-
95- macOS-latest-cmake :
96- runs-on : macos-latest
97-
98- steps :
99- - name : Clone
100- id : checkout
101- uses : actions/checkout@v3
102- with :
103- submodules : recursive
104-
105- - name : Dependencies
106- id : depends
107- run : |
108- brew install zip
109-
110- - name : Build
111- id : cmake_build
112- run : |
113- sysctl -a
114- mkdir build
115- cd build
116- cmake .. -DGGML_AVX2=ON -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DSD_BUILD_SHARED_LIBS=ON
117- cmake --build . --config Release
118-
119- - name : Get commit hash
120- id : commit
121- if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/main' ) || github.event.inputs.create_release == 'true' }}
122- uses : pr-mpt/actions-commit-hash@v2
123-
124- - name : Fetch system info
125- id : system-info
126- run : |
127- echo "CPU_ARCH=`uname -m`" >> "$GITHUB_OUTPUT"
128- echo "OS_NAME=`sw_vers -productName`" >> "$GITHUB_OUTPUT"
129- echo "OS_VERSION=`sw_vers -productVersion`" >> "$GITHUB_OUTPUT"
130- echo "OS_TYPE=`uname -s`" >> "$GITHUB_OUTPUT"
131-
132- - name : Pack artifacts
133- id : pack_artifacts
134- if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
135- run : |
136- cp ggml/LICENSE ./build/bin/ggml.txt
137- 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/*
139-
140- - name : Upload artifacts
141- if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
142- uses : actions/upload-artifact@v4
143- 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
145- 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
147-
14842 windows-latest-cmake :
14943 runs-on : windows-2019
15044
@@ -160,10 +54,10 @@ jobs:
16054 defines : " -DGGML_NATIVE=OFF -DGGML_AVX2=ON -DSD_BUILD_SHARED_LIBS=ON"
16155 - build : " avx"
16256 defines : " -DGGML_NATIVE=OFF -DGGML_AVX=ON -DGGML_AVX2=OFF -DSD_BUILD_SHARED_LIBS=ON"
163- - build : " avx512"
164- defines : " -DGGML_NATIVE=OFF -DGGML_AVX512=ON -DGGML_AVX=ON -DGGML_AVX2=ON -DSD_BUILD_SHARED_LIBS=ON"
165- - build : " cuda12"
166- defines : " -DSD_CUDA=ON -DSD_BUILD_SHARED_LIBS=ON -DCMAKE_CUDA_ARCHITECTURES=90;89;80;75"
57+ # - build: "avx512"
58+ # defines: "-DGGML_NATIVE=OFF -DGGML_AVX512=ON -DGGML_AVX=ON -DGGML_AVX2=ON -DSD_BUILD_SHARED_LIBS=ON"
59+ # - build: "cuda12"
60+ # defines: "-DSD_CUDA=ON -DSD_BUILD_SHARED_LIBS=ON -DCMAKE_CUDA_ARCHITECTURES=90;89;80;75"
16761 # - build: "rocm5.5"
16862 # defines: '-G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSD_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release -DAMDGPU_TARGETS="gfx1100;gfx1102;gfx1030" -DSD_BUILD_SHARED_LIBS=ON'
16963 - build : ' vulkan'
@@ -175,21 +69,21 @@ jobs:
17569 with :
17670 submodules : recursive
17771
178- - name : Install cuda-toolkit
179- id : cuda-toolkit
180- if : ${{ matrix.build == 'cuda12' }}
181- 182- with :
183- cuda : " 12.6.2"
184- method : " network"
185- sub-packages : ' ["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]'
186-
187- - name : Install rocm-toolkit
188- id : rocm-toolkit
189- if : ${{ matrix.build == 'rocm5.5' }}
190- uses :
Cyberhan123/[email protected] 191- with :
192- rocm : " 5.5.0"
72+ # - name: Install cuda-toolkit
73+ # id: cuda-toolkit
74+ # if: ${{ matrix.build == 'cuda12' }}
75+ 76+ # with:
77+ # cuda: "12.6.2"
78+ # method: "network"
79+ # sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]'
80+
81+ # - name: Install rocm-toolkit
82+ # id: rocm-toolkit
83+ # if: ${{ matrix.build == 'rocm5.5' }}
84+ # uses: Cyberhan123/[email protected] 85+ # with:
86+ # rocm: "5.5.0"
19387
19488 - name : Install Ninja
19589 id : install-ninja
@@ -214,18 +108,18 @@ jobs:
214108 cmake .. ${{ matrix.defines }}
215109 cmake --build . --config Release
216110
217- - name : Check AVX512F support
218- id : check_avx512f
219- if : ${{ matrix.build == 'avx512' }}
220- continue-on-error : true
221- run : |
222- cd build
223- $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
224- $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
225- $cl = $(join-path $msvc 'bin\Hostx64\x64\cl.exe')
226- echo 'int main(void){unsigned int a[4];__cpuid(a,7);return !(a[1]&65536);}' >> avx512f.c
227- & $cl /O2 /GS- /kernel avx512f.c /link /nodefaultlib /entry:main
228- .\avx512f.exe && echo "AVX512F: YES" && ( echo HAS_AVX512F=1 >> $env:GITHUB_ENV ) || echo "AVX512F: NO"
111+ # - name: Check AVX512F support
112+ # id: check_avx512f
113+ # if: ${{ matrix.build == 'avx512' }}
114+ # continue-on-error: true
115+ # run: |
116+ # cd build
117+ # $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
118+ # $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
119+ # $cl = $(join-path $msvc 'bin\Hostx64\x64\cl.exe')
120+ # echo 'int main(void){unsigned int a[4];__cpuid(a,7);return !(a[1]&65536);}' >> avx512f.c
121+ # & $cl /O2 /GS- /kernel avx512f.c /link /nodefaultlib /entry:main
122+ # .\avx512f.exe && echo "AVX512F: YES" && ( echo HAS_AVX512F=1 >> $env:GITHUB_ENV ) || echo "AVX512F: NO"
229123
230124 - name : Get commit hash
231125 id : commit
@@ -252,22 +146,22 @@ jobs:
252146 }
253147 7z a sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-${{ matrix.build }}-x64.zip $filePath
254148
255- - name : Copy and pack Cuda runtime
256- id : pack_cuda_runtime
257- if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.build == 'cuda12' ) || github.event.inputs.create_release == 'true' }}
258- run : |
259- echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
260- $dst='.\build\bin\cudart\'
261- robocopy "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll
262- 7z a cudart-sd-bin-win-cu12-x64.zip $dst\*
263-
264- - name : Upload Cuda runtime
265- if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.build == 'cuda12' ) || github.event.inputs.create_release == 'true' }}
266- uses : actions/upload-artifact@v4
267- with :
268- name : sd-cudart-sd-bin-win-cu12-x64.zip
269- path : |
270- cudart-sd-bin-win-cu12-x64.zip
149+ # - name: Copy and pack Cuda runtime
150+ # id: pack_cuda_runtime
151+ # if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.build == 'cuda12' ) || github.event.inputs.create_release == 'true' }}
152+ # run: |
153+ # echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
154+ # $dst='.\build\bin\cudart\'
155+ # robocopy "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll
156+ # 7z a cudart-sd-bin-win-cu12-x64.zip $dst\*
157+
158+ # - name: Upload Cuda runtime
159+ # if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.build == 'cuda12' ) || github.event.inputs.create_release == 'true' }}
160+ # uses: actions/upload-artifact@v4
161+ # with:
162+ # name: sd-cudart-sd-bin-win-cu12-x64.zip
163+ # path: |
164+ # cudart-sd-bin-win-cu12-x64.zip
271165
272166 - name : Upload artifacts
273167 if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
@@ -283,8 +177,6 @@ jobs:
283177 runs-on : ubuntu-latest
284178
285179 needs :
286- - ubuntu-latest-cmake
287- - macOS-latest-cmake
288180 - windows-latest-cmake
289181
290182 steps :
0 commit comments