Skip to content

Commit 2df1cf3

Browse files
committed
Merge branch 'PR'
2 parents b23d2ee + 121a130 commit 2df1cf3

File tree

219 files changed

+6044
-3890
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+6044
-3890
lines changed

.devops/musa.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG UBUNTU_VERSION=22.04
22
# This needs to generally match the container host's environment.
3-
ARG MUSA_VERSION=rc4.2.0
3+
ARG MUSA_VERSION=rc4.3.0
44
# Target the MUSA build image
55
ARG BASE_MUSA_DEV_CONTAINER=mthreads/musa:${MUSA_VERSION}-devel-ubuntu${UBUNTU_VERSION}-amd64
66

.github/workflows/build-linux-cross.yml

Lines changed: 0 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -141,97 +141,6 @@ jobs:
141141

142142
# cmake --build build --config Release -j $(nproc)
143143

144-
ubuntu-24-ppc64el-cpu-cross:
145-
runs-on: ubuntu-24.04
146-
147-
steps:
148-
- uses: actions/checkout@v4
149-
- name: Setup PowerPC64le
150-
run: |
151-
sudo dpkg --add-architecture ppc64el
152-
153-
# Add arch-specific repositories for non-amd64 architectures
154-
cat << EOF | sudo tee /etc/apt/sources.list.d/ppc64el-ports.list
155-
deb [arch=ppc64el] http://ports.ubuntu.com/ubuntu-ports/ noble main universe
156-
deb [arch=ppc64el] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main universe
157-
deb [arch=ppc64el] http://ports.ubuntu.com/ubuntu-ports/ noble-security main universe
158-
deb [arch=ppc64el] http://ports.ubuntu.com/ubuntu-ports/ noble-backports main universe
159-
EOF
160-
161-
sudo apt-get update || true ;# Prevent failure due to missing URLs.
162-
163-
sudo apt-get install -y --no-install-recommends \
164-
build-essential \
165-
gcc-14-powerpc64le-linux-gnu \
166-
g++-14-powerpc64le-linux-gnu
167-
168-
- name: Build
169-
run: |
170-
cmake -B build -DLLAMA_CURL=OFF \
171-
-DCMAKE_BUILD_TYPE=Release \
172-
-DGGML_OPENMP=OFF \
173-
-DLLAMA_BUILD_EXAMPLES=ON \
174-
-DLLAMA_BUILD_TOOLS=ON \
175-
-DLLAMA_BUILD_TESTS=OFF \
176-
-DCMAKE_SYSTEM_NAME=Linux \
177-
-DCMAKE_SYSTEM_PROCESSOR=ppc64 \
178-
-DCMAKE_C_COMPILER=powerpc64le-linux-gnu-gcc-14 \
179-
-DCMAKE_CXX_COMPILER=powerpc64le-linux-gnu-g++-14 \
180-
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
181-
-DCMAKE_FIND_ROOT_PATH=/usr/lib/powerpc64le-linux-gnu \
182-
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
183-
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
184-
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
185-
186-
cmake --build build --config Release -j $(nproc)
187-
188-
# ubuntu-24-ppc64el-vulkan-cross:
189-
# runs-on: ubuntu-24.04
190-
191-
# steps:
192-
# - uses: actions/checkout@v4
193-
# - name: Setup PowerPC64le
194-
# run: |
195-
# sudo dpkg --add-architecture ppc64el
196-
197-
# # Add arch-specific repositories for non-amd64 architectures
198-
# cat << EOF | sudo tee /etc/apt/sources.list.d/ppc64el-ports.list
199-
# deb [arch=ppc64el] http://ports.ubuntu.com/ubuntu-ports/ noble main universe
200-
# deb [arch=ppc64el] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main universe
201-
# deb [arch=ppc64el] http://ports.ubuntu.com/ubuntu-ports/ noble-security main universe
202-
# deb [arch=ppc64el] http://ports.ubuntu.com/ubuntu-ports/ noble-backports main universe
203-
# EOF
204-
205-
# sudo apt-get update || true ;# Prevent failure due to missing URLs.
206-
207-
# sudo apt-get install -y --no-install-recommends \
208-
# build-essential \
209-
# glslc \
210-
# gcc-14-powerpc64le-linux-gnu \
211-
# g++-14-powerpc64le-linux-gnu \
212-
# libvulkan-dev:ppc64el
213-
214-
# - name: Build
215-
# run: |
216-
# cmake -B build -DLLAMA_CURL=OFF \
217-
# -DCMAKE_BUILD_TYPE=Release \
218-
# -DGGML_VULKAN=ON \
219-
# -DGGML_OPENMP=OFF \
220-
# -DLLAMA_BUILD_EXAMPLES=ON \
221-
# -DLLAMA_BUILD_TOOLS=ON \
222-
# -DLLAMA_BUILD_TESTS=OFF \
223-
# -DCMAKE_SYSTEM_NAME=Linux \
224-
# -DCMAKE_SYSTEM_PROCESSOR=ppc64 \
225-
# -DCMAKE_C_COMPILER=powerpc64le-linux-gnu-gcc-14 \
226-
# -DCMAKE_CXX_COMPILER=powerpc64le-linux-gnu-g++-14 \
227-
# -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
228-
# -DCMAKE_FIND_ROOT_PATH=/usr/lib/powerpc64le-linux-gnu \
229-
# -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
230-
# -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
231-
# -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
232-
233-
# cmake --build build --config Release -j $(nproc)
234-
235144
debian-13-loongarch64-cpu-cross:
236145
runs-on: ubuntu-24.04
237146
container: debian@sha256:653dfb9f86c3782e8369d5f7d29bb8faba1f4bff9025db46e807fa4c22903671

.github/workflows/build.yml

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ jobs:
192192
os: ubuntu-22.04
193193
- build: 'arm64'
194194
os: ubuntu-22.04-arm
195+
- build: 's390x'
196+
os: ubuntu-24.04-s390x
197+
- build: 'ppc64le'
198+
os: ubuntu-24.04-ppc64le
195199

196200
runs-on: ${{ matrix.os }}
197201

@@ -206,11 +210,28 @@ jobs:
206210
key: ubuntu-cpu-cmake
207211
evict-old-files: 1d
208212

209-
- name: Dependencies
210-
id: depends
213+
- name: Build Dependencies
214+
id: build_depends
211215
run: |
212216
sudo apt-get update
213-
sudo apt-get install build-essential libcurl4-openssl-dev
217+
sudo apt-get install -y --no-install-recommends \
218+
python3 python3-pip python3-dev \
219+
libjpeg-dev build-essential libcurl4-openssl-dev \
220+
git-lfs
221+
222+
- name: Python Dependencies
223+
id: python_depends
224+
run: |
225+
python3 -m pip install --upgrade pip
226+
pip3 install ./gguf-py
227+
228+
- name: Swap Endianness
229+
id: endianness
230+
if: ${{ matrix.build == 's390x' }}
231+
run: |
232+
for f in models/*.gguf; do
233+
echo YES | python3 gguf-py/gguf/scripts/gguf_convert_endian.py $f big
234+
done
214235
215236
- name: Build
216237
id: cmake_build
@@ -228,6 +249,7 @@ jobs:
228249
229250
- name: Test llama2c conversion
230251
id: llama2c_test
252+
if: ${{ matrix.build != 's390x' }}
231253
run: |
232254
cd build
233255
echo "Fetch tokenizer"
@@ -237,6 +259,15 @@ jobs:
237259
./bin/llama-convert-llama2c-to-ggml --copy-vocab-from-model ./tok512.bin --llama2c-model stories260K.bin --llama2c-output-model stories260K.gguf
238260
./bin/llama-cli -m stories260K.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256
239261
262+
- name: Test llama2c (s390x)
263+
id: llama2c_test_s390x
264+
if: ${{ matrix.build == 's390x' }}
265+
run: |
266+
cd build
267+
echo "Fetch llama2c big-endian model"
268+
wget https://huggingface.co/ggml-org/models/resolve/main/tinyllamas/stories260K-be.gguf
269+
./bin/llama-cli -m stories260K-be.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256
270+
240271
ubuntu-latest-cmake-sanitizer:
241272
runs-on: ubuntu-latest
242273

@@ -475,7 +506,7 @@ jobs:
475506
476507
ubuntu-22-cmake-musa:
477508
runs-on: ubuntu-22.04
478-
container: mthreads/musa:rc4.2.0-devel-ubuntu22.04-amd64
509+
container: mthreads/musa:rc4.3.0-devel-ubuntu22.04-amd64
479510

480511
steps:
481512
- name: Clone

.github/workflows/docker.yml

Lines changed: 44 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
push_to_registry:
2929
name: Push Docker image to Docker Hub
3030

31-
runs-on: ubuntu-22.04
31+
runs-on: ${{ matrix.config.runs_on }}
3232
env:
3333
COMMIT_SHA: ${{ github.sha }}
3434
strategy:
@@ -39,12 +39,12 @@ jobs:
3939
# Note: the arm64 images are failing, which prevents the amd64 images from being built
4040
# https://github.com/ggml-org/llama.cpp/issues/11888
4141
#- { tag: "cpu", dockerfile: ".devops/cpu.Dockerfile", platforms: "linux/amd64,linux/arm64", full: true, light: true, server: true, free_disk_space: false }
42-
- { tag: "cpu", dockerfile: ".devops/cpu.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: false }
43-
- { tag: "cuda", dockerfile: ".devops/cuda.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: false }
44-
- { tag: "musa", dockerfile: ".devops/musa.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: true }
45-
- { tag: "intel", dockerfile: ".devops/intel.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: true }
46-
- { tag: "vulkan", dockerfile: ".devops/vulkan.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: false }
47-
- { tag: "s390x", dockerfile: ".devops/s390x.Dockerfile", platforms: "linux/s390x", full: true, light: true, server: true, free_disk_space: false }
42+
- { tag: "cpu", dockerfile: ".devops/cpu.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: false, runs_on: "ubuntu-22.04" }
43+
- { tag: "cuda", dockerfile: ".devops/cuda.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: false, runs_on: "ubuntu-22.04" }
44+
- { tag: "musa", dockerfile: ".devops/musa.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: true, runs_on: "ubuntu-22.04" }
45+
- { tag: "intel", dockerfile: ".devops/intel.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: true, runs_on: "ubuntu-22.04" }
46+
- { tag: "vulkan", dockerfile: ".devops/vulkan.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: false, runs_on: "ubuntu-22.04" }
47+
- { tag: "s390x", dockerfile: ".devops/s390x.Dockerfile", platforms: "linux/s390x", full: true, light: true, server: true, free_disk_space: false, runs_on: "ubuntu-22.04-s390x" }
4848
# Note: the rocm images are failing due to a compiler error and are disabled until this is fixed to allow the workflow to complete
4949
#- {tag: "rocm", dockerfile: ".devops/rocm.Dockerfile", platforms: "linux/amd64,linux/arm64", full: true, light: true, server: true, free_disk_space: true }
5050
steps:
@@ -54,6 +54,7 @@ jobs:
5454
fetch-depth: 0 # preserve git history, so we can determine the build number
5555

5656
- name: Set up QEMU
57+
if: ${{ matrix.config.tag != 's390x' }}
5758
uses: docker/setup-qemu-action@v3
5859
with:
5960
image: tonistiigi/binfmt:qemu-v7.0.0-28
@@ -68,40 +69,36 @@ jobs:
6869
username: ${{ github.repository_owner }}
6970
password: ${{ secrets.GITHUB_TOKEN }}
7071

71-
- name: Determine tag name
72+
- name: Determine source tag name
73+
id: srctag
74+
uses: ./.github/actions/get-tag-name
75+
env:
76+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
77+
78+
- name: Determine image tag name
7279
id: tag
7380
shell: bash
7481
run: |
75-
BUILD_NUMBER="$(git rev-list --count HEAD)"
76-
SHORT_HASH="$(git rev-parse --short=7 HEAD)"
7782
REPO_OWNER="${GITHUB_REPOSITORY_OWNER@L}" # to lower case
7883
REPO_NAME="${{ github.event.repository.name }}"
7984
80-
# determine tag name postfix (build number, commit hash)
81-
if [[ "${{ env.GITHUB_BRANCH_NAME }}" == "master" ]]; then
82-
TAG_POSTFIX="-b${BUILD_NUMBER}"
83-
else
84-
SAFE_NAME=$(echo "${{ env.GITHUB_BRANCH_NAME }}" | tr '/' '-')
85-
TAG_POSTFIX="-${SAFE_NAME}-${SHORT_HASH}"
86-
fi
8785
# list all tags possible
8886
if [[ "${{ matrix.config.tag }}" == "cpu" ]]; then
8987
TYPE=""
9088
else
9189
TYPE="-${{ matrix.config.tag }}"
9290
fi
9391
PREFIX="ghcr.io/${REPO_OWNER}/${REPO_NAME}:"
94-
FULLTAGS="${PREFIX}full${TYPE},${PREFIX}full${TYPE}${TAG_POSTFIX}"
95-
LIGHTTAGS="${PREFIX}light${TYPE},${PREFIX}light${TYPE}${TAG_POSTFIX}"
96-
SERVERTAGS="${PREFIX}server${TYPE},${PREFIX}server${TYPE}${TAG_POSTFIX}"
92+
FULLTAGS="${PREFIX}full${TYPE},${PREFIX}full${TYPE}-${{ steps.srctag.outputs.name }}"
93+
LIGHTTAGS="${PREFIX}light${TYPE},${PREFIX}light${TYPE}-${{ steps.srctag.outputs.name }}"
94+
SERVERTAGS="${PREFIX}server${TYPE},${PREFIX}server${TYPE}-${{ steps.srctag.outputs.name }}"
9795
echo "full_output_tags=$FULLTAGS" >> $GITHUB_OUTPUT
9896
echo "light_output_tags=$LIGHTTAGS" >> $GITHUB_OUTPUT
9997
echo "server_output_tags=$SERVERTAGS" >> $GITHUB_OUTPUT
10098
echo "full_output_tags=$FULLTAGS" # print out for debugging
10199
echo "light_output_tags=$LIGHTTAGS" # print out for debugging
102100
echo "server_output_tags=$SERVERTAGS" # print out for debugging
103101
env:
104-
GITHUB_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
105102
GITHUB_REPOSITORY_OWNER: '${{ github.repository_owner }}'
106103

107104
- name: Free Disk Space (Ubuntu)
@@ -177,3 +174,29 @@ jobs:
177174
# return to this if the experimental github cache is having issues
178175
#cache-to: type=local,dest=/tmp/.buildx-cache
179176
#cache-from: type=local,src=/tmp/.buildx-cache
177+
178+
create_tag:
179+
name: Create and push git tag
180+
runs-on: ubuntu-22.04
181+
permissions:
182+
contents: write
183+
184+
steps:
185+
- name: Clone
186+
id: checkout
187+
uses: actions/checkout@v4
188+
with:
189+
fetch-depth: 0
190+
191+
- name: Determine source tag name
192+
id: srctag
193+
uses: ./.github/actions/get-tag-name
194+
env:
195+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
196+
197+
- name: Create and push git tag
198+
env:
199+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
200+
run: |
201+
git tag ${{ steps.srctag.outputs.name }} || exit 0
202+
git push origin ${{ steps.srctag.outputs.name }} || exit 0

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,6 @@ poetry.toml
149149
/run-chat.sh
150150
.ccache/
151151

152-
# Code Workspace
152+
# IDE
153153
*.code-workspace
154-
154+
.windsurf/

.windsurf/rules/css-architecture.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.windsurf/rules/sveltekit-architecture.md

Lines changed: 0 additions & 48 deletions
This file was deleted.

.windsurf/rules/tests.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

.windsurf/rules/typescript-architecture.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ option(LLAMA_TOOLS_INSTALL "llama: install tools" ${LLAMA_TOOLS_INSTALL_
9292

9393
# 3rd party libs
9494
option(LLAMA_CURL "llama: use libcurl to download model from an URL" ON)
95+
option(LLAMA_OPENSSL "llama: use openssl to support HTTPS" OFF)
9596
option(LLAMA_LLGUIDANCE "llama-common: include LLGuidance library for structured output in common utils" OFF)
9697

9798
# Required for relocatable CMake package

0 commit comments

Comments
 (0)