Skip to content

Commit a3b85b2

Browse files
authored
ci : add cublas to windows release (#1271)
1 parent 921dcee commit a3b85b2

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

.github/workflows/build.yml

+77
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,82 @@ jobs:
210210
path: |
211211
llama-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-${{ matrix.build }}-x64.zip
212212
213+
windows-latest-cmake-cublas:
214+
runs-on: windows-latest
215+
216+
strategy:
217+
matrix:
218+
cuda: ['12.1.0', '11.7.1']
219+
build: ['cublas']
220+
221+
steps:
222+
- name: Clone
223+
id: checkout
224+
uses: actions/checkout@v1
225+
226+
- uses: Jimver/[email protected]
227+
id: cuda-toolkit
228+
with:
229+
cuda: ${{ matrix.cuda }}
230+
# TODO(green-sky): _dev seems to fail, and non dev are not enought
231+
#sub-packages: '["nvcc", "cudart", "cublas", "cudart_dev", "cublas_dev"]'
232+
233+
- name: Build
234+
id: cmake_build
235+
run: |
236+
mkdir build
237+
cd build
238+
cmake .. -DLLAMA_CUBLAS=ON
239+
cmake --build . --config Release
240+
241+
- name: Get commit hash
242+
id: commit
243+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
244+
uses: pr-mpt/actions-commit-hash@v2
245+
246+
- name: Pack artifacts
247+
id: pack_artifacts
248+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
249+
run: |
250+
7z a llama-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-${{ matrix.build }}-cu${{ matrix.cuda }}-x64.zip .\build\bin\Release\*
251+
252+
- name: Upload artifacts
253+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
254+
uses: actions/upload-artifact@v3
255+
with:
256+
path: |
257+
llama-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-${{ matrix.build }}-cu${{ matrix.cuda }}-x64.zip
258+
259+
- name: Copy and pack Cuda runtime
260+
if: ${{ matrix.cuda == '12.1.0' }}
261+
# TODO(green-sky): paths are cuda 12 specific
262+
run: |
263+
echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
264+
mkdir '.\build\bin\cudart\'
265+
cp "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin\cudart64_12.dll" '.\build\bin\cudart\'
266+
cp "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin\cublas64_12.dll" '.\build\bin\cudart\'
267+
cp "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin\cublasLt64_12.dll" '.\build\bin\cudart\'
268+
7z a cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip .\build\bin\cudart\*
269+
270+
- name: Copy and pack Cuda runtime
271+
if: ${{ matrix.cuda == '11.7.1' }}
272+
# TODO(green-sky): paths are cuda 11 specific
273+
run: |
274+
echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
275+
mkdir '.\build\bin\cudart\'
276+
ls "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin"
277+
cp "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin\cudart64_110.dll" '.\build\bin\cudart\'
278+
cp "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin\cublas64_11.dll" '.\build\bin\cudart\'
279+
cp "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin\cublasLt64_11.dll" '.\build\bin\cudart\'
280+
7z a cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip .\build\bin\cudart\*
281+
282+
- name: Upload Cuda runtime
283+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
284+
uses: actions/upload-artifact@v3
285+
with:
286+
path: |
287+
cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip
288+
213289
release:
214290
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
215291

@@ -221,6 +297,7 @@ jobs:
221297
- macOS-latest-make
222298
- macOS-latest-cmake
223299
- windows-latest-cmake
300+
- windows-latest-cmake-cublas
224301

225302
steps:
226303
- name: Download artifacts

0 commit comments

Comments
 (0)