Browse Source

Add nuspec for OpenCL (CLBLAST)

tags/v0.10.0
Jason Couture 1 year ago
parent
commit
c963b051e2
3 changed files with 39 additions and 7 deletions
  1. +5
    -4
      .github/prepare_release.sh
  2. +7
    -3
      .github/workflows/compile.yml
  3. +27
    -0
      LLama/runtimes/build/LLamaSharp.Backend.OpenCL.nuspec

+ 5
- 4
.github/prepare_release.sh View File

@@ -71,10 +71,11 @@ dotnet pack ./LLama.KernelMemory/LLamaSharp.KernelMemory.csproj -c Release -o ./


# pack the backends # pack the backends
cd temp cd temp
nuget pack LLamaSharp.Backend.Cpu.nuspec -version $updated_version
nuget pack LLamaSharp.Backend.Cuda11.nuspec -version $updated_version
nuget pack LLamaSharp.Backend.Cuda12.nuspec -version $updated_version

for nuspec in *.nuspec
do
echo "Packing $nuspec"
nuget pack $nuspec -version $updated_version
done


cd .. cd ..
exit 0 exit 0

+ 7
- 3
.github/workflows/compile.yml View File

@@ -141,6 +141,9 @@ jobs:
cmake .. ${{ env.COMMON_DEFINE }} -DLLAMA_CLBLAST=ON -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/clblast" cmake .. ${{ env.COMMON_DEFINE }} -DLLAMA_CLBLAST=ON -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/clblast"
cmake --build . --config Release -j ${env:NUMBER_OF_PROCESSORS} cmake --build . --config Release -j ${env:NUMBER_OF_PROCESSORS}
copy $env:RUNNER_TEMP/clblast/lib/clblast.dll .\bin\Release\clblast.dll copy $env:RUNNER_TEMP/clblast/lib/clblast.dll .\bin\Release\clblast.dll
echo "78a8c98bcb2efe1a63318d901ab204d9ba96c3b29707b4ce0c4240bdcdc698d6 clblast.dll" >> tmp
sha256sum -c tmp || exit 255
rm tmp
ls -R ls -R
- name: Build - name: Build
if: ${{ matrix.os == 'ubuntu-22.04' }} if: ${{ matrix.os == 'ubuntu-22.04' }}
@@ -149,7 +152,8 @@ jobs:
cd build cd build
cmake .. ${{ env.COMMON_DEFINE }} -DLLAMA_CLBLAST=ON cmake .. ${{ env.COMMON_DEFINE }} -DLLAMA_CLBLAST=ON
cmake --build . --config Release -j ${env:NUMBER_OF_PROCESSORS} cmake --build . --config Release -j ${env:NUMBER_OF_PROCESSORS}
cp $(ldconfig -p | grep libclblast.so | tail -n 1 | cut -d ' ' -f 4) ./
# if we ever want to pull libclblast.so back into the packages, just uncomment this line, and the one below for the upload
# cp $(ldconfig -p | grep libclblast.so | tail -n 1 | cut -d ' ' -f 4) ./
ls -R ls -R
- name: Upload artifacts (Windows) - name: Upload artifacts (Windows)
if: ${{ matrix.os == 'windows-latest' }} if: ${{ matrix.os == 'windows-latest' }}
@@ -165,7 +169,7 @@ jobs:
with: with:
path: | path: |
./build/libllama.so ./build/libllama.so
./build/libclblast.so
# ./build/libclblast.so
name: llama-bin-linux-clblast-x64.so name: llama-bin-linux-clblast-x64.so
compile-cublas: compile-cublas:
@@ -305,7 +309,7 @@ jobs:
cp artifacts/llama-bin-linux-cublas-cu12.1.0-x64.so/libllama.so deps/cu12.1.0/libllama.so cp artifacts/llama-bin-linux-cublas-cu12.1.0-x64.so/libllama.so deps/cu12.1.0/libllama.so
cp artifacts/llama-bin-win-clblast-x64.dll/{llama,clblast}.dll deps/clblast/ cp artifacts/llama-bin-win-clblast-x64.dll/{llama,clblast}.dll deps/clblast/
cp artifacts/llama-bin-linux-clblast-x64.so/lib{llama,clblast}.so deps/clblast/
cp artifacts/llama-bin-linux-clblast-x64.so/libllama.so deps/clblast/


- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4


+ 27
- 0
LLama/runtimes/build/LLamaSharp.Backend.OpenCL.nuspec View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<package >
<metadata>
<id>LLamaSharp.Backend.OpenCL</id>
<version>$version$</version>
<title>LLamaSharp.Backend.OpenCL - OpenCL Backend for LLamaSharp</title>
<authors>llama.cpp Authors</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<icon>icon512.png</icon>
<projectUrl>https://github.com/SciSharp/LLamaSharp</projectUrl>
<description>LLamaSharp.Backend.OpenCL is a backend for LLamaSharp to use with OpenCL.</description>
<releaseNotes></releaseNotes>
<copyright>Copyright 2023 The llama.cpp Authors. All rights reserved.</copyright>
<tags>LLamaSharp LLama LLM GPT AI ChatBot SciSharp</tags>
</metadata>

<files>
<file src="LLamaSharpBackend.props" target="build/netstandard2.0/LLamaSharp.Backend.OpenCL.props" />

<file src="runtimes/deps/clblast/llama.dll" target="runtimes\win-x64\native\clblast\llama.dll" />
<file src="runtimes/deps/clblast/clblast.dll" target="runtimes\win-x64\native\clblast\clblast.dll" />
<file src="runtimes/deps/clblast/libllama.so" target="runtimes\linux-x64\native\clblast\libllama.so" />

<file src="icon512.png" target="icon512.png" />
</files>
</package>

Loading…
Cancel
Save