Skip to content

KoboldCpp Linux ROCm #39

KoboldCpp Linux ROCm

KoboldCpp Linux ROCm #39

name: KoboldCpp Linux ROCm
on:
workflow_dispatch:
inputs:
commit_hash:
description: 'Optional commit hash to build from'
required: false
default: ''
tag_name:
description: 'Optional version tag (e.g. v1.57.1) for stable release file'
required: false
default: ''
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
KCPP_CUDA: rocm
ARCHES_CU12: 1
jobs:
linux:
runs-on: ubuntu-22.04
permissions: write-all
steps:
- name: Free up disk space before container
run: |
echo "Cleaning up runner to make room for ROCm container..."
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache
sudo apt-get clean
df -h
- name: Checkout source
uses: actions/checkout@v3
with:
ref: ${{ inputs.commit_hash != '' && inputs.commit_hash || github.head_ref || github.ref_name }}
- name: Show Commit Used
run: |
echo "Building from ref: ${{ inputs.commit_hash != '' && inputs.commit_hash || github.head_ref || github.ref_name }}"
- name: Build inside ROCm container
run: |
docker run --privileged \
-v "${{ github.workspace }}:/workspace" \
-w /workspace \
-e KCPP_CUDA="rocm" \
-e BRANCH_NAME="${{ github.head_ref || github.ref_name }}" \
rocm/dev-ubuntu-22.04:7.1-complete \
bash -c "
apt update &&
DEBIAN_FRONTEND=noninteractive apt install -y git curl bzip2 python3-tk tcl tk &&
export TCL_LIBRARY=\$(find /usr/lib/ -name 'tcl8*' | head -n 1) &&
export TK_LIBRARY=\$(find /usr/lib/ -name 'tk8*' | head -n 1) &&
./koboldcpp.sh dist
"
- name: Save artifact
uses: actions/upload-artifact@v4
with:
name: kcpp_linux_binary
path: ${{ github.workspace }}/dist/
- name: Upload to GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload rocm-rolling dist/koboldcpp-linux-x64-rocm --clobber
- name: Upload version pinned tagged binary
if: ${{ inputs.tag_name != '' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ inputs.tag_name }}
run: |
cp dist/koboldcpp-linux-x64-rocm "dist/koboldcpp-linux-x64-rocm-${TAG_NAME}"
gh release upload rocm-rolling "dist/koboldcpp-linux-x64-rocm-${TAG_NAME}" --clobber