Skip to content

Commit 5bb2d50

Browse files
committed
Merge branch 'master' into pr/18039
2 parents 07e2c97 + 67a2209 commit 5bb2d50

857 files changed

Lines changed: 80431 additions & 42895 deletions

File tree

Some content is hidden

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

.devops/openvino.Dockerfile

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
ARG OPENVINO_VERSION_MAJOR=2026.0
2+
ARG OPENVINO_VERSION_FULL=2026.0.0.20965.c6d6a13a886
3+
ARG UBUNTU_VERSION=24.04
4+
5+
# Optional proxy build arguments - empty by default
6+
ARG http_proxy=
7+
ARG https_proxy=
8+
9+
## Build Image
10+
FROM ubuntu:${UBUNTU_VERSION} AS build
11+
12+
# Pass proxy args to build stage
13+
ARG http_proxy
14+
ARG https_proxy
15+
16+
RUN apt-get update && \
17+
apt-get install -y --no-install-recommends \
18+
ca-certificates \
19+
gnupg \
20+
wget \
21+
git \
22+
cmake \
23+
ninja-build \
24+
build-essential \
25+
libtbb12 \
26+
libssl-dev \
27+
ocl-icd-opencl-dev \
28+
opencl-headers \
29+
opencl-clhpp-headers \
30+
intel-opencl-icd && \
31+
rm -rf /var/lib/apt/lists/*
32+
33+
# Install OpenVINO for Ubuntu 24.04
34+
ARG OPENVINO_VERSION_MAJOR
35+
ARG OPENVINO_VERSION_FULL
36+
RUN mkdir -p /opt/intel && \
37+
wget https://storage.openvinotoolkit.org/repositories/openvino/packages/${OPENVINO_VERSION_MAJOR}/linux/openvino_toolkit_ubuntu24_${OPENVINO_VERSION_FULL}_x86_64.tgz && \
38+
tar -xf openvino_toolkit_ubuntu24_${OPENVINO_VERSION_FULL}_x86_64.tgz && \
39+
mv openvino_toolkit_ubuntu24_${OPENVINO_VERSION_FULL}_x86_64 /opt/intel/openvino_${OPENVINO_VERSION_MAJOR} && \
40+
cd /opt/intel/openvino_${OPENVINO_VERSION_MAJOR} && \
41+
echo "Y" | ./install_dependencies/install_openvino_dependencies.sh && \
42+
cd - && \
43+
ln -s /opt/intel/openvino_${OPENVINO_VERSION_MAJOR} /opt/intel/openvino
44+
45+
ENV OpenVINO_DIR=/opt/intel/openvino
46+
47+
WORKDIR /app
48+
49+
COPY . .
50+
51+
# Build Stage
52+
RUN bash -c "source ${OpenVINO_DIR}/setupvars.sh && \
53+
cmake -B build/ReleaseOV -G Ninja \
54+
-DCMAKE_BUILD_TYPE=Release \
55+
-DGGML_OPENVINO=ON && \
56+
cmake --build build/ReleaseOV -j$(nproc)"
57+
58+
# Copy all necessary libraries
59+
RUN mkdir -p /app/lib && \
60+
find build/ReleaseOV -name '*.so*' -exec cp {} /app/lib \; && \
61+
find ${OpenVINO_DIR}/runtime/lib/intel64 -name '*.so*' -exec cp -P {} /app/lib \; 2>/dev/null || \
62+
find ${OpenVINO_DIR}/lib/intel64 -name '*.so*' -exec cp -P {} /app/lib \;
63+
64+
# Create runtime directories and copy binaries
65+
RUN mkdir -p /app/full \
66+
&& cp build/ReleaseOV/bin/* /app/full/ \
67+
&& cp *.py /app/full \
68+
&& cp -r gguf-py /app/full \
69+
&& cp -r requirements /app/full \
70+
&& cp requirements.txt /app/full \
71+
&& cp .devops/tools.sh /app/full/tools.sh
72+
73+
## Base Runtime Image
74+
FROM ubuntu:${UBUNTU_VERSION} AS base
75+
76+
# Pass proxy args to runtime stage
77+
ARG http_proxy
78+
ARG https_proxy
79+
80+
RUN apt-get update \
81+
&& apt-get install -y libgomp1 libtbb12 curl\
82+
&& apt autoremove -y \
83+
&& apt clean -y \
84+
&& rm -rf /tmp/* /var/tmp/* \
85+
&& find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete \
86+
&& find /var/cache -type f -delete
87+
88+
COPY --from=build /app/lib/ /app/
89+
90+
### Full (all binaries)
91+
FROM base AS full
92+
93+
ARG http_proxy
94+
ARG https_proxy
95+
96+
COPY --from=build /app/full /app/
97+
98+
WORKDIR /app
99+
100+
RUN apt-get update && \
101+
apt-get install -y --no-install-recommends \
102+
git \
103+
python3 \
104+
python3-venv \
105+
python3-pip && \
106+
python3 -m venv /ov-venv && \
107+
/ov-venv/bin/pip install --no-cache-dir --upgrade pip setuptools wheel && \
108+
/ov-venv/bin/pip install --no-cache-dir -r requirements.txt && \
109+
apt-get autoremove -y && \
110+
apt-get clean && \
111+
rm -rf /tmp/* /var/tmp/* && \
112+
find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete && \
113+
find /var/cache -type f -delete
114+
115+
ENTRYPOINT ["/bin/bash", "-c", "source /ov-venv/bin/activate && exec /app/tools.sh \"$@\"", "--"]
116+
117+
118+
### Light, CLI only
119+
FROM base AS light
120+
121+
COPY --from=build /app/full/llama-cli /app/
122+
123+
WORKDIR /app
124+
125+
ENTRYPOINT [ "/app/llama-cli" ]
126+
127+
### Server, Server only
128+
FROM base AS server
129+
130+
ENV LLAMA_ARG_HOST=0.0.0.0
131+
132+
COPY --from=build /app/full/llama-server /app/
133+
134+
WORKDIR /app
135+
136+
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]
137+
138+
ENTRYPOINT [ "/app/llama-server" ]

.devops/vulkan.Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ RUN apt-get update \
5353
&& apt-get install -y \
5454
build-essential \
5555
git \
56-
python3 \
57-
python3-dev \
56+
python3.13 \
57+
python3.13-dev \
5858
python3-pip \
5959
python3-wheel \
60+
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.13 100 \
6061
&& pip install --break-system-packages --upgrade setuptools \
6162
&& pip install --break-system-packages -r requirements.txt \
6263
&& apt autoremove -y \
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: "Linux - Setup OpenVINO Toolkit"
2+
description: "Setup OpenVINO Toolkit for Linux"
3+
inputs:
4+
path:
5+
description: "Installation path"
6+
required: true
7+
version_major:
8+
description: "OpenVINO major version (e.g., 2025.3)"
9+
required: true
10+
version_full:
11+
description: "OpenVINO full version (e.g., 2025.3.0.19807.44526285f24)"
12+
required: true
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Setup OpenVINO Toolkit
18+
id: setup
19+
uses: ./.github/actions/unarchive-tar
20+
with:
21+
url: https://storage.openvinotoolkit.org/repositories/openvino/packages/${{ inputs.version_major }}/linux/openvino_toolkit_ubuntu24_${{ inputs.version_full }}_x86_64.tgz
22+
path: ${{ inputs.path }}
23+
type: z
24+
strip: 1
25+

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ runs:
1111
- name: Setup ROCm
1212
uses: ./.github/actions/install-exe
1313
with:
14-
url: https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ inputs.version }}-WinSvr2022-For-HIP.exe
14+
url: https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ inputs.version }}-Win11-For-HIP.exe
1515
args: -install
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI (3rd-party)
2+
3+
on:
4+
workflow_dispatch: # allows manual triggering
5+
push:
6+
branches:
7+
- master
8+
paths: [
9+
'.github/workflows/build-3rd-party.yml',
10+
'**/CMakeLists.txt',
11+
'**/.cmake',
12+
'**/*.h',
13+
'**/*.hpp',
14+
'**/*.c',
15+
'**/*.cpp'
16+
]
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
20+
cancel-in-progress: true
21+
22+
env:
23+
GGML_NLOOP: 3
24+
GGML_N_THREADS: 1
25+
LLAMA_LOG_COLORS: 1
26+
LLAMA_LOG_PREFIX: 1
27+
LLAMA_LOG_TIMESTAMPS: 1
28+
29+
jobs:
30+
ubuntu-24-llguidance:
31+
runs-on: ${{ 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
32+
33+
steps:
34+
- name: Clone
35+
id: checkout
36+
uses: actions/checkout@v6
37+
38+
- name: Dependencies
39+
id: depends
40+
run: |
41+
sudo apt-get update
42+
sudo apt-get install build-essential libssl-dev
43+
44+
- name: Build
45+
id: cmake_build
46+
run: |
47+
cmake -B build \
48+
-DLLAMA_FATAL_WARNINGS=ON \
49+
-DLLAMA_LLGUIDANCE=ON
50+
cmake --build build --config Release -j $(nproc)
51+
52+
- name: Test
53+
id: cmake_test
54+
run: |
55+
cd build
56+
ctest -L main --verbose --timeout 900
57+
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
name: CI (android)
2+
3+
on:
4+
workflow_dispatch: # allows manual triggering
5+
push:
6+
branches:
7+
- master
8+
paths: [
9+
'.github/workflows/build-android.yml',
10+
'**/CMakeLists.txt',
11+
'**/.cmake',
12+
'**/*.h',
13+
'**/*.hpp',
14+
'**/*.c',
15+
'**/*.cpp'
16+
]
17+
18+
pull_request:
19+
types: [opened, synchronize, reopened]
20+
paths: [
21+
'.github/workflows/build-android.yml',
22+
'examples/llama.android/**'
23+
]
24+
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
27+
cancel-in-progress: true
28+
29+
env:
30+
GGML_NLOOP: 3
31+
GGML_N_THREADS: 1
32+
LLAMA_LOG_COLORS: 1
33+
LLAMA_LOG_PREFIX: 1
34+
LLAMA_LOG_TIMESTAMPS: 1
35+
36+
jobs:
37+
android:
38+
runs-on: ubuntu-latest
39+
40+
steps:
41+
- name: Clone
42+
uses: actions/checkout@v6
43+
44+
# Disabled due to size (400MB) and always 0 cache hits
45+
# - name: ccache
46+
# uses: ggml-org/ccache-action@v1.2.16
47+
# with:
48+
# key: android-build
49+
# evict-old-files: 1d
50+
51+
- name: Set up JDK
52+
uses: actions/setup-java@v5
53+
with:
54+
java-version: 17
55+
distribution: zulu
56+
57+
- name: Setup Android SDK
58+
uses: android-actions/setup-android@v3
59+
with:
60+
log-accepted-android-sdk-licenses: false
61+
62+
- name: Build
63+
run: |
64+
cd examples/llama.android
65+
./gradlew build --no-daemon
66+
67+
android-ndk:
68+
runs-on: ubuntu-latest
69+
70+
env:
71+
OPENCL_VERSION: 2025.07.22
72+
73+
strategy:
74+
matrix:
75+
include:
76+
- build: 'arm64-cpu'
77+
defines: '-D ANDROID_ABI=arm64-v8a -D ANDROID_PLATFORM=android-31 -D CMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake -D GGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=armv8.5-a+fp16+i8mm -G Ninja -D LLAMA_OPENSSL=OFF -D GGML_OPENMP=OFF'
78+
- build: 'arm64-snapdragon'
79+
defines: '--preset arm64-android-snapdragon-release'
80+
81+
steps:
82+
- name: Clone
83+
id: checkout
84+
uses: actions/checkout@v6
85+
86+
- name: Install OpenCL Headers and Libs
87+
id: install_opencl
88+
if: ${{ matrix.build == 'arm64-snapdragon' }}
89+
run: |
90+
mkdir opencl
91+
curl -L -o opencl/clhpp.tar.gz https://github.com/KhronosGroup/OpenCL-CLHPP/archive/refs/tags/v${OPENCL_VERSION}.tar.gz
92+
curl -L -o opencl/headers.tar.gz https://github.com/KhronosGroup/OpenCL-Headers/archive/refs/tags/v${OPENCL_VERSION}.tar.gz
93+
curl -L -o opencl/icd-loader.tar.gz https://github.com/KhronosGroup/OpenCL-ICD-Loader/archive/refs/tags/v${OPENCL_VERSION}.tar.gz
94+
tar -xaf opencl/headers.tar.gz -C opencl
95+
tar -xaf opencl/clhpp.tar.gz -C opencl
96+
tar -xaf opencl/icd-loader.tar.gz -C opencl
97+
sudo cp -r opencl/OpenCL-Headers-${OPENCL_VERSION}/CL ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include
98+
sudo cp -r opencl/OpenCL-CLHPP-${OPENCL_VERSION}/include/CL/* ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/CL
99+
cd opencl/OpenCL-ICD-Loader-${OPENCL_VERSION}
100+
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake -DOPENCL_ICD_LOADER_HEADERS_DIR=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=31 -DANDROID_STL=c++_shared
101+
cmake --build build
102+
sudo cp build/libOpenCL.so ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android
103+
rm -rf opencl
104+
105+
- name: Install Hexagon SDK
106+
id: install_hexsdk
107+
if: ${{ matrix.build == 'arm64-snapdragon' }}
108+
env:
109+
HEXSDK_VER: 6.4.0.2
110+
HEXTLS_VER: 19.0.04
111+
run: |
112+
curl -L -o hex-sdk.tar.gz https://github.com/snapdragon-toolchain/hexagon-sdk/releases/download/v$HEXSDK_VER/hexagon-sdk-v$HEXSDK_VER-amd64-lnx.tar.xz
113+
mkdir hex-sdk
114+
tar -xaf hex-sdk.tar.gz -C hex-sdk
115+
ls -l hex-sdk
116+
sudo mv hex-sdk /opt/hexagon
117+
echo "HEXAGON_SDK_ROOT=/opt/hexagon/$HEXSDK_VER" >> "$GITHUB_ENV"
118+
echo "HEXAGON_TOOLS_ROOT=/opt/hexagon/$HEXSDK_VER/tools/HEXAGON_Tools/$HEXTLS_VER" >> "$GITHUB_ENV"
119+
echo "DEFAULT_HLOS_ARCH=64" >> "$GITHUB_ENV"
120+
echo "DEFAULT_TOOLS_VARIANT=toolv19" >> "$GITHUB_ENV"
121+
echo "DEFAULT_NO_QURT_INC=0" >> "$GITHUB_ENV"
122+
echo "DEFAULT_DSP_ARCH=v73" >> "$GITHUB_ENV"
123+
124+
- name: Update CMake presets
125+
id: update_presets
126+
if: ${{ matrix.build == 'arm64-snapdragon' }}
127+
run: |
128+
cp docs/backend/snapdragon/CMakeUserPresets.json .
129+
130+
- name: Build
131+
id: ndk_build
132+
run: |
133+
cmake ${{ matrix.defines }} -B build
134+
cmake --build build
135+
cmake --install build --prefix pkg-adb/llama.cpp
136+
137+
- name: Test
138+
id: cmake_test
139+
run: |
140+
echo "FIXME: test on devices"

0 commit comments

Comments
 (0)