Skip to content

Commit

Permalink
ci: reuse llama.cpp distributions for windows cuda packaging (#2927)
Browse files Browse the repository at this point in the history
* ci: reuse llama.cpp distributions for windows cuda packaging

* fix

* fix

* update

* update

* update

* update
  • Loading branch information
wsxiaoys authored Aug 21, 2024
1 parent 12a950f commit 735080a
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 3 deletions.
42 changes: 39 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
- x86_64-manylinux2014-vulkan
- x86_64-windows-msvc
- x86_64-windows-msvc-vulkan
- x86_64-windows-msvc-cuda117
- x86_64-windows-msvc-cuda122
# - x86_64-windows-msvc-cuda117
# - x86_64-windows-msvc-cuda122
include:
- os: macos-latest
target: aarch64-apple-darwin
Expand Down Expand Up @@ -244,9 +244,42 @@ jobs:
retention-days: 3
name: tabby_${{ matrix.binary }}${{ matrix.ext }}
path: tabby_${{ matrix.binary }}${{ matrix.ext }}

package-win-cuda:
runs-on: ubuntu-latest
env:
LLAMA_CPP_VERSION: b3571
needs: [release-binary]
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download all artifacts
uses: actions/download-artifact@v3

- name: Display structure of downloaded files
run: ls -R

- name: Package CUDA 11.7
run: >
LLAMA_CPP_PLATFORM=cuda-cu11.7.1-x64 OUTPUT_NAME=tabby_x86_64-windows-msvc-cuda117 ./ci/package-win.sh
- name: Package CUDA 12.2
run: >
LLAMA_CPP_PLATFORM=cuda-cu12.2.0-x64 OUTPUT_NAME=tabby_x86_64-windows-msvc-cuda122 ./ci/package-win.sh
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
retention-days: 3
name: dist
path: dist/


pre-release:
needs: [release-llama-server-binary, release-binary]
needs: [release-llama-server-binary, release-binary, package-win-cuda]
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down Expand Up @@ -291,6 +324,9 @@ jobs:
fi
done
done
- name: Display structure of created files
run: ls -R dist

- uses: ncipollo/release-action@v1
if: github.event_name == 'push'
Expand Down
23 changes: 23 additions & 0 deletions ci/package-win.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

# Input variables
LLAMA_CPP_VERSION=${LLAMA_CPP_VERSION:-b3571}
LLAMA_CPP_PLATFORM=${LLAMA_CPP_PLATFORM:-cuda-cu11.7.1-x64}
OUTPUT_NAME=${OUTPUT_NAME:-tabby_x86_64-windows-msvc-cuda117}

NAME=llama-${LLAMA_CPP_VERSION}-bin-win-${LLAMA_CPP_PLATFORM}
ZIP_FILE=${NAME}.zip

curl https://github.com/ggerganov/llama.cpp/releases/download/${LLAMA_CPP_VERSION}/${ZIP_FILE} -L -o ${ZIP_FILE}
unzip ${ZIP_FILE} -d ${OUTPUT_NAME}

pushd ${OUTPUT_NAME}
rm $(ls *.exe | grep -v "llama-server")
cp ../tabby_x86_64-windows-msvc.exe tabby.exe
popd

zip -r ${OUTPUT_NAME}.zip ${OUTPUT_NAME}
rm -rf ${OUTPUT_NAME}

mkdir -p dist
mv ${OUTPUT_NAME}.zip dist/

0 comments on commit 735080a

Please sign in to comment.