Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 147 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
description: 'Create new release'
required: true
type: boolean
llama_ref:
description: 'Upstream ggml-org/llama.cpp tag to build (must match lemonade backend_versions.json)'
required: false
default: 'b9747'
type: string
pull_request: # validate the release build on PRs; the release job is skipped so nothing is published
paths:
# The build jobs clone llama.cpp source from upstream and the get-tag-name
Expand All @@ -23,6 +28,12 @@ concurrency:
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
CMAKE_ARGS: "-DLLAMA_BUILD_EXAMPLES=OFF -DLLAMA_BUILD_TESTS=OFF -DLLAMA_BUILD_TOOLS=ON -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON"
# Upstream ref every job checks out. Empty on schedule/PR (no inputs) so
# actions/checkout uses ggml-org's default branch = latest — this preserves the
# fork's original "track upstream" nightly behavior. A manual dispatch defaults
# to the llama_ref input (b9747) so a deliberate build matches lemonade's
# backend_versions.json pin.
LLAMA_REF: ${{ github.event.inputs.llama_ref }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this. The whole point of this is that we can eventually turn on newer ROCM builds in upstream llama.cpp and this repo goes away. If we have code like this that concept can never happen.


jobs:
ubuntu-22-rocm:
Expand All @@ -42,6 +53,7 @@ jobs:
with:
fetch-depth: 0
repository: 'ggml-org/llama.cpp'
ref: ${{ env.LLAMA_REF }}

- name: ccache
uses: ggml-org/ccache-action@v1.2.21
Expand Down Expand Up @@ -142,6 +154,7 @@ jobs:
with:
fetch-depth: 0
repository: 'ggml-org/llama.cpp'
ref: ${{ env.LLAMA_REF }}

- name: ccache
uses: ggml-org/ccache-action@v1.2.21
Expand Down Expand Up @@ -300,6 +313,7 @@ jobs:
with:
fetch-depth: 0
repository: 'ggml-org/llama.cpp'
ref: ${{ env.LLAMA_REF }}

- name: ccache
uses: ggml-org/ccache-action@v1.2.21
Expand Down Expand Up @@ -455,6 +469,7 @@ jobs:
with:
fetch-depth: 0
repository: 'ggml-org/llama.cpp'
ref: ${{ env.LLAMA_REF }}

- name: ccache
uses: ggml-org/ccache-action@v1.2.21
Expand Down Expand Up @@ -581,6 +596,128 @@ jobs:
path: llama-bin-ubuntu-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.tar.gz
name: llama-bin-ubuntu-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.tar.gz

# ========================================================================
# musl (Alpine) — CPU. Upstream ggml-org ships only glibc ("ubuntu") Linux
# builds, so lemonade pulls musl CPU/Vulkan binaries from this fork instead.
# The source is cloned on the (glibc) host but compiled inside an Alpine
# container so it links musl. libstdc++/libgcc are linked statically and
# OpenMP is disabled so the tarball is self-contained (only musl libc, and
# for Vulkan libvulkan, are needed at runtime).
# ========================================================================
linux-musl-cpu:
Comment on lines +599 to +607

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you propose this to upstream llama.cpp too? I think that they need to be willing to do this too.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure - sorry, I've been super busy, I'll get this caught up when I can and see about upstreaming these.

strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-latest
arch: x64
cpu_variants: "ON"
- runner: ubuntu-24.04-arm
arch: arm64
cpu_variants: "OFF"
runs-on: ${{ matrix.runner }}

steps:
- name: Clone
uses: actions/checkout@v6
with:
fetch-depth: 0
repository: 'ggml-org/llama.cpp'
ref: ${{ env.LLAMA_REF }}

- name: Build (Alpine / musl)
run: |
docker run --rm -v "$PWD:/src" -w /src alpine:latest sh -euxc '
apk add --no-cache build-base cmake git linux-headers
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=Release \
-DGGML_NATIVE=OFF \
-DGGML_BACKEND_DL=ON \
-DGGML_CPU_ALL_VARIANTS=${{ matrix.cpu_variants }} \
-DGGML_OPENMP=OFF \
-DCMAKE_BUILD_RPATH_USE_ORIGIN=ON \
-DCMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++" \
-DCMAKE_SHARED_LINKER_FLAGS="-static-libgcc -static-libstdc++" \
${{ env.CMAKE_ARGS }}
cmake --build build --config Release -j"$(nproc)"
chmod -R a+rwX build
'

- name: Determine tag name
id: tag
uses: lemonade-sdk/llama.cpp/.github/actions/get-tag-name@lemonade

- name: Pack artifacts
run: |
cp LICENSE ./build/bin/
tar -czvf llama-bin-linux-musl-${{ matrix.arch }}.tar.gz --transform "s,./,llama-${{ steps.tag.outputs.name }}/," -C ./build/bin .

- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
path: llama-bin-linux-musl-${{ matrix.arch }}.tar.gz
name: llama-bin-linux-musl-${{ matrix.arch }}.tar.gz

# ========================================================================
# musl (Alpine) — Vulkan. Needs vulkan-loader + a GLSL compiler at build;
# the target Alpine host must have vulkan-loader and a Vulkan driver (Mesa).
# ========================================================================
linux-musl-vulkan:
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-latest
arch: x64
cpu_variants: "ON"
- runner: ubuntu-24.04-arm
arch: arm64
cpu_variants: "OFF"
runs-on: ${{ matrix.runner }}

steps:
- name: Clone
uses: actions/checkout@v6
with:
fetch-depth: 0
repository: 'ggml-org/llama.cpp'
ref: ${{ env.LLAMA_REF }}

- name: Build (Alpine / musl)
run: |
docker run --rm -v "$PWD:/src" -w /src alpine:latest sh -euxc '
apk add --no-cache build-base cmake git linux-headers \
vulkan-loader-dev vulkan-headers glslang shaderc spirv-tools spirv-headers
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=Release \
-DGGML_NATIVE=OFF \
-DGGML_BACKEND_DL=ON \
-DGGML_CPU_ALL_VARIANTS=${{ matrix.cpu_variants }} \
-DGGML_OPENMP=OFF \
-DGGML_VULKAN=ON \
-DCMAKE_BUILD_RPATH_USE_ORIGIN=ON \
-DCMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++" \
-DCMAKE_SHARED_LINKER_FLAGS="-static-libgcc -static-libstdc++" \
${{ env.CMAKE_ARGS }}
cmake --build build --config Release -j"$(nproc)"
chmod -R a+rwX build
'

- name: Determine tag name
id: tag
uses: lemonade-sdk/llama.cpp/.github/actions/get-tag-name@lemonade

- name: Pack artifacts
run: |
cp LICENSE ./build/bin/
tar -czvf llama-bin-linux-musl-vulkan-${{ matrix.arch }}.tar.gz --transform "s,./,llama-${{ steps.tag.outputs.name }}/," -C ./build/bin .

- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
path: llama-bin-linux-musl-vulkan-${{ matrix.arch }}.tar.gz
name: llama-bin-linux-musl-vulkan-${{ matrix.arch }}.tar.gz

windows-cpu:
runs-on: windows-2025

Expand All @@ -596,6 +733,7 @@ jobs:
with:
fetch-depth: 0
repository: 'ggml-org/llama.cpp'
ref: ${{ env.LLAMA_REF }}

- name: ccache
uses: ggml-org/ccache-action@v1.2.21
Expand Down Expand Up @@ -669,6 +807,7 @@ jobs:
with:
fetch-depth: 0
repository: 'ggml-org/llama.cpp'
ref: ${{ env.LLAMA_REF }}

- name: Cache ROCm Installation
id: cache-rocm
Expand Down Expand Up @@ -777,6 +916,7 @@ jobs:
with:
fetch-depth: 0
repository: 'ggml-org/llama.cpp'
ref: ${{ env.LLAMA_REF }}

- name: Install CUDA Toolkit
uses: Jimver/cuda-toolkit@v0.2.35
Expand Down Expand Up @@ -921,6 +1061,8 @@ jobs:
- ubuntu-22-cuda
- ubuntu-22-cuda-arm64
- ubuntu-22-openvino
- linux-musl-cpu
- linux-musl-vulkan

steps:
- name: Clone
Expand All @@ -929,6 +1071,7 @@ jobs:
with:
fetch-depth: 0
repository: 'ggml-org/llama.cpp'
ref: ${{ env.LLAMA_REF }}

- name: Determine tag name
id: tag
Expand Down Expand Up @@ -1128,6 +1271,10 @@ jobs:
'- Ubuntu x64 (CUDA): `llama-' + tag + '-ubuntu-cuda-sm_XX-x64.tar.xz` (replace XX with your GPU compute capability)',
'- Ubuntu arm64 (CUDA): `llama-' + tag + '-ubuntu-cuda-sm_XX-arm64.tar.xz` (replace XX with your GPU compute capability)',
`- [Ubuntu x64 (OpenVINO 2026.0)](https://github.com/${owner}/${repo}/releases/download/${tag}/llama-${tag}-bin-ubuntu-openvino-2026.0-x64.tar.gz)`,
`- [Alpine/musl x64 (CPU)](https://github.com/${owner}/${repo}/releases/download/${tag}/llama-${tag}-bin-linux-musl-x64.tar.gz)`,
`- [Alpine/musl arm64 (CPU)](https://github.com/${owner}/${repo}/releases/download/${tag}/llama-${tag}-bin-linux-musl-arm64.tar.gz)`,
`- [Alpine/musl x64 (Vulkan)](https://github.com/${owner}/${repo}/releases/download/${tag}/llama-${tag}-bin-linux-musl-vulkan-x64.tar.gz)`,
`- [Alpine/musl arm64 (Vulkan)](https://github.com/${owner}/${repo}/releases/download/${tag}/llama-${tag}-bin-linux-musl-vulkan-arm64.tar.gz)`,
'',
'**Windows:**',
`- [Windows x64 (ROCm 7.13)](https://github.com/${owner}/${repo}/releases/download/${tag}/llama-${tag}-bin-win-rocm-7.13-x64.zip)`,
Expand Down
Loading