Skip to content

Commit fe686a4

Browse files
Merge pull request #263 from menloresearch/update-dev-from-master-2025-09-27-00-32
Sync master with upstream release b6602
2 parents c8139c2 + 72b24d9 commit fe686a4

Some content is hidden

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

64 files changed

+3824
-1594
lines changed

.devops/musa.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
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
5-
ARG BASE_MUSA_DEV_CONTAINER=mthreads/musa:${MUSA_VERSION}-devel-ubuntu${UBUNTU_VERSION}-amd64
5+
ARG BASE_MUSA_DEV_CONTAINER=sh-harbor.mthreads.com/haive/mthreads/musa:${MUSA_VERSION}-devel-ubuntu${UBUNTU_VERSION}-amd64
66

7-
ARG BASE_MUSA_RUN_CONTAINER=mthreads/musa:${MUSA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}-amd64
7+
ARG BASE_MUSA_RUN_CONTAINER=sh-harbor.mthreads.com/haive/mthreads/musa:${MUSA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}-amd64
88

99
FROM ${BASE_MUSA_DEV_CONTAINER} AS build
1010

.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: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,40 +68,36 @@ jobs:
6868
username: ${{ github.repository_owner }}
6969
password: ${{ secrets.GITHUB_TOKEN }}
7070

71-
- name: Determine tag name
71+
- name: Determine source tag name
72+
id: srctag
73+
uses: ./.github/actions/get-tag-name
74+
env:
75+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
76+
77+
- name: Determine image tag name
7278
id: tag
7379
shell: bash
7480
run: |
75-
BUILD_NUMBER="$(git rev-list --count HEAD)"
76-
SHORT_HASH="$(git rev-parse --short=7 HEAD)"
7781
REPO_OWNER="${GITHUB_REPOSITORY_OWNER@L}" # to lower case
7882
REPO_NAME="${{ github.event.repository.name }}"
7983
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
8784
# list all tags possible
8885
if [[ "${{ matrix.config.tag }}" == "cpu" ]]; then
8986
TYPE=""
9087
else
9188
TYPE="-${{ matrix.config.tag }}"
9289
fi
9390
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}"
91+
FULLTAGS="${PREFIX}full${TYPE},${PREFIX}full${TYPE}-${{ steps.srctag.outputs.name }}"
92+
LIGHTTAGS="${PREFIX}light${TYPE},${PREFIX}light${TYPE}-${{ steps.srctag.outputs.name }}"
93+
SERVERTAGS="${PREFIX}server${TYPE},${PREFIX}server${TYPE}-${{ steps.srctag.outputs.name }}"
9794
echo "full_output_tags=$FULLTAGS" >> $GITHUB_OUTPUT
9895
echo "light_output_tags=$LIGHTTAGS" >> $GITHUB_OUTPUT
9996
echo "server_output_tags=$SERVERTAGS" >> $GITHUB_OUTPUT
10097
echo "full_output_tags=$FULLTAGS" # print out for debugging
10198
echo "light_output_tags=$LIGHTTAGS" # print out for debugging
10299
echo "server_output_tags=$SERVERTAGS" # print out for debugging
103100
env:
104-
GITHUB_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
105101
GITHUB_REPOSITORY_OWNER: '${{ github.repository_owner }}'
106102

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

CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
/ggml/src/ggml-metal/ @ggerganov
6262
/ggml/src/ggml-opt.cpp @JohannesGaessler
6363
/ggml/src/ggml-quants.* @ggerganov
64+
/ggml/src/ggml-rpc/ @rgerganov
6465
/ggml/src/ggml-threading.* @ggerganov @slaren
6566
/ggml/src/ggml-vulkan/ @0cc4m
6667
/ggml/src/ggml-zdnn/ @taronaeo @Andreas-Krebbel @AlekseiNikiforovIBM
@@ -89,6 +90,7 @@
8990
/tools/mtmd/ @ngxson
9091
/tools/perplexity/ @ggerganov
9192
/tools/quantize/ @ggerganov
93+
/tools/rpc/ @rgerganov
9294
/tools/run/ @ericcurtin
9395
/tools/server/* @ngxson @ggerganov @ericcurtin # no subdir
9496
/tools/server/webui/ @allozaur
@@ -103,4 +105,5 @@
103105
/LICENSE @ggerganov
104106
/README.md @ggerganov
105107
/SECURITY.md @ggerganov
108+
/build-xcframework.sh @danbev
106109
requirements*.txt @CISC

0 commit comments

Comments
 (0)