Skip to content

Commit ba17f62

Browse files
authored
Merge branch 'master' into amd-integration
2 parents aa35feb + cb9178f commit ba17f62

File tree

325 files changed

+22958
-14422
lines changed

Some content is hidden

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

325 files changed

+22958
-14422
lines changed

.devops/intel.Dockerfile

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,23 @@ COPY --from=build /app/full /app
4949

5050
WORKDIR /app
5151

52-
RUN apt-get update \
53-
&& apt-get install -y \
54-
git \
55-
python3 \
56-
python3-pip \
57-
&& pip install --upgrade pip setuptools wheel \
58-
&& pip install -r requirements.txt \
59-
&& apt autoremove -y \
60-
&& apt clean -y \
61-
&& rm -rf /tmp/* /var/tmp/* \
62-
&& find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete \
63-
&& find /var/cache -type f -delete
64-
52+
RUN apt-get update && \
53+
apt-get install -y \
54+
git \
55+
python3 \
56+
python3-pip \
57+
python3-venv && \
58+
python3 -m venv /opt/venv && \
59+
. /opt/venv/bin/activate && \
60+
pip install --upgrade pip setuptools wheel && \
61+
pip install -r requirements.txt && \
62+
apt autoremove -y && \
63+
apt clean -y && \
64+
rm -rf /tmp/* /var/tmp/* && \
65+
find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete && \
66+
find /var/cache -type f -delete
67+
68+
ENV PATH="/opt/venv/bin:$PATH"
6569

6670
ENTRYPOINT ["/app/tools.sh"]
6771

.devops/tools.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
set -e
33

44
# Read the first argument into a variable

.github/ISSUE_TEMPLATE/010-bug-compilation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ body:
4040
attributes:
4141
label: GGML backends
4242
description: Which GGML backends do you know to be affected?
43-
options: [AMX, BLAS, CPU, CUDA, HIP, Kompute, Metal, Musa, RPC, SYCL, Vulkan]
43+
options: [AMX, BLAS, CPU, CUDA, HIP, Metal, Musa, RPC, SYCL, Vulkan, OpenCL]
4444
multiple: true
4545
validations:
4646
required: true

.github/ISSUE_TEMPLATE/011-bug-results.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ body:
4242
attributes:
4343
label: GGML backends
4444
description: Which GGML backends do you know to be affected?
45-
options: [AMX, BLAS, CPU, CUDA, HIP, Kompute, Metal, Musa, RPC, SYCL, Vulkan]
45+
options: [AMX, BLAS, CPU, CUDA, HIP, Metal, Musa, RPC, SYCL, Vulkan, OpenCL]
4646
multiple: true
4747
validations:
4848
required: true

.github/labeler.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
# https://github.com/actions/labeler
2-
Kompute:
3-
- changed-files:
4-
- any-glob-to-any-file:
5-
- ggml/include/ggml-kompute.h
6-
- ggml/src/ggml-kompute/**
7-
- README-kompute.md
82
Apple Metal:
93
- changed-files:
104
- any-glob-to-any-file:
@@ -93,3 +87,8 @@ Ascend NPU:
9387
- ggml/include/ggml-cann.h
9488
- ggml/src/ggml-cann/**
9589
- docs/backend/CANN.md
90+
OpenCL:
91+
- changed-files:
92+
- any-glob-to-any-file:
93+
- ggml/include/ggml-opencl.h
94+
- ggml/src/ggml-opencl/**
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build relocatable cmake package
2+
on:
3+
workflow_dispatch:
4+
workflow_call:
5+
6+
jobs:
7+
linux:
8+
runs-on: ubuntu-24.04
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
14+
- name: Install dependencies
15+
run: |
16+
sudo apt update
17+
sudo apt install -y build-essential tcl
18+
19+
- name: Build
20+
run: |
21+
PREFIX="$(pwd)"/inst
22+
cmake -S . -B build -DCMAKE_PREFIX_PATH="$PREFIX" \
23+
-DLLAMA_CURL=OFF -DLLAMA_BUILD_TESTS=OFF -DLLAMA_BUILD_TOOLS=OFF \
24+
-DLLAMA_BUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release
25+
cmake --build build --config Release
26+
cmake --install build --prefix "$PREFIX" --config Release
27+
28+
export LLAMA_CONFIG="$PREFIX"/lib/cmake/llama/llama-config.cmake
29+
tclsh <<'EOF'
30+
set build(commit) [string trim [exec git rev-parse --short HEAD]]
31+
set build(number) [string trim [exec git rev-list --count HEAD]]
32+
set build(version) "0.0.$build(number)"
33+
34+
set llamaconfig [read [open "$env(LLAMA_CONFIG)" r]]
35+
set checks [list "set\\(LLAMA_VERSION \\s+$build(version)\\)" \
36+
"set\\(LLAMA_BUILD_COMMIT\\s+$build(commit)\\)" \
37+
"set\\(LLAMA_BUILD_NUMBER\\s+$build(number)\\)"]
38+
39+
puts -nonewline "Checking llama-config.cmake version... "
40+
foreach check $checks {
41+
if {![regexp -expanded -- $check $llamaconfig]} {
42+
puts "\"$check\" failed!"
43+
exit 1
44+
}
45+
}
46+
puts "success."
47+
EOF
48+
49+
cd examples/simple-cmake-pkg
50+
cmake -S . -B build -DCMAKE_PREFIX_PATH="$PREFIX"/lib/cmake
51+
cmake --build build

.github/workflows/build.yml

Lines changed: 58 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,43 @@ on:
55
push:
66
branches:
77
- master
8-
paths: ['.github/workflows/build.yml', '.github/workflows/build-linux-cross.yml', '**/CMakeLists.txt', '**/.cmake', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cuh', '**/*.swift', '**/*.m', '**/*.metal', '**/*.comp']
8+
paths: [
9+
'.github/workflows/build.yml',
10+
'.github/workflows/build-linux-cross.yml',
11+
'.github/workflows/build-cmake-pkg.yml',
12+
'**/CMakeLists.txt',
13+
'**/.cmake',
14+
'**/*.h',
15+
'**/*.hpp',
16+
'**/*.c',
17+
'**/*.cpp',
18+
'**/*.cu',
19+
'**/*.cuh',
20+
'**/*.swift',
21+
'**/*.m',
22+
'**/*.metal',
23+
'**/*.comp'
24+
]
25+
926
pull_request:
1027
types: [opened, synchronize, reopened]
11-
paths: ['.github/workflows/build.yml', '.github/workflows/build-linux-cross.yml', '**/CMakeLists.txt', '**/.cmake', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cuh', '**/*.swift', '**/*.m', '**/*.metal', '**/*.comp']
28+
paths: [
29+
'.github/workflows/build.yml',
30+
'.github/workflows/build-linux-cross.yml',
31+
'.github/workflows/build-cmake-pkg.yml',
32+
'**/CMakeLists.txt',
33+
'**/.cmake',
34+
'**/*.h',
35+
'**/*.hpp',
36+
'**/*.c',
37+
'**/*.cpp',
38+
'**/*.cu',
39+
'**/*.cuh',
40+
'**/*.swift',
41+
'**/*.m',
42+
'**/*.metal',
43+
'**/*.comp'
44+
]
1245

1346
concurrency:
1447
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
@@ -51,7 +84,8 @@ jobs:
5184
-DCMAKE_BUILD_RPATH="@loader_path" \
5285
-DLLAMA_FATAL_WARNINGS=ON \
5386
-DGGML_METAL_USE_BF16=ON \
54-
-DGGML_METAL_EMBED_LIBRARY=ON \
87+
-DGGML_METAL_EMBED_LIBRARY=OFF \
88+
-DGGML_METAL_SHADER_DEBUG=ON \
5589
-DGGML_RPC=ON
5690
cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
5791
@@ -308,7 +342,7 @@ jobs:
308342
cd build
309343
export GGML_VK_VISIBLE_DEVICES=0
310344
# This is using llvmpipe and runs slower than other backends
311-
ctest -L main --verbose --timeout 3600
345+
ctest -L main --verbose --timeout 4200
312346
313347
ubuntu-22-cmake-hip:
314348
runs-on: ubuntu-22.04
@@ -478,6 +512,9 @@ jobs:
478512
build-linux-cross:
479513
uses: ./.github/workflows/build-linux-cross.yml
480514

515+
build-cmake-pkg:
516+
uses: ./.github/workflows/build-cmake-pkg.yml
517+
481518
macOS-latest-cmake-ios:
482519
runs-on: macos-latest
483520

@@ -628,7 +665,7 @@ jobs:
628665
./build-xcframework.sh
629666
630667
windows-msys2:
631-
runs-on: windows-latest
668+
runs-on: windows-2025
632669

633670
strategy:
634671
fail-fast: false
@@ -678,28 +715,31 @@ jobs:
678715
cmake --build build --config ${{ matrix.build }} -j $(nproc)
679716
680717
windows-latest-cmake:
681-
runs-on: windows-latest
718+
runs-on: windows-2025
682719

683720
env:
684721
OPENBLAS_VERSION: 0.3.23
685722
SDE_VERSION: 9.33.0-2024-01-07
686-
VULKAN_VERSION: 1.4.309.0
723+
VULKAN_VERSION: 1.4.313.2
687724

688725
strategy:
689726
matrix:
690727
include:
691728
- build: 'cpu-x64 (static)'
729+
arch: 'x64'
692730
defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DBUILD_SHARED_LIBS=OFF'
693731
- build: 'openblas-x64'
732+
arch: 'x64'
694733
defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_OPENMP=OFF -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS="$env:RUNNER_TEMP/openblas/include" -DBLAS_LIBRARIES="$env:RUNNER_TEMP/openblas/lib/openblas.lib"'
695734
- build: 'vulkan-x64'
696-
defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_VULKAN=ON'
735+
arch: 'x64'
736+
defines: '-DCMAKE_BUILD_TYPE=Release -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_VULKAN=ON'
697737
- build: 'llvm-arm64'
738+
arch: 'arm64'
698739
defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON'
699740
- build: 'llvm-arm64-opencl-adreno'
741+
arch: 'arm64'
700742
defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/opencl-arm64-release" -DGGML_OPENCL=ON -DGGML_OPENCL_USE_ADRENO_KERNELS=ON'
701-
# - build: 'kompute-x64'
702-
# defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_OPENMP=OFF -DGGML_KOMPUTE=ON -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON'
703743

704744
steps:
705745
- name: Clone
@@ -713,12 +753,6 @@ jobs:
713753
variant: ccache
714754
evict-old-files: 1d
715755

716-
- name: Clone Kompute submodule
717-
id: clone_kompute
718-
if: ${{ matrix.build == 'kompute-x64' }}
719-
run: |
720-
git submodule update --init ggml/src/ggml-kompute/kompute
721-
722756
- name: Download OpenBLAS
723757
id: get_openblas
724758
if: ${{ matrix.build == 'openblas-x64' }}
@@ -734,9 +768,9 @@ jobs:
734768
735769
- name: Install Vulkan SDK
736770
id: get_vulkan
737-
if: ${{ matrix.build == 'kompute-x64' || matrix.build == 'vulkan-x64' }}
771+
if: ${{ matrix.build == 'vulkan-x64' }}
738772
run: |
739-
curl.exe -o $env:RUNNER_TEMP/VulkanSDK-Installer.exe -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/VulkanSDK-${env:VULKAN_VERSION}-Installer.exe"
773+
curl.exe -o $env:RUNNER_TEMP/VulkanSDK-Installer.exe -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/vulkansdk-windows-X64-${env:VULKAN_VERSION}.exe"
740774
& "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install
741775
Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\${env:VULKAN_VERSION}"
742776
Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin"
@@ -769,6 +803,8 @@ jobs:
769803
- name: libCURL
770804
id: get_libcurl
771805
uses: ./.github/actions/windows-setup-curl
806+
with:
807+
architecture: ${{ matrix.arch == 'x64' && 'win64' || 'win64a' }}
772808

773809
- name: Build
774810
id: cmake_build
@@ -778,6 +814,7 @@ jobs:
778814
cmake -S . -B build ${{ matrix.defines }} `
779815
-DCURL_LIBRARY="$env:CURL_PATH/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="$env:CURL_PATH/include"
780816
cmake --build build --config Release -j ${env:NUMBER_OF_PROCESSORS}
817+
cp $env:CURL_PATH/bin/libcurl-*.dll build/bin/Release
781818
782819
- name: Add libopenblas.dll
783820
id: add_libopenblas_dll
@@ -788,7 +825,7 @@ jobs:
788825
789826
- name: Test
790827
id: cmake_test
791-
if: ${{ matrix.build != 'llvm-arm64' && matrix.build != 'llvm-arm64-opencl-adreno' }}
828+
if: ${{ matrix.arch == 'x64' }}
792829
run: |
793830
cd build
794831
ctest -L main -C Release --verbose --timeout 900
@@ -893,7 +930,7 @@ jobs:
893930
cmake --build build --config Release
894931
895932
windows-latest-cmake-sycl:
896-
runs-on: windows-latest
933+
runs-on: windows-2022
897934

898935
defaults:
899936
run:
@@ -927,7 +964,7 @@ jobs:
927964

928965
windows-latest-cmake-hip:
929966
if: ${{ github.event.inputs.create_release != 'true' }}
930-
runs-on: windows-latest
967+
runs-on: windows-2022
931968

932969
steps:
933970
- name: Clone

0 commit comments

Comments
 (0)