Skip to content

Commit d798c15

Browse files
retroheimclaude
andcommitted
Merge upstream ggml-org/master (170 commits)
Resolved 5 conflicts to preserve Q1_0/Q1_0_g128/Q2_0 alongside upstream refactors: - arch-fallback.h: kept Q2_0 fallback macro, accepted upstream's removal of Q1_0 fallback (now handled by our wrapper that calls generic) - arch/x86/quants.c: kept HEAD wrappers for Q1_0/Q1_0_g128 calling generic; dropped upstream's optimized Q1_0 SIMD impl (it targets upstream's 128-block Q1_0, semantically our Q1_0_g128 — porting it over is a separate optimization task) - ggml-cpu/quants.c: kept Q1_0 32-block dot-product body; renamed GGML_FP16_TO_FP32 → GGML_CPU_FP16_TO_FP32 to match new macro - ggml-cuda/mmq.cuh: kept MMQ_ITER_K_Q1_0 + MMQ_MMA_TILE_X_K_Q8_0_g128; adopted upstream's MMQ_ITER_K_FP4 rename and FP4/NVFP4 comment clarifications - ggml.c: kept Q1_0_g128 + Q2_0 quantize cases; adopted upstream's whitespace alignment for the quantize-row dispatch table CPU build verified end-to-end. CUDA build pending. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 parents b1a6564 + d05fe1d commit d798c15

555 files changed

Lines changed: 45025 additions & 23043 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/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.3.2-0-devel-ubuntu24.04
1+
ARG ONEAPI_VERSION=2025.3.3-0-devel-ubuntu24.04
22

33
## Build Image
44

.devops/openvino.Dockerfile

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,19 @@ ARG OPENVINO_VERSION_MAJOR=2026.0
22
ARG OPENVINO_VERSION_FULL=2026.0.0.20965.c6d6a13a886
33
ARG UBUNTU_VERSION=24.04
44

5-
# Optional proxy build arguments - empty by default
5+
# Intel GPU driver versions. https://github.com/intel/compute-runtime/releases
6+
ARG IGC_VERSION=v2.30.1
7+
ARG IGC_VERSION_FULL=2_2.30.1+20950
8+
ARG COMPUTE_RUNTIME_VERSION=26.09.37435.1
9+
ARG COMPUTE_RUNTIME_VERSION_FULL=26.09.37435.1-0
10+
ARG IGDGMM_VERSION=22.9.0
11+
12+
# Intel NPU driver versions. https://github.com/intel/linux-npu-driver/releases
13+
ARG NPU_DRIVER_VERSION=v1.32.0
14+
ARG NPU_DRIVER_FULL=v1.32.0.20260402-23905121947
15+
ARG LIBZE1_VERSION=1.27.0-1~24.04~ppa2
16+
17+
# Optional proxy build arguments
618
ARG http_proxy=
719
ARG https_proxy=
820

@@ -78,13 +90,47 @@ ARG http_proxy
7890
ARG https_proxy
7991

8092
RUN apt-get update \
81-
&& apt-get install -y libgomp1 libtbb12 curl \
93+
&& apt-get install -y libgomp1 libtbb12 curl wget ocl-icd-libopencl1 \
8294
&& apt autoremove -y \
8395
&& apt clean -y \
8496
&& rm -rf /tmp/* /var/tmp/* \
8597
&& find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete \
8698
&& find /var/cache -type f -delete
8799

100+
# Install GPU drivers
101+
ARG IGC_VERSION
102+
ARG IGC_VERSION_FULL
103+
ARG COMPUTE_RUNTIME_VERSION
104+
ARG COMPUTE_RUNTIME_VERSION_FULL
105+
ARG IGDGMM_VERSION
106+
RUN mkdir /tmp/neo/ && cd /tmp/neo/ \
107+
&& wget https://github.com/intel/intel-graphics-compiler/releases/download/${IGC_VERSION}/intel-igc-core-${IGC_VERSION_FULL}_amd64.deb \
108+
&& wget https://github.com/intel/intel-graphics-compiler/releases/download/${IGC_VERSION}/intel-igc-opencl-${IGC_VERSION_FULL}_amd64.deb \
109+
&& wget https://github.com/intel/compute-runtime/releases/download/${COMPUTE_RUNTIME_VERSION}/intel-ocloc-dbgsym_${COMPUTE_RUNTIME_VERSION_FULL}_amd64.ddeb \
110+
&& wget https://github.com/intel/compute-runtime/releases/download/${COMPUTE_RUNTIME_VERSION}/intel-ocloc_${COMPUTE_RUNTIME_VERSION_FULL}_amd64.deb \
111+
&& wget https://github.com/intel/compute-runtime/releases/download/${COMPUTE_RUNTIME_VERSION}/intel-opencl-icd-dbgsym_${COMPUTE_RUNTIME_VERSION_FULL}_amd64.ddeb \
112+
&& wget https://github.com/intel/compute-runtime/releases/download/${COMPUTE_RUNTIME_VERSION}/intel-opencl-icd_${COMPUTE_RUNTIME_VERSION_FULL}_amd64.deb \
113+
&& wget https://github.com/intel/compute-runtime/releases/download/${COMPUTE_RUNTIME_VERSION}/libigdgmm12_${IGDGMM_VERSION}_amd64.deb \
114+
&& wget https://github.com/intel/compute-runtime/releases/download/${COMPUTE_RUNTIME_VERSION}/libze-intel-gpu1-dbgsym_${COMPUTE_RUNTIME_VERSION_FULL}_amd64.ddeb \
115+
&& wget https://github.com/intel/compute-runtime/releases/download/${COMPUTE_RUNTIME_VERSION}/libze-intel-gpu1_${COMPUTE_RUNTIME_VERSION_FULL}_amd64.deb \
116+
&& dpkg --install *.deb \
117+
&& rm -rf /tmp/neo/
118+
119+
# Install NPU drivers
120+
ARG NPU_DRIVER_VERSION
121+
ARG NPU_DRIVER_FULL
122+
ARG LIBZE1_VERSION
123+
RUN mkdir /tmp/npu/ && cd /tmp/npu/ \
124+
&& wget https://github.com/intel/linux-npu-driver/releases/download/${NPU_DRIVER_VERSION}/linux-npu-driver-${NPU_DRIVER_FULL}-ubuntu2404.tar.gz \
125+
&& tar -xf linux-npu-driver-${NPU_DRIVER_FULL}-ubuntu2404.tar.gz \
126+
&& dpkg --install *.deb \
127+
&& rm -rf /tmp/npu/
128+
129+
RUN cd /tmp \
130+
&& wget https://snapshot.ppa.launchpadcontent.net/kobuk-team/intel-graphics/ubuntu/20260324T100000Z/pool/main/l/level-zero-loader/libze1_${LIBZE1_VERSION}_amd64.deb \
131+
&& dpkg --install libze1_${LIBZE1_VERSION}_amd64.deb \
132+
&& rm libze1_${LIBZE1_VERSION}_amd64.deb
133+
88134
COPY --from=build /app/lib/ /app/
89135

90136
### Full (all binaries)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ body:
1212
after recreating the CMake build directory and with `-DGGML_CCACHE=OFF`.
1313
If the compilation succeeds with ccache disabled you should be able to permanently fix the issue
1414
by clearing `~/.cache/ccache` (on Linux).
15+
16+
Please fill out this template yourself, copypasting language model outputs is [strictly prohibited](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md#ai-usage-policy).
1517
- type: textarea
1618
id: commit
1719
attributes:

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Bug (model use)
2-
description: Something goes wrong when using a model (in general, not specific to a single llama.cpp module).
2+
description: Something goes wrong when running a model (crashes, garbled outputs, etc.).
33
title: "Eval bug: "
44
labels: ["bug-unconfirmed", "model evaluation"]
55
body:
@@ -12,6 +12,8 @@ body:
1212
If you encountered the issue while using an external UI (e.g. ollama),
1313
please reproduce your issue using one of the examples/binaries in this repository.
1414
The `llama-completion` binary can be used for simple and reproducible model inference.
15+
16+
Please fill out this template yourself, copypasting language model outputs is [strictly prohibited](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md#ai-usage-policy).
1517
- type: textarea
1618
id: version
1719
attributes:

.github/ISSUE_TEMPLATE/019-bug-misc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ body:
1010
This issue template is intended for miscellaneous bugs that don't fit into any other category.
1111
If you encountered the issue while using an external UI (e.g. ollama),
1212
please reproduce your issue using one of the examples/binaries in this repository.
13+
14+
Please fill out this template yourself, copypasting language model outputs is [strictly prohibited](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md#ai-usage-policy).
1315
- type: textarea
1416
id: version
1517
attributes:

.github/ISSUE_TEMPLATE/020-enhancement.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ body:
88
value: |
99
[Please post your idea first in Discussion if there is not yet a consensus for this enhancement request. This will help to keep this issue tracker focused on enhancements that the community has agreed needs to be implemented.](https://github.com/ggml-org/llama.cpp/discussions/categories/ideas)
1010
11+
Please fill out this template yourself, copypasting language model outputs is [strictly prohibited](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md#ai-usage-policy).
12+
1113
- type: checkboxes
1214
id: prerequisites
1315
attributes:

.github/ISSUE_TEMPLATE/030-research.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ body:
88
value: |
99
Don't forget to check for any [duplicate research issue tickets](https://github.com/ggml-org/llama.cpp/issues?q=is%3Aopen+is%3Aissue+label%3A%22research+%F0%9F%94%AC%22)
1010
11+
Please fill out this template yourself, copypasting language model outputs is [strictly prohibited](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md#ai-usage-policy).
12+
1113
- type: checkboxes
1214
id: research-stage
1315
attributes:

.github/ISSUE_TEMPLATE/040-refactor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ body:
99
Don't forget to [check for existing refactor issue tickets](https://github.com/ggml-org/llama.cpp/issues?q=is%3Aopen+is%3Aissue+label%3Arefactoring) in case it's already covered.
1010
Also you may want to check [Pull request refactor label as well](https://github.com/ggml-org/llama.cpp/pulls?q=is%3Aopen+is%3Apr+label%3Arefactoring) for duplicates too.
1111
12+
Please fill out this template yourself, copypasting language model outputs is [strictly prohibited](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md#ai-usage-policy).
13+
1214
- type: textarea
1315
id: background-description
1416
attributes:

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<!-- You can provide more details and link related discussions here. Delete this section if not applicable -->
88

9-
# Requirements
9+
## Requirements
1010

1111
<!-- IMPORTANT: Please do NOT delete this section, otherwise your PR may be rejected -->
1212

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: CI (snapdragon)
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
paths:
9+
- '.github/workflows/build-and-test-snapdragon.yml'
10+
- 'ggml/include/ggml-hexagon.h'
11+
- 'ggml/src/ggml-hexagon/**'
12+
- 'docs/backend/snapdragon/**'
13+
- 'scripts/snapdragon/**'
14+
- 'CMakePresets.json'
15+
16+
pull_request:
17+
types: [opened, synchronize, reopened]
18+
paths:
19+
- '.github/workflows/build-and-test-snapdragon.yml'
20+
- 'ggml/include/ggml-hexagon.h'
21+
- 'ggml/src/ggml-hexagon/**'
22+
- 'docs/backend/snapdragon/**'
23+
- 'scripts/snapdragon/**'
24+
- 'CMakePresets.json'
25+
26+
concurrency:
27+
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
28+
cancel-in-progress: true
29+
30+
jobs:
31+
android-ndk-snapdragon:
32+
runs-on: ubuntu-latest
33+
container:
34+
image: 'ghcr.io/snapdragon-toolchain/arm64-android:v0.3'
35+
defaults:
36+
run:
37+
shell: bash
38+
39+
steps:
40+
- name: Clone
41+
uses: actions/checkout@v6
42+
with:
43+
fetch-depth: 0
44+
lfs: false
45+
46+
- name: Build Llama.CPP for Snapdragon Android
47+
id: build_llama_cpp_snapdragon_android
48+
run: |
49+
cp docs/backend/snapdragon/CMakeUserPresets.json .
50+
cmake --preset arm64-android-snapdragon-release -B build
51+
cmake --build build
52+
cmake --install build --prefix pkg-snapdragon/llama.cpp
53+
54+
- name: Upload Llama.CPP Snapdragon Android Build Artifact
55+
if: ${{ always() && steps.build_llama_cpp_snapdragon_android.outcome == 'success' }}
56+
uses: actions/upload-artifact@v6
57+
with:
58+
name: llama-cpp-android-arm64-snapdragon
59+
path: pkg-snapdragon/llama.cpp
60+
61+
test-snapdragon-qdc:
62+
name: Test on QDC Android Device (${{ matrix.device }})
63+
needs: [android-ndk-snapdragon]
64+
runs-on: ubuntu-slim
65+
strategy:
66+
fail-fast: false
67+
matrix:
68+
device: [SM8750, SM8650, SM8850]
69+
70+
steps:
71+
- name: Checkout
72+
uses: actions/checkout@v6
73+
74+
- name: Download build artifact
75+
uses: actions/download-artifact@v7
76+
with:
77+
name: llama-cpp-android-arm64-snapdragon
78+
path: pkg-snapdragon/llama.cpp
79+
80+
- name: Set up Python
81+
uses: actions/setup-python@v5
82+
with:
83+
python-version: '3.x'
84+
cache: pip
85+
86+
- name: Install system dependencies
87+
run: |
88+
sudo apt-get update
89+
sudo apt-get install -y curl unzip
90+
91+
- name: Install QDC SDK wheel
92+
run: |
93+
curl -fSL -o qdc_sdk.zip https://softwarecenter.qualcomm.com/api/download/software/tools/Qualcomm_Device_Cloud_SDK/All/0.2.3/qualcomm_device_cloud_sdk-0.2.3.zip
94+
unzip qdc_sdk.zip -d qdc_sdk
95+
pip install qdc_sdk/qualcomm_device_cloud_sdk-0.2.3-py3-none-any.whl
96+
97+
- name: Check QDC API key
98+
id: check_secret
99+
env:
100+
QDC_API_KEY: ${{ secrets.QDC_API_KEY }}
101+
run: echo "has-qdc-key=${{ env.QDC_API_KEY != '' }}" >> "$GITHUB_OUTPUT"
102+
103+
- name: Run QDC tests (${{ matrix.device }})
104+
if: steps.check_secret.outputs.has-qdc-key == 'true'
105+
run: |
106+
python scripts/snapdragon/qdc/run_qdc_jobs.py \
107+
--test all \
108+
--pkg-dir pkg-snapdragon/llama.cpp \
109+
--model-url "https://huggingface.co/bartowski/Llama-3.2-1B-Instruct-GGUF/resolve/main/Llama-3.2-1B-Instruct-Q4_0.gguf" \
110+
--device ${{ matrix.device }}
111+
env:
112+
QDC_API_KEY: ${{ secrets.QDC_API_KEY }}
113+
114+
- name: Cleanup
115+
if: always()
116+
run: rm -rf pkg-snapdragon qdc_sdk qdc_sdk.zip

0 commit comments

Comments
 (0)