Skip to content

Commit

Permalink
Add nuspec for OpenCL (CLBLAST)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoncouture committed Feb 5, 2024
1 parent d468df0 commit 2fb5be4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
9 changes: 5 additions & 4 deletions .github/prepare_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ dotnet pack ./LLama.KernelMemory/LLamaSharp.KernelMemory.csproj -c Release -o ./

# pack the backends
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 ..
exit 0
8 changes: 6 additions & 2 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ jobs:
cmake .. ${{ env.COMMON_DEFINE }} -DLLAMA_CLBLAST=ON -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/clblast"
cmake --build . --config Release -j ${env:NUMBER_OF_PROCESSORS}
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
- name: Build
if: ${{ matrix.os == 'ubuntu-22.04' }}
Expand All @@ -149,7 +152,8 @@ jobs:
cd build
cmake .. ${{ env.COMMON_DEFINE }} -DLLAMA_CLBLAST=ON
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
- name: Upload artifacts (Windows)
if: ${{ matrix.os == 'windows-latest' }}
Expand All @@ -165,7 +169,7 @@ jobs:
with:
path: |
./build/libllama.so
./build/libclblast.so
# ./build/libclblast.so
name: llama-bin-linux-clblast-x64.so

compile-cublas:
Expand Down
28 changes: 28 additions & 0 deletions LLama/runtimes/build/LLamaSharp.Backend.OpenCL.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?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/libllama.so" target="runtimes\linux-x64\native\clblast\libllama.so" />
<file src="runtimes/deps/clblast/clblast.dll" target="runtimes\win-x64\native\clblast\clblast.dll" />
<file src="runtimes/deps/clblast/libclblast.so" target="runtimes\linux-x64\native\clblast\libclblast.so" />

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

0 comments on commit 2fb5be4

Please sign in to comment.