-
Notifications
You must be signed in to change notification settings - Fork 11
195 lines (169 loc) · 5.4 KB
/
backends.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: backends
on:
workflow_dispatch:
inputs:
version:
description: 'version'
required: true
type: string
commit:
description: 'sd.cpp commit'
required: true
type: string
jobs:
windows:
runs-on: windows-latest
strategy:
matrix:
include:
- build: 'sycl'
defines: '-DSD_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DSD_BUILD_SHARED_LIBS=ON'
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4.1.2
with:
repository: 'leejet/stable-diffusion.cpp'
ref: '${{ github.event.inputs.commit }}'
submodules: recursive
- name: Install cuda-toolkit
id: cuda-toolkit-11
if: ${{ matrix.build == 'cuda11' }}
uses: Jimver/cuda-toolkit@v0.2.14
with:
cuda: '11.8.0'
method: network
sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]'
use-github-cache: false
use-local-cache: false
- name: Install cuda-toolkit
id: cuda-toolkit-12
if: ${{ matrix.build == 'cuda12' }}
uses: Jimver/cuda-toolkit@v0.2.16
with:
cuda: '12.5.0'
method: network
sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]'
use-github-cache: false
use-local-cache: false
- name: Install rocm-toolkit
id: rocm-toolkit
if: ${{ matrix.build == 'rocm5' }}
uses: Cyberhan123/rocm-toolkit@v0.1.0
with:
rocm: '5.5.0'
- name: Install Ninja
id: install-ninja
if: ${{ matrix.build == 'rocm5' }}
uses: urkle/action-get-ninja@v1
with:
version: 1.11.1
- name: Build
id: cmake_build
run: |
mkdir build
cd build
cmake .. ${{ matrix.defines }}
cmake --build . --config Release
- name: Upload artifact
id: upload_artifact
if: ${{ matrix.build != 'rocm5' }}
uses: actions/upload-artifact@v4.3.1
with:
name: windows-${{ matrix.build }}
path: .\build\bin\Release\stable-diffusion.dll
- name: Upload artifact Rocm
id: upload_artifact_rocm
if: ${{ matrix.build == 'rocm5' }}
uses: actions/upload-artifact@v4.3.1
with:
name: windows-${{ matrix.build }}
path: .\build\bin\stable-diffusion.dll
linux:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- build: 'sycl'
defines: '-DSD_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DSD_BUILD_SHARED_LIBS=ON'
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4.1.2
with:
repository: 'leejet/stable-diffusion.cpp'
ref: '${{ github.event.inputs.commit }}'
submodules: recursive
- name: Install cuda-toolkit
id: cuda-toolkit-11
if: ${{ matrix.build == 'cuda11' }}
uses: Jimver/cuda-toolkit@v0.2.14
with:
cuda: '11.7.1'
method: network
use-github-cache: false
use-local-cache: false
- name: Install cuda-toolkit
id: cuda-toolkit-12
if: ${{ matrix.build == 'cuda12' }}
uses: Jimver/cuda-toolkit@v0.2.14
with:
cuda: '12.2.0'
method: network
use-github-cache: false
use-local-cache: false
- name: Install Sycl tools
id: installSyclCompiler
if: ${{ matrix.build == 'sycl' }}
shell: bash
run: |
cd /tmp
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt update
sudo apt install intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mkl-devel
- name: Build
id: cmake_build
run: |
source /opt/intel/oneapi/setvars.sh
mkdir build
cd build
cmake .. ${{ matrix.defines }}
cmake --build . --config Release
- name: Upload artifact
id: upload_artifact
uses: actions/upload-artifact@v4.3.1
with:
name: linux-${{ matrix.build }}
path: ./build/bin/libstable-diffusion.so
release:
runs-on: ubuntu-latest
needs:
- windows
- linux
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4.1.2
- name: Download artifacts
id: download_artifacts
uses: actions/download-artifact@v4
with:
path: Backends
- name: Display structure of downloaded files
run: ls -R
- name: Setup nuget
id: setup_nuget
uses: NuGet/setup-nuget@v2.0.0
- name: Pack
id: pack
run: |
nuget pack ./Backends/StableDiffusion.NET.Backend.Cpu.nuspec -version ${{ github.event.inputs.version }}
- name: Upload artifacts
id: upload_artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: StableDiffusion.NET.Backend-Nugets
path: ./*.nupkg