Skip to content

Commit 6296b9d

Browse files
authored
Merge branch 'ggml-org:master' into move-page-cache
2 parents 57631b9 + 8a2afb7 commit 6296b9d

File tree

266 files changed

+113349
-10370
lines changed

Some content is hidden

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

266 files changed

+113349
-10370
lines changed

.devops/intel.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG ONEAPI_VERSION=2025.0.0-0-devel-ubuntu22.04
1+
ARG ONEAPI_VERSION=2025.1.1-0-devel-ubuntu24.04
22

33
## Build Image
44

.devops/musa.Dockerfile

Lines changed: 4 additions & 11 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=rc3.1.1
3+
ARG MUSA_VERSION=rc4.0.1
44
# Target the MUSA build image
5-
ARG BASE_MUSA_DEV_CONTAINER=mthreads/musa:${MUSA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
5+
ARG BASE_MUSA_DEV_CONTAINER=mthreads/musa:${MUSA_VERSION}-mudnn-devel-ubuntu${UBUNTU_VERSION}
66

7-
ARG BASE_MUSA_RUN_CONTAINER=mthreads/musa:${MUSA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}
7+
ARG BASE_MUSA_RUN_CONTAINER=mthreads/musa:${MUSA_VERSION}-mudnn-runtime-ubuntu${UBUNTU_VERSION}
88

99
FROM ${BASE_MUSA_DEV_CONTAINER} AS build
1010

@@ -21,21 +21,14 @@ RUN apt-get update && \
2121
libcurl4-openssl-dev \
2222
libgomp1
2323

24-
COPY requirements.txt requirements.txt
25-
COPY requirements requirements
26-
27-
RUN pip install --upgrade pip setuptools wheel \
28-
&& pip install -r requirements.txt
29-
3024
WORKDIR /app
3125

3226
COPY . .
3327

34-
# Use the default MUSA archs if not specified
3528
RUN if [ "${MUSA_DOCKER_ARCH}" != "default" ]; then \
3629
export CMAKE_ARGS="-DMUSA_ARCHITECTURES=${MUSA_DOCKER_ARCH}"; \
3730
fi && \
38-
cmake -B build -DGGML_NATIVE=OFF -DGGML_MUSA=ON -DLLAMA_BUILD_TESTS=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
31+
cmake -B build -DGGML_NATIVE=OFF -DGGML_MUSA=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DLLAMA_BUILD_TESTS=OFF ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
3932
cmake --build build --config Release -j$(nproc)
4033

4134
RUN mkdir -p /app/lib && \

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,7 @@ end_of_line = unset
4848
charset = unset
4949
trim_trailing_whitespace = unset
5050
insert_final_newline = unset
51+
52+
[tools/mtmd/miniaudio.h]
53+
trim_trailing_whitespace = unset
54+
insert_final_newline = unset
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Determine tag name"
2+
description: "Determine the tag name to use for a release"
3+
outputs:
4+
name:
5+
description: "The name of the tag"
6+
value: ${{ steps.tag.outputs.name }}
7+
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Determine tag name
12+
id: tag
13+
shell: bash
14+
run: |
15+
BUILD_NUMBER="$(git rev-list --count HEAD)"
16+
SHORT_HASH="$(git rev-parse --short=7 HEAD)"
17+
if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
18+
echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
19+
else
20+
SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
21+
echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
22+
fi
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: "Windows - Setup CUDA Toolkit"
2+
description: "Setup CUDA Toolkit for Windows"
3+
inputs:
4+
cuda_version:
5+
description: "CUDA toolkit version"
6+
required: true
7+
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Install Cuda Toolkit 11.7
12+
if: ${{ inputs.cuda_version == '11.7' }}
13+
shell: pwsh
14+
run: |
15+
mkdir -p "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7"
16+
choco install unzip -y
17+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cudart/windows-x86_64/cuda_cudart-windows-x86_64-11.7.99-archive.zip"
18+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvcc/windows-x86_64/cuda_nvcc-windows-x86_64-11.7.99-archive.zip"
19+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvrtc/windows-x86_64/cuda_nvrtc-windows-x86_64-11.7.99-archive.zip"
20+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/libcublas/windows-x86_64/libcublas-windows-x86_64-11.7.4.6-archive.zip"
21+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvtx/windows-x86_64/cuda_nvtx-windows-x86_64-11.7.91-archive.zip"
22+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/visual_studio_integration/windows-x86_64/visual_studio_integration-windows-x86_64-11.7.91-archive.zip"
23+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvprof/windows-x86_64/cuda_nvprof-windows-x86_64-11.7.101-archive.zip"
24+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cccl/windows-x86_64/cuda_cccl-windows-x86_64-11.7.91-archive.zip"
25+
unzip '*.zip' -d "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7"
26+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_cudart-windows-x86_64-11.7.99-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
27+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_nvcc-windows-x86_64-11.7.99-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
28+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_nvrtc-windows-x86_64-11.7.99-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
29+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\libcublas-windows-x86_64-11.7.4.6-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
30+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_nvtx-windows-x86_64-11.7.91-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
31+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\visual_studio_integration-windows-x86_64-11.7.91-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
32+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_nvprof-windows-x86_64-11.7.101-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
33+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_cccl-windows-x86_64-11.7.91-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
34+
echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
35+
echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\libnvvp" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
36+
echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
37+
echo "CUDA_PATH_V11_7=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
38+
39+
- name: Install Cuda Toolkit 12.4
40+
if: ${{ inputs.cuda_version == '12.4' }}
41+
shell: pwsh
42+
run: |
43+
mkdir -p "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4"
44+
choco install unzip -y
45+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cudart/windows-x86_64/cuda_cudart-windows-x86_64-12.4.127-archive.zip"
46+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvcc/windows-x86_64/cuda_nvcc-windows-x86_64-12.4.131-archive.zip"
47+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvrtc/windows-x86_64/cuda_nvrtc-windows-x86_64-12.4.127-archive.zip"
48+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/libcublas/windows-x86_64/libcublas-windows-x86_64-12.4.5.8-archive.zip"
49+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvtx/windows-x86_64/cuda_nvtx-windows-x86_64-12.4.127-archive.zip"
50+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_profiler_api/windows-x86_64/cuda_profiler_api-windows-x86_64-12.4.127-archive.zip"
51+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/visual_studio_integration/windows-x86_64/visual_studio_integration-windows-x86_64-12.4.127-archive.zip"
52+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvprof/windows-x86_64/cuda_nvprof-windows-x86_64-12.4.127-archive.zip"
53+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cccl/windows-x86_64/cuda_cccl-windows-x86_64-12.4.127-archive.zip"
54+
unzip '*.zip' -d "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4"
55+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_cudart-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
56+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvcc-windows-x86_64-12.4.131-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
57+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvrtc-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
58+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\libcublas-windows-x86_64-12.4.5.8-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
59+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvtx-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
60+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_profiler_api-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
61+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\visual_studio_integration-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
62+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvprof-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
63+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_cccl-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
64+
echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
65+
echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\libnvvp" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
66+
echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
67+
echo "CUDA_PATH_V12_4=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8

.github/actions/windows-setup-curl/action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ inputs:
55
description: 'CURL version'
66
required: false
77
default: '8.6.0_6'
8+
architecture:
9+
description: 'Architecture of the libcurl to download'
10+
required: false
11+
default: 'win64'
812
outputs:
913
curl_path:
1014
description: "Path to the downloaded libcurl"
@@ -18,8 +22,9 @@ runs:
1822
shell: powershell
1923
env:
2024
CURL_VERSION: ${{ inputs.curl_version }}
25+
ARCHITECTURE: ${{ inputs.architecture }}
2126
run: |
22-
curl.exe -o $env:RUNNER_TEMP/curl.zip -L "https://curl.se/windows/dl-${env:CURL_VERSION}/curl-${env:CURL_VERSION}-win64-mingw.zip"
27+
curl.exe -o $env:RUNNER_TEMP/curl.zip -L "https://curl.se/windows/dl-${env:CURL_VERSION}/curl-${env:CURL_VERSION}-${env:ARCHITECTURE}-mingw.zip"
2328
mkdir $env:RUNNER_TEMP/libcurl
2429
tar.exe -xvf $env:RUNNER_TEMP/curl.zip --strip-components=1 -C $env:RUNNER_TEMP/libcurl
2530
echo "curl_path=$env:RUNNER_TEMP/libcurl" >> $env:GITHUB_OUTPUT

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

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,94 @@ jobs:
140140
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH
141141
142142
cmake --build build --config Release -j $(nproc)
143+
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+
libcurl4-openssl-dev:ppc64el
168+
169+
- name: Build
170+
run: |
171+
cmake -B build -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+
libcurl4-openssl-dev:ppc64el
214+
215+
- name: Build
216+
run: |
217+
cmake -B build -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)

0 commit comments

Comments
 (0)