1
1
name : CI
2
2
3
3
on :
4
+ workflow_dispatch : # allows manual triggering
5
+ inputs :
6
+ create_release :
7
+ description : ' Create new release'
8
+ required : true
9
+ type : boolean
4
10
push :
5
11
branches :
6
12
- master
13
+ - ci
7
14
paths : ['.github/workflows/**', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu']
8
15
pull_request :
9
16
types : [opened, synchronize, reopened]
75
82
windows-latest-cmake :
76
83
runs-on : windows-latest
77
84
85
+ strategy :
86
+ matrix :
87
+ include :
88
+ - build : ' noavx'
89
+ defines : ' -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF'
90
+ - build : ' avx2'
91
+ defines : ' -DGGML_AVX2=ON'
92
+ - build : ' avx'
93
+ defines : ' -DGGML_AVX2=OFF'
94
+ - build : ' avx512'
95
+ defines : ' -DGGML_AVX512=ON'
96
+
78
97
steps :
79
98
- name : Clone
80
99
id : checkout
@@ -87,12 +106,45 @@ jobs:
87
106
run : |
88
107
mkdir build
89
108
cd build
90
- cmake ..
109
+ cmake .. ${{ matrix.defines }}
91
110
cmake --build . --config Release
92
111
112
+ - name : Check AVX512F support
113
+ id : check_avx512f
114
+ if : ${{ matrix.build == 'avx512' }}
115
+ continue-on-error : true
116
+ run : |
117
+ cd build
118
+ $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
119
+ $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
120
+ $cl = $(join-path $msvc 'bin\Hostx64\x64\cl.exe')
121
+ echo 'int main(void){unsigned int a[4];__cpuid(a,7);return !(a[1]&65536);}' >> avx512f.c
122
+ & $cl /O2 /GS- /kernel avx512f.c /link /nodefaultlib /entry:main
123
+ .\avx512f.exe && echo "AVX512F: YES" && ( echo HAS_AVX512F=1 >> $env:GITHUB_ENV ) || echo "AVX512F: NO"
124
+
93
125
# - name: Test
94
126
# id: cmake_test
95
127
# run: |
96
128
# cd build
97
129
# ctest -C Release --verbose --timeout 900
98
130
131
+ - name : Get commit hash
132
+ id : commit
133
+ if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
134
+ uses : pr-mpt/actions-commit-hash@v2
135
+
136
+ - name : Pack artifacts
137
+ id : pack_artifacts
138
+ if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
139
+ run : |
140
+ Copy-Item ggml/LICENSE .\build\bin\Release\ggml.txt
141
+ Copy-Item LICENSE .\build\bin\Release\stable-diffusion.cpp.txt
142
+ 7z a sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-${{ matrix.build }}-x64.zip .\build\bin\Release\*
143
+
144
+ - name : Upload artifacts
145
+ if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
146
+ uses : actions/upload-artifact@v3
147
+ with :
148
+ path : |
149
+ sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-${{ matrix.build }}-x64.zip
150
+
0 commit comments