Skip to content

Commit 4c03917

Browse files
authored
Merge branch 'ggml-org:master' into master
2 parents e263bac + d0b79aa commit 4c03917

88 files changed

Lines changed: 9867 additions & 499 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" ]
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/workflows/build-cache.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,34 @@ jobs:
6363
path: ./spacemit_toolchain
6464
version: ${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}
6565

66+
ubuntu-24-openvino-cache:
67+
runs-on: ubuntu-24.04
68+
69+
env:
70+
# Sync versions in build.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
71+
OPENVINO_VERSION_MAJOR: "2026.0"
72+
OPENVINO_VERSION_FULL: "2026.0.0.20965.c6d6a13a886"
73+
74+
steps:
75+
- name: Clone
76+
id: checkout
77+
uses: actions/checkout@v6
78+
79+
- name: Setup Cache
80+
uses: actions/cache@v5
81+
id: cache-openvino
82+
with:
83+
path: ./openvino_toolkit
84+
key: openvino-toolkit-v${{ env.OPENVINO_VERSION_FULL }}-${{ runner.os }}
85+
86+
- name: Setup OpenVINO Toolkit
87+
if: steps.cache-openvino.outputs.cache-hit != 'true'
88+
uses: ./.github/actions/linux-setup-openvino
89+
with:
90+
path: ./openvino_toolkit
91+
version_major: ${{ env.OPENVINO_VERSION_MAJOR }}
92+
version_full: ${{ env.OPENVINO_VERSION_FULL }}
93+
6694
windows-2022-rocm-cache:
6795
runs-on: windows-2022
6896

.github/workflows/build.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,83 @@ jobs:
744744
-DGGML_SYCL_F16=ON
745745
cmake --build build --config Release -j $(nproc)
746746
747+
ubuntu-24-cmake-openvino:
748+
name: ubuntu-24-cmake-openvino-${{ matrix.openvino_device }}
749+
strategy:
750+
matrix:
751+
include:
752+
- variant: cpu
753+
runner: '"ubuntu-24.04"'
754+
openvino_device: "CPU"
755+
- variant: gpu
756+
runner: '["self-hosted","Linux","X64","Intel"]'
757+
openvino_device: "GPU"
758+
759+
runs-on: ${{ fromJSON(matrix.runner) }}
760+
761+
env:
762+
# Sync versions in build.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
763+
OPENVINO_VERSION_MAJOR: "2026.0"
764+
OPENVINO_VERSION_FULL: "2026.0.0.20965.c6d6a13a886"
765+
766+
steps:
767+
- name: Clone
768+
id: checkout
769+
uses: actions/checkout@v6
770+
771+
- name: ccache
772+
uses: ggml-org/ccache-action@v1.2.16
773+
with:
774+
key: ubuntu-24-cmake-openvino-${{ matrix.variant }}-no-preset-v1
775+
evict-old-files: 1d
776+
777+
- name: Dependencies
778+
id: depends
779+
run: |
780+
sudo apt-get update
781+
sudo apt-get install -y build-essential libssl-dev libtbb12 cmake ninja-build python3-pip
782+
sudo apt-get install -y ocl-icd-opencl-dev opencl-headers opencl-clhpp-headers intel-opencl-icd
783+
784+
- name: Use OpenVINO Toolkit Cache
785+
uses: actions/cache@v5
786+
id: cache-openvino
787+
with:
788+
path: ./openvino_toolkit
789+
key: openvino-toolkit-v${{ env.OPENVINO_VERSION_FULL }}-${{ runner.os }}
790+
791+
- name: Setup OpenVINO Toolkit
792+
if: steps.cache-openvino.outputs.cache-hit != 'true'
793+
uses: ./.github/actions/linux-setup-openvino
794+
with:
795+
path: ./openvino_toolkit
796+
version_major: ${{ env.OPENVINO_VERSION_MAJOR }}
797+
version_full: ${{ env.OPENVINO_VERSION_FULL }}
798+
799+
- name: Install OpenVINO dependencies
800+
run: |
801+
cd ./openvino_toolkit
802+
chmod +x ./install_dependencies/install_openvino_dependencies.sh
803+
echo "Y" | sudo -E ./install_dependencies/install_openvino_dependencies.sh
804+
805+
- name: Build
806+
id: cmake_build
807+
run: |
808+
source ./openvino_toolkit/setupvars.sh
809+
cmake -B build/ReleaseOV -G Ninja \
810+
-DCMAKE_BUILD_TYPE=Release \
811+
-DGGML_OPENVINO=ON
812+
cmake --build build/ReleaseOV --config Release -j $(nproc)
813+
814+
- name: Test
815+
id: cmake_test
816+
# TODO: fix and re-enable the `test-llama-archs` test below
817+
run: |
818+
cd ${{ github.workspace }}
819+
if [ "${{ matrix.openvino_device }}" = "GPU" ]; then
820+
export GGML_OPENVINO_DEVICE=GPU
821+
fi
822+
ctest --test-dir build/ReleaseOV -L main -E "test-llama-archs" --verbose --timeout 2000
823+
747824
build-linux-cross:
748825
uses: ./.github/workflows/build-linux-cross.yml
749826

@@ -1769,6 +1846,46 @@ jobs:
17691846
run: |
17701847
GG_BUILD_KLEIDIAI=1 GG_BUILD_EXTRA_TESTS_0=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
17711848
1849+
ggml-ci-x64-intel-openvino-gpu-low-perf:
1850+
runs-on: [self-hosted, Linux, X64, Intel, OpenVINO]
1851+
1852+
env:
1853+
# Sync versions in build.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
1854+
OPENVINO_VERSION_MAJOR: "2026.0"
1855+
OPENVINO_VERSION_FULL: "2026.0.0.20965.c6d6a13a886"
1856+
1857+
steps:
1858+
- name: Clone
1859+
id: checkout
1860+
uses: actions/checkout@v6
1861+
1862+
- name: Use OpenVINO Toolkit Cache
1863+
uses: actions/cache@v5
1864+
id: cache-openvino
1865+
with:
1866+
path: ./openvino_toolkit
1867+
key: openvino-toolkit-v${{ env.OPENVINO_VERSION_FULL }}-${{ runner.os }}
1868+
1869+
- name: Setup OpenVINO Toolkit
1870+
if: steps.cache-openvino.outputs.cache-hit != 'true'
1871+
uses: ./.github/actions/linux-setup-openvino
1872+
with:
1873+
path: ./openvino_toolkit
1874+
version_major: ${{ env.OPENVINO_VERSION_MAJOR }}
1875+
version_full: ${{ env.OPENVINO_VERSION_FULL }}
1876+
1877+
- name: Install OpenVINO dependencies
1878+
run: |
1879+
cd ./openvino_toolkit
1880+
chmod +x ./install_dependencies/install_openvino_dependencies.sh
1881+
echo "Y" | sudo -E ./install_dependencies/install_openvino_dependencies.sh
1882+
1883+
- name: Test
1884+
id: ggml-ci
1885+
run: |
1886+
source ./openvino_toolkit/setupvars.sh
1887+
GG_BUILD_OPENVINO=1 GGML_OPENVINO_DEVICE=GPU GG_BUILD_LOW_PERF=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
1888+
17721889
ubuntu-cpu-cmake-riscv64-native:
17731890
runs-on: RISCV64
17741891

.github/workflows/docker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
- { tag: "vulkan", dockerfile: ".devops/vulkan.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: false, runs_on: "ubuntu-22.04" }
4848
- { 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" }
4949
- { tag: "rocm", dockerfile: ".devops/rocm.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: true, runs_on: "ubuntu-22.04" }
50+
- { tag: "openvino", dockerfile: ".devops/openvino.Dockerfile", platforms: "linux/amd64", full: true, light: true, server: true, free_disk_space: false, runs_on: "ubuntu-22.04" }
5051
steps:
5152
- name: Check out the repo
5253
uses: actions/checkout@v6

0 commit comments

Comments
 (0)