Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit c45cbfd

Browse files
hiro-vhiento09
andauthored
feat: CI/CD and windows with/ without GPU (#64)
* feat(ci): init commit for windows with/ without GPU support * fix(ci): Update windows-nvidia runners and git clone recursive * fix(ci-windows): Update cmake for preparation * fix(ci-windows): Update step name, remove cuda-toolkit installation, Add release job * fix(ci-windows): Use 1 value in windows matrix, package nitro windows GPU dll * fix(ci-windows): Update cmd as shell * fix(ci-windows): Fix cmake build -j nproc * fix(ci-windows): Update nproc * Refactor CICD windows nitro --------- Co-authored-by: Hien To <tominhhien97@gmail.com>
1 parent 1a82c95 commit c45cbfd

File tree

1 file changed

+132
-2
lines changed

1 file changed

+132
-2
lines changed

.github/workflows/build.yml

Lines changed: 132 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,139 @@ jobs:
224224
asset_path: ./nitro.zip
225225
asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-mac-amd64.zip
226226
asset_content_type: application/zip
227+
228+
windows-amd64-build:
229+
runs-on: windows-latest
230+
needs: create-draft-release
231+
if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped')
232+
permissions:
233+
contents: write
234+
235+
env:
236+
OPENBLAS_VERSION: 0.3.23
237+
OPENCL_VERSION: 2023.04.17
238+
CLBLAST_VERSION: 1.6.0
239+
240+
strategy:
241+
matrix:
242+
include:
243+
- build: 'normal'
244+
defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS="$env:RUNNER_TEMP/openblas/include" -DBLAS_LIBRARIES="$env:RUNNER_TEMP/openblas/lib/openblas.lib"'
245+
246+
steps:
247+
- name: Clone
248+
249+
id: checkout
250+
uses: actions/checkout@v3
251+
with:
252+
submodules: recursive
253+
254+
- name: Setup VSWhere.exe
255+
uses: warrenbuckley/Setup-VSWhere@v1
256+
with:
257+
version: latest
258+
silent: true
259+
env:
260+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
261+
262+
263+
- name: actions-setup-cmake
264+
uses: jwlawson/actions-setup-cmake@v1.14.1
265+
266+
- name: Build
267+
id: cmake_build
268+
shell: cmd
269+
run: |
270+
cmake -S ./nitro_deps -B ./build_deps/nitro_deps
271+
cmake --build ./build_deps/nitro_deps --config Release
272+
mkdir build
273+
cd build
274+
cmake ..
275+
cmake --build . --config Release -j 4
276+
277+
- name: Pack artifacts
278+
id: pack_artifacts
279+
run: |
280+
$dst='.\build\Release'
281+
robocopy build_deps\_install\bin\zlib.dll $dst
282+
robocopy build\bin\Release\llama.dll $dst
283+
mkdir -p .\build\Release\config
284+
robocopy config.json .\build\Release\config
285+
7z a nitro.zip .\build\Release\*
286+
287+
- uses: actions/upload-release-asset@v1.0.1
288+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
289+
env:
290+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
291+
with:
292+
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
293+
asset_path: ./nitro.zip
294+
asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-win-amd64-${{ matrix.build }}.zip
295+
asset_content_type: application/zip
296+
297+
windows-amd64-cuda-build:
298+
runs-on: windows-nvidia
299+
needs: create-draft-release
300+
if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped')
301+
permissions:
302+
contents: write
303+
304+
strategy:
305+
matrix:
306+
cuda: ['12.2.0']
307+
build: ['cublas']
308+
309+
steps:
310+
- name: Clone
311+
id: checkout
312+
uses: actions/checkout@v3
313+
with:
314+
submodules: recursive
315+
316+
- name: Setup VSWhere.exe
317+
uses: warrenbuckley/Setup-VSWhere@v1
318+
with:
319+
version: latest
320+
silent: true
321+
env:
322+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
323+
324+
- name: Build
325+
id: cmake_build
326+
shell: cmd
327+
run: |
328+
cmake -S ./nitro_deps -B ./build_deps/nitro_deps
329+
cmake --build ./build_deps/nitro_deps --config Release
330+
mkdir build
331+
cd build
332+
cmake .. -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_CUBLAS=ON -DBUILD_SHARED_LIBS=ON
333+
cmake --build . --config Release -j 4
334+
335+
- name: Pack artifacts
336+
id: pack_artifacts
337+
shell: cmd
338+
run: |
339+
set PATH=%PATH%;C:\Program Files\7-Zip\
340+
echo %PATH%
341+
$dst='.\build\Release'
342+
robocopy build_deps\_install\bin\zlib.dll $dst
343+
robocopy build\bin\Release\llama.dll $dst
344+
mkdir -p .\build\Release\config
345+
robocopy config.json .\build\Release\config
346+
7z a nitro.zip .\build\Release\*
347+
348+
- uses: actions/upload-release-asset@v1.0.1
349+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
350+
env:
351+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
352+
with:
353+
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
354+
asset_path: ./nitro.zip
355+
asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-win-amd64-${{ matrix.build }}-cu${{ matrix.cuda }}.zip
356+
asset_content_type: application/zip
227357

228358
update_release_draft:
229-
needs: [ubuntu-amd64-build, ubuntu-amd64-cuda-build, macOS-M-build, macOS-Intel-build]
359+
needs: [ubuntu-amd64-build, ubuntu-amd64-cuda-build, macOS-M-build, macOS-Intel-build, windows-amd64-build, windows-amd64-cuda-build]
230360
permissions:
231361
# write permission is required to create a github release
232362
contents: write
@@ -247,4 +377,4 @@ jobs:
247377
# config-name: my-config.yml
248378
# disable-autolabeler: true
249379
env:
250-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
380+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)