Files
CachyLLama-BUILDER/.github/workflows/test-cachyllama-rocm.yml
T

151 lines
5.5 KiB
YAML

name: Test CachyLLama + ROCm Release
on:
workflow_dispatch:
inputs:
operating_systems:
description: 'Operating systems to test on (comma-separated: windows,ubuntu)'
required: false
default: 'windows,ubuntu'
gfx_target:
description: 'AMD GPU targets (comma-separated: gfx1151,gfx1150,gfx110X)'
required: false
default: 'gfx1151'
release_tag:
description: 'Release tag to test (e.g., b1001) or "latest"'
required: false
default: 'latest'
env:
OPERATING_SYSTEMS: ${{ github.event.inputs.operating_systems || 'windows,ubuntu' }}
GFX_TARGETS: ${{ github.event.inputs.gfx_target || 'gfx1151' }}
RELEASE_TAG: ${{ github.event.inputs.release_tag || 'latest' }}
jobs:
prepare-matrix:
runs-on: ubuntu-22.04
outputs:
windows_matrix: ${{ steps.set-matrix.outputs.windows_matrix }}
ubuntu_matrix: ${{ steps.set-matrix.outputs.ubuntu_matrix }}
should_test_windows: ${{ steps.set-matrix.outputs.should_test_windows }}
should_test_ubuntu: ${{ steps.set-matrix.outputs.should_test_ubuntu }}
latest_release_tag: ${{ steps.get-release.outputs.latest_release_tag }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Resolve release tag
id: get-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
release_input="${{ env.RELEASE_TAG }}"
if [ "$release_input" = "latest" ]; then
release_tag=$(gh release list --limit 1 --json tagName --jq '.[0].tagName' 2>/dev/null || echo "b1001")
echo "Using latest release: $release_tag"
else
release_tag="$release_input"
fi
echo "latest_release_tag=$release_tag" >> $GITHUB_OUTPUT
- name: Set matrix
id: set-matrix
run: |
targets="${{ env.GFX_TARGETS }}"
operating_systems="${{ env.OPERATING_SYSTEMS }}"
matrix_targets=$(echo "$targets" \
| tr ',' '\n' \
| sed 's/^ *//;s/ *$//' \
| sed 's/^"//;s/"$//' \
| jq -R . \
| jq -s '{gfx_target: .}' \
| jq -c)
should_test_windows="false"
should_test_ubuntu="false"
if [[ "$operating_systems" == *"windows"* ]]; then
should_test_windows="true"
echo "windows_matrix=$matrix_targets" >> $GITHUB_OUTPUT
fi
if [[ "$operating_systems" == *"ubuntu"* ]]; then
should_test_ubuntu="true"
echo "ubuntu_matrix=$matrix_targets" >> $GITHUB_OUTPUT
fi
echo "should_test_windows=$should_test_windows" >> $GITHUB_OUTPUT
echo "should_test_ubuntu=$should_test_ubuntu" >> $GITHUB_OUTPUT
test-windows:
runs-on: windows-2022
needs: prepare-matrix
if: needs.prepare-matrix.outputs.should_test_windows == 'true'
strategy:
matrix: ${{ fromJson(needs.prepare-matrix.outputs.windows_matrix) }}
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download release asset
shell: powershell
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$tag = "${{ needs.prepare-matrix.outputs.latest_release_tag }}"
$target = "${{ matrix.gfx_target }}"
$asset = "cachy-llama-${tag}-windows-rocm-${target}-x64.zip"
Write-Host "Downloading $asset from release $tag..."
gh release download $tag --pattern $asset
Expand-Archive -Path $asset -DestinationPath "llama-binaries" -Force
- name: Download test model
shell: powershell
run: |
curl.exe -L -o Qwen3-0.6B-Q4_0.gguf "https://huggingface.co/unsloth/Qwen3-0.6B-GGUF/resolve/main/Qwen3-0.6B-Q4_0.gguf?download=true"
- name: Test CachyLLama CLI
shell: powershell
run: |
.\llama-binaries\llama-cli.exe -m Qwen3-0.6B-Q4_0.gguf -ngl 99 -p "I believe the meaning of life is" -st -v
test-ubuntu:
runs-on: ubuntu-22.04
needs: prepare-matrix
if: needs.prepare-matrix.outputs.should_test_ubuntu == 'true'
strategy:
matrix: ${{ fromJson(needs.prepare-matrix.outputs.ubuntu_matrix) }}
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download release asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag="${{ needs.prepare-matrix.outputs.latest_release_tag }}"
target="${{ matrix.gfx_target }}"
asset="cachy-llama-${tag}-ubuntu-rocm-${target}-x64.zip"
echo "Downloading $asset from release $tag..."
gh release download "$tag" --pattern "$asset" || true
if [ -f "$asset" ]; then
unzip "$asset" -d llama-binaries
fi
- name: Download test model
run: |
curl -L -o Qwen3-0.6B-Q4_0.gguf "https://huggingface.co/unsloth/Qwen3-0.6B-GGUF/resolve/main/Qwen3-0.6B-Q4_0.gguf?download=true"
- name: Test CachyLLama CLI
run: |
if [ -f "./llama-binaries/llama-cli" ]; then
chmod +x ./llama-binaries/llama-cli
export LD_LIBRARY_PATH="$(pwd)/llama-binaries:${LD_LIBRARY_PATH:-}"
./llama-binaries/llama-cli -m Qwen3-0.6B-Q4_0.gguf -ngl 99 -p "I believe the meaning of life is" -st -v || true
else
echo "llama-cli binary not found (skipped test)"
fi