Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 50 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -288,17 +288,6 @@ jobs:
permissions:
contents: write

env:
OPENBLAS_VERSION: 0.3.23
OPENCL_VERSION: 2023.04.17
CLBLAST_VERSION: 1.6.0

strategy:
matrix:
include:
- build: 'normal'
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"'

steps:
- name: Clone

Expand All @@ -315,7 +304,6 @@ jobs:
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true


- name: actions-setup-cmake
uses: jwlawson/actions-setup-cmake@v1.14.1

Expand All @@ -327,15 +315,15 @@ jobs:
cmake --build ./build_deps/nitro_deps --config Release
mkdir -p build
cd build
cmake ..
cmake .. -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=ON
cmake --build . --config Release -j "%NUMBER_OF_PROCESSORS%"

- name: Pack artifacts
id: pack_artifacts
shell: cmd
run: |
robocopy build_deps\_install\bin .\build\Release zlib.dll
robocopy build\bin\Release .\build\Release llama.dll
robocopy build_deps\_install\bin\ .\build\Release\ zlib.dll
robocopy build\bin\Release\ .\build\Release\ llama.dll
dotnet tool install --global AzureSignTool
azuresigntool.exe sign -kvu "${{ secrets.AZURE_KEY_VAULT_URI }}" -kvi "${{ secrets.AZURE_CLIENT_ID }}" -kvt "${{ secrets.AZURE_TENANT_ID }}" -kvs "${{ secrets.AZURE_CLIENT_SECRET }}" -kvc ${{ secrets.AZURE_CERT_NAME }} -tr http://timestamp.globalsign.com/tsa/r6advanced1 -v ".\build\Release\nitro.exe"
7z a -ttar temp.tar .\build\Release\*
Expand Down Expand Up @@ -371,11 +359,6 @@ jobs:
permissions:
contents: write

strategy:
matrix:
cuda: ['12.2.0']
build: ['cublas']

steps:
- name: Clone
id: checkout
Expand All @@ -390,7 +373,7 @@ jobs:
silent: true
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
Expand All @@ -403,16 +386,16 @@ jobs:
cmake --build ./build_deps/nitro_deps --config Release
mkdir -p build
cd build
cmake .. -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_CUBLAS=ON
cmake .. -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_CUBLAS=ON -DBUILD_SHARED_LIBS=ON
cmake --build . --config Release -j "%NUMBER_OF_PROCESSORS%"

- name: Pack artifacts
id: pack_artifacts
shell: cmd
run: |
set PATH=%PATH%;C:\Program Files\7-Zip\
robocopy build_deps\_install\bin .\build\Release zlib.dll
robocopy build\bin\Release .\build\Release llama.dll
robocopy build_deps\_install\bin\ .\build\Release\ zlib.dll
robocopy build\bin\Release\ .\build\Release\ llama.dll
dotnet tool install --global AzureSignTool
%USERPROFILE%\.dotnet\tools\azuresigntool.exe sign -kvu "${{ secrets.AZURE_KEY_VAULT_URI }}" -kvi "${{ secrets.AZURE_CLIENT_ID }}" -kvt "${{ secrets.AZURE_TENANT_ID }}" -kvs "${{ secrets.AZURE_CLIENT_SECRET }}" -kvc ${{ secrets.AZURE_CERT_NAME }} -tr http://timestamp.globalsign.com/tsa/r6advanced1 -v ".\build\Release\nitro.exe"
7z a -ttar temp.tar .\build\Release\*
Expand All @@ -439,11 +422,52 @@ jobs:
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
asset_path: ./nitro.tar.gz
asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-win-amd64-cuda.tar.gz
asset_content_type: application/gzip
asset_content_type: application/gzip

windows-amd64-cuda-package:
runs-on: windows-latest
needs: create-draft-release
if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped')
permissions:
contents: write

strategy:
matrix:
cuda: ['12.2.0', '11.7.1']
build: ['cublas']

steps:
- uses: Jimver/cuda-toolkit@v0.2.11
id: cuda-toolkit
with:
cuda: ${{ matrix.cuda }}
method: 'network'
sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]'

- name: Copy and Pack CUDA runtime
id: pack_artifacts
shell: cmd
run: |
echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
mkdir -p build
$dst='.\build\'
robocopy "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll
7z a -ttar temp.tar $dst\*
7z a -tgzip cudart.tar.gz temp.tar

- uses: actions/upload-release-asset@v1.0.1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
asset_path: ./cudart.tar.gz
asset_name: cudart-bin-win-cu${{ matrix.cuda }}-x64.tar.gz
asset_content_type: application/gzip

update_release_draft:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs: [ubuntu-amd64-build, ubuntu-amd64-cuda-build, macOS-M-build, macOS-Intel-build, windows-amd64-build, windows-amd64-cuda-build]
needs: [ubuntu-amd64-build, ubuntu-amd64-cuda-build, macOS-M-build, macOS-Intel-build, windows-amd64-build, windows-amd64-cuda-build, windows-amd64-cuda-package]
permissions:
contents: write
pull-requests: write
Expand Down