Skip to content

Commit 2039f2e

Browse files
authored
Merge branch 'ggml-org:master' into mradermacher
2 parents 08ec71a + e74c92e commit 2039f2e

File tree

223 files changed

+9216
-3236
lines changed

Some content is hidden

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

223 files changed

+9216
-3236
lines changed

.devops/musa.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ ARG UBUNTU_VERSION=22.04
22
# This needs to generally match the container host's environment.
33
ARG MUSA_VERSION=rc4.3.0
44
# Target the MUSA build image
5-
ARG BASE_MUSA_DEV_CONTAINER=sh-harbor.mthreads.com/haive/mthreads/musa:${MUSA_VERSION}-devel-ubuntu${UBUNTU_VERSION}-amd64
5+
ARG BASE_MUSA_DEV_CONTAINER=mthreads/musa:${MUSA_VERSION}-devel-ubuntu${UBUNTU_VERSION}-amd64
66

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

99
FROM ${BASE_MUSA_DEV_CONTAINER} AS build
1010

.github/workflows/build-amd.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI (AMD)
2+
3+
on:
4+
workflow_dispatch: # allows manual triggering
5+
push:
6+
branches:
7+
- master
8+
paths: [
9+
'.github/workflows/build-amd.yml',
10+
'**/CMakeLists.txt',
11+
'**/.cmake',
12+
'**/*.h',
13+
'**/*.hpp',
14+
'**/*.c',
15+
'**/*.cpp',
16+
'**/*.cu',
17+
'**/*.cuh',
18+
'**/*.comp'
19+
]
20+
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
ggml-ci-x64-amd-vulkan:
27+
runs-on: [self-hosted, Linux, X64, AMD]
28+
29+
steps:
30+
- name: Clone
31+
id: checkout
32+
uses: actions/checkout@v4
33+
34+
- name: Test
35+
id: ggml-ci
36+
run: |
37+
vulkaninfo --summary
38+
GG_BUILD_VULKAN=1 bash ./ci/run.sh ~/results/llama.cpp /mnt/llama.cpp
39+
40+
ggml-ci-x64-amd-rocm:
41+
runs-on: [self-hosted, Linux, X64, AMD]
42+
43+
steps:
44+
- name: Clone
45+
id: checkout
46+
uses: actions/checkout@v4
47+
48+
- name: Test
49+
id: ggml-ci
50+
run: |
51+
amd-smi static
52+
GG_BUILD_ROCM=1 GG_BUILD_AMDGPU_TARGETS="gfx1101" bash ./ci/run.sh ~/results/llama.cpp /mnt/llama.cpp

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

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,3 +253,47 @@ jobs:
253253
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
254254
255255
cmake --build build --config Release -j $(nproc)
256+
257+
ubuntu-24-riscv64-cpu-spacemit-ime-cross:
258+
runs-on: ubuntu-24.04
259+
260+
env:
261+
SPACEMIT_IME_TOOLCHAIN_VERSION: "1.1.2"
262+
SPACEMIT_IME_TOOLCHAIN_PATH: "spacemit-toolchain-linux-glibc-x86_64"
263+
264+
steps:
265+
- uses: actions/checkout@v4
266+
267+
- name: Cache Toolchain
268+
uses: actions/cache@v4
269+
id: cache-spacemit-ime-cross-toolchain
270+
with:
271+
path: ./${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}
272+
key: ${{ runner.os }}-spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}
273+
274+
- name: Setup Toolchain
275+
if: steps.cache-spacemit-ime-cross-toolchain.outputs.cache-hit != 'true'
276+
run: |
277+
wget --quiet --no-check-certificate https://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}.tar.xz -O ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}.tar.xz
278+
rm -rf ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}
279+
mkdir -p ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}
280+
tar xf ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}.tar.xz -C ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }} --strip-components=1
281+
rm -rf ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}.tar.xz
282+
283+
- name: Build
284+
run: |
285+
export RISCV_ROOT_PATH=${PWD}/${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}
286+
cmake -B build -DLLAMA_CURL=OFF \
287+
-DCMAKE_BUILD_TYPE=Release \
288+
-DGGML_OPENMP=OFF \
289+
-DLLAMA_BUILD_EXAMPLES=ON \
290+
-DLLAMA_BUILD_TOOLS=ON \
291+
-DLLAMA_BUILD_TESTS=OFF \
292+
-DGGML_CPU_RISCV64_SPACEMIT=ON \
293+
-DGGML_RVV=ON \
294+
-DGGML_RV_ZFH=ON \
295+
-DGGML_RV_ZICBOP=ON \
296+
-DRISCV64_SPACEMIT_IME_SPEC=RISCV64_SPACEMIT_IME1 \
297+
-DCMAKE_TOOLCHAIN_FILE=${PWD}/cmake/riscv64-spacemit-linux-gnu-gcc.cmake
298+
299+
cmake --build build --config Release -j $(nproc)

.github/workflows/build-riscv-native.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,63 @@ jobs:
5858
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
5959
6060
cmake --build build --config Release -j $(nproc)
61+
62+
# debian-13-riscv64-spacemit-ime-native: # Bianbu 2.2
63+
# runs-on: [self-hosted, RISCV64]
64+
65+
# steps:
66+
# - name: Install prerequisites
67+
# run: |
68+
# sudo apt-get update || true
69+
# sudo apt-get install -y libatomic1
70+
# - uses: actions/checkout@v4
71+
# - name: Setup Riscv
72+
# run: |
73+
# sudo apt-get update || true
74+
# sudo apt-get install -y --no-install-recommends \
75+
# build-essential \
76+
# gcc-14-riscv64-linux-gnu \
77+
# g++-14-riscv64-linux-gnu \
78+
# ccache \
79+
# cmake
80+
# sudo apt-get upgrade binutils -y
81+
82+
# - name: Setup ccache
83+
# run: |
84+
# mkdir -p $HOME/.ccache
85+
# ccache -M 5G -d $HOME/.ccache
86+
# export CCACHE_LOGFILE=/home/runneruser/ccache_debug/ccache.log
87+
# export CCACHE_DEBUGDIR="/home/runneruser/ccache_debug"
88+
# echo "$GITHUB_WORKSPACE"
89+
# echo "CCACHE_LOGFILE=$CCACHE_LOGFILE" >> $GITHUB_ENV
90+
# echo "CCACHE_DEBUGDIR=$CCACHE_DEBUGDIR" >> $GITHUB_ENV
91+
# echo "CCACHE_BASEDIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV
92+
# echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV
93+
94+
# - name: Build
95+
# run: |
96+
# cmake -B build \
97+
# -DLLAMA_CURL=OFF \
98+
# -DCMAKE_BUILD_TYPE=Release \
99+
# -DGGML_OPENMP=OFF \
100+
# -DLLAMA_BUILD_EXAMPLES=ON \
101+
# -DLLAMA_BUILD_TOOLS=ON \
102+
# -DLLAMA_BUILD_TESTS=OFF \
103+
# -DCMAKE_SYSTEM_NAME=Linux \
104+
# -DCMAKE_SYSTEM_PROCESSOR=riscv64 \
105+
# -DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc-14 \
106+
# -DCMAKE_CXX_COMPILER=riscv64-linux-gnu-g++-14 \
107+
# -DCMAKE_C_COMPILER_LAUNCHER=ccache \
108+
# -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
109+
# -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
110+
# -DCMAKE_FIND_ROOT_PATH=/usr/lib/riscv64-linux-gnu \
111+
# -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
112+
# -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
113+
# -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH \
114+
# -DGGML_RVV=ON \
115+
# -DGGML_RV_ZFH=ON \
116+
# -DGGML_RV_ZICBOP=ON \
117+
# -DGGML_CPU_RISCV64_SPACEMIT=ON \
118+
# -DRISCV64_SPACEMIT_IME_SPEC=RISCV64_SPACEMIT_IME1
119+
120+
# cmake --build build --config Release -j $(nproc)

.github/workflows/build.yml

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ jobs:
207207
- name: ccache
208208
uses: ggml-org/[email protected]
209209
with:
210-
key: ubuntu-cpu-cmake
210+
key: ubuntu-cpu-cmake-${{ matrix.build }}
211211
evict-old-files: 1d
212212

213213
- name: Build Dependencies
@@ -1222,11 +1222,12 @@ jobs:
12221222
- name: Clone
12231223
uses: actions/checkout@v4
12241224

1225-
- name: ccache
1226-
uses: ggml-org/[email protected]
1227-
with:
1228-
key: android-build
1229-
evict-old-files: 1d
1225+
# Disabled due to size (400MB) and always 0 cache hits
1226+
# - name: ccache
1227+
# uses: ggml-org/[email protected]
1228+
# with:
1229+
# key: android-build
1230+
# evict-old-files: 1d
12301231

12311232
- name: Set up JDK
12321233
uses: actions/setup-java@v3
@@ -1461,34 +1462,6 @@ jobs:
14611462
run: |
14621463
bash ./ci/run.sh ~/results/llama.cpp /mnt/llama.cpp
14631464
1464-
# ggml-ci-x64-amd-vulkan:
1465-
# runs-on: [self-hosted, Linux, X64, AMD]
1466-
#
1467-
# steps:
1468-
# - name: Clone
1469-
# id: checkout
1470-
# uses: actions/checkout@v4
1471-
#
1472-
# - name: Test
1473-
# id: ggml-ci
1474-
# run: |
1475-
# vulkaninfo --summary
1476-
# GG_BUILD_VULKAN=1 bash ./ci/run.sh ~/results/llama.cpp /mnt/llama.cpp
1477-
#
1478-
# ggml-ci-x64-amd-rocm:
1479-
# runs-on: [self-hosted, Linux, X64, AMD]
1480-
#
1481-
# steps:
1482-
# - name: Clone
1483-
# id: checkout
1484-
# uses: actions/checkout@v4
1485-
#
1486-
# - name: Test
1487-
# id: ggml-ci
1488-
# run: |
1489-
# amd-smi static
1490-
# GG_BUILD_ROCM=1 GG_BUILD_AMDGPU_TARGETS="gfx1101" bash ./ci/run.sh ~/results/llama.cpp /mnt/llama.cpp
1491-
14921465
ggml-ci-mac-metal:
14931466
runs-on: [self-hosted, macOS, ARM64]
14941467

.github/workflows/docker.yml

Lines changed: 8 additions & 7 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

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ jobs:
150150
- name: ccache
151151
uses: ggml-org/[email protected]
152152
with:
153-
key: ubuntu-cpu-cmake
153+
key: ubuntu-cpu-cmake-${{ matrix.build }}
154154
evict-old-files: 1d
155155

156156
- name: Dependencies

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +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 download model from an URL" ON)
95+
option(LLAMA_OPENSSL "llama: use openssl to support HTTPS" OFF)
9696
option(LLAMA_LLGUIDANCE "llama-common: include LLGuidance library for structured output in common utils" OFF)
9797

9898
# Required for relocatable CMake package

CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
/ggml/src/ggml-blas/ @slaren
5151
/ggml/src/ggml-common.h @ggerganov @slaren
5252
/ggml/src/ggml-cpu/ @ggerganov @slaren
53+
/ggml/src/ggml-cpu/spacemit/ @alex-spacemit
5354
/ggml/src/ggml-cuda/common.cuh @slaren
5455
/ggml/src/ggml-cuda/fattn* @JohannesGaessler
5556
/ggml/src/ggml-cuda/ggml-cuda.cu @slaren
@@ -59,6 +60,7 @@
5960
/ggml/src/ggml-cuda/mmvq.* @JohannesGaessler
6061
/ggml/src/ggml-impl.h @ggerganov @slaren
6162
/ggml/src/ggml-metal/ @ggerganov
63+
/ggml/src/ggml-opencl/ @lhez @max-krasnyansky
6264
/ggml/src/ggml-opt.cpp @JohannesGaessler
6365
/ggml/src/ggml-quants.* @ggerganov
6466
/ggml/src/ggml-rpc/ @rgerganov

ci/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ if [ ! -z ${GG_BUILD_NO_SVE} ]; then
114114
# arm 9 and newer enables sve by default, adjust these flags depending on the cpu used
115115
CMAKE_EXTRA="${CMAKE_EXTRA} -DGGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=armv8.5-a+fp16+i8mm"
116116
fi
117+
117118
## helpers
118119

119120
# download a file if it does not exist or if it is outdated

0 commit comments

Comments
 (0)