Skip to content

Commit 6928d0d

Browse files
authored
Merge pull request #270 from menloresearch/update-dev-from-master-2025-10-02-02-32
Sync master with upstream release b6663
2 parents ca49774 + e95fec6 commit 6928d0d

Some content is hidden

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

69 files changed

+3001
-1277
lines changed

.devops/rocm.Dockerfile

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
ARG UBUNTU_VERSION=24.04
22

33
# This needs to generally match the container host's environment.
4-
ARG ROCM_VERSION=6.4
5-
ARG AMDGPU_VERSION=6.4
4+
ARG ROCM_VERSION=7.0
5+
ARG AMDGPU_VERSION=7.0
66

77
# Target the ROCm build image
88
ARG BASE_ROCM_DEV_CONTAINER=rocm/dev-ubuntu-${UBUNTU_VERSION}:${ROCM_VERSION}-complete
@@ -13,11 +13,10 @@ FROM ${BASE_ROCM_DEV_CONTAINER} AS build
1313
# Unless otherwise specified, we make a fat build.
1414
# List from https://github.com/ggml-org/llama.cpp/pull/1087#issuecomment-1682807878
1515
# This is mostly tied to rocBLAS supported archs.
16-
# gfx803, gfx900, gfx1032, gfx1101, gfx1102,not officialy supported
17-
# gfx906 is deprecated
18-
#check https://rocm.docs.amd.com/projects/install-on-linux/en/docs-6.4.1/reference/system-requirements.html
16+
# gfx803, gfx900, gfx906, gfx1032, gfx1101, gfx1102,not officialy supported
17+
# check https://rocm.docs.amd.com/projects/install-on-linux/en/docs-6.4.1/reference/system-requirements.html
1918

20-
ARG ROCM_DOCKER_ARCH='gfx803;gfx900;gfx906;gfx908;gfx90a;gfx942;gfx1010;gfx1030;gfx1032;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201;gfx1151'
19+
ARG ROCM_DOCKER_ARCH='gfx803;gfx900;gfx906;gfx1010;gfx1030;gfx1032;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201;gfx1151'
2120
#ARG ROCM_DOCKER_ARCH='gfx1151'
2221

2322
# Set ROCm architectures
@@ -36,13 +35,10 @@ WORKDIR /app
3635

3736
COPY . .
3837

39-
RUN git clone https://github.com/rocm/rocwmma --branch develop --depth 1
40-
4138
RUN HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" \
4239
cmake -S . -B build \
4340
-DGGML_HIP=ON \
4441
-DGGML_HIP_ROCWMMA_FATTN=ON \
45-
-DCMAKE_HIP_FLAGS="-I$(pwd)/rocwmma/library/include/" \
4642
-DAMDGPU_TARGETS="$ROCM_DOCKER_ARCH" \
4743
-DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON \
4844
-DCMAKE_BUILD_TYPE=Release -DLLAMA_BUILD_TESTS=OFF \

.github/workflows/build-amd.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI (AMD)
2+
3+
on:
4+
workflow_dispatch: # allows manual triggering
5+
push:
6+
branches:
7+
- master
8+
paths: [
9+
'.github/workflows/build-amd.yml',
10+
'**/CMakeLists.txt',
11+
'**/.cmake',
12+
'**/*.h',
13+
'**/*.hpp',
14+
'**/*.c',
15+
'**/*.cpp',
16+
'**/*.cu',
17+
'**/*.cuh',
18+
'**/*.comp'
19+
]
20+
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
ggml-ci-x64-amd-vulkan:
27+
runs-on: [self-hosted, Linux, X64, AMD]
28+
29+
steps:
30+
- name: Clone
31+
id: checkout
32+
uses: actions/checkout@v4
33+
34+
- name: Test
35+
id: ggml-ci
36+
run: |
37+
vulkaninfo --summary
38+
GG_BUILD_VULKAN=1 bash ./ci/run.sh ~/results/llama.cpp /mnt/llama.cpp
39+
40+
ggml-ci-x64-amd-rocm:
41+
runs-on: [self-hosted, Linux, X64, AMD]
42+
43+
steps:
44+
- name: Clone
45+
id: checkout
46+
uses: actions/checkout@v4
47+
48+
- name: Test
49+
id: ggml-ci
50+
run: |
51+
amd-smi static
52+
GG_BUILD_ROCM=1 GG_BUILD_AMDGPU_TARGETS="gfx1101" bash ./ci/run.sh ~/results/llama.cpp /mnt/llama.cpp

.github/workflows/build.yml

Lines changed: 15 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ jobs:
207207
- name: ccache
208208
uses: ggml-org/ccache-action@v1.2.16
209209
with:
210-
key: ubuntu-cpu-cmake
210+
key: ubuntu-cpu-cmake-${{ matrix.build }}
211211
evict-old-files: 1d
212212

213213
- name: Build Dependencies
@@ -487,7 +487,7 @@ jobs:
487487
id: depends
488488
run: |
489489
sudo apt-get update
490-
sudo apt-get install -y build-essential git cmake rocblas-dev hipblas-dev libcurl4-openssl-dev
490+
sudo apt-get install -y build-essential git cmake rocblas-dev hipblas-dev libcurl4-openssl-dev rocwmma-dev
491491
492492
- name: ccache
493493
uses: ggml-org/ccache-action@v1.2.16
@@ -1097,10 +1097,12 @@ jobs:
10971097
id: checkout
10981098
uses: actions/checkout@v4
10991099

1100-
- name: Clone rocWMMA repository
1101-
id: clone_rocwmma
1100+
- name: Grab rocWMMA package
1101+
id: grab_rocwmma
11021102
run: |
1103-
git clone https://github.com/rocm/rocwmma --branch rocm-${{ env.ROCM_VERSION }} --depth 1
1103+
curl -o rocwmma.deb "https://repo.radeon.com/rocm/apt/${{ env.ROCM_VERSION }}/pool/main/r/rocwmma-dev/rocwmma-dev_1.7.0.60402-120~24.04_amd64.deb"
1104+
7z x rocwmma.deb
1105+
7z x data.tar
11041106
11051107
- name: Cache ROCm Installation
11061108
id: cache-rocm
@@ -1161,8 +1163,9 @@ jobs:
11611163
cmake -G "Unix Makefiles" -B build -S . `
11621164
-DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" `
11631165
-DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" `
1164-
-DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/rocwmma/library/include/" `
1166+
-DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/opt/rocm-${{ env.ROCM_VERSION }}/include/" `
11651167
-DCMAKE_BUILD_TYPE=Release `
1168+
-DROCM_DIR="${env:HIP_PATH}" `
11661169
-DGGML_HIP=ON `
11671170
-DGGML_HIP_ROCWMMA_FATTN=ON `
11681171
-DGGML_RPC=ON `
@@ -1222,11 +1225,12 @@ jobs:
12221225
- name: Clone
12231226
uses: actions/checkout@v4
12241227

1225-
- name: ccache
1226-
uses: ggml-org/ccache-action@v1.2.16
1227-
with:
1228-
key: android-build
1229-
evict-old-files: 1d
1228+
# Disabled due to size (400MB) and always 0 cache hits
1229+
# - name: ccache
1230+
# uses: ggml-org/ccache-action@v1.2.16
1231+
# with:
1232+
# key: android-build
1233+
# evict-old-files: 1d
12301234

12311235
- name: Set up JDK
12321236
uses: actions/setup-java@v3
@@ -1461,34 +1465,6 @@ jobs:
14611465
run: |
14621466
bash ./ci/run.sh ~/results/llama.cpp /mnt/llama.cpp
14631467
1464-
# ggml-ci-x64-amd-vulkan:
1465-
# runs-on: [self-hosted, Linux, X64, AMD]
1466-
#
1467-
# steps:
1468-
# - name: Clone
1469-
# id: checkout
1470-
# uses: actions/checkout@v4
1471-
#
1472-
# - name: Test
1473-
# id: ggml-ci
1474-
# run: |
1475-
# vulkaninfo --summary
1476-
# GG_BUILD_VULKAN=1 bash ./ci/run.sh ~/results/llama.cpp /mnt/llama.cpp
1477-
#
1478-
# ggml-ci-x64-amd-rocm:
1479-
# runs-on: [self-hosted, Linux, X64, AMD]
1480-
#
1481-
# steps:
1482-
# - name: Clone
1483-
# id: checkout
1484-
# uses: actions/checkout@v4
1485-
#
1486-
# - name: Test
1487-
# id: ggml-ci
1488-
# run: |
1489-
# amd-smi static
1490-
# GG_BUILD_ROCM=1 GG_BUILD_AMDGPU_TARGETS="gfx1101" bash ./ci/run.sh ~/results/llama.cpp /mnt/llama.cpp
1491-
14921468
ggml-ci-mac-metal:
14931469
runs-on: [self-hosted, macOS, ARM64]
14941470

.github/workflows/docker.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,15 @@ jobs:
8989
TYPE="-${{ matrix.config.tag }}"
9090
fi
9191
PREFIX="ghcr.io/${REPO_OWNER}/${REPO_NAME}:"
92+
CACHETAGS="${PREFIX}buildcache${TYPE}"
9293
FULLTAGS="${PREFIX}full${TYPE},${PREFIX}full${TYPE}-${{ steps.srctag.outputs.name }}"
9394
LIGHTTAGS="${PREFIX}light${TYPE},${PREFIX}light${TYPE}-${{ steps.srctag.outputs.name }}"
9495
SERVERTAGS="${PREFIX}server${TYPE},${PREFIX}server${TYPE}-${{ steps.srctag.outputs.name }}"
96+
echo "cache_output_tags=$CACHETAGS" >> $GITHUB_OUTPUT
9597
echo "full_output_tags=$FULLTAGS" >> $GITHUB_OUTPUT
9698
echo "light_output_tags=$LIGHTTAGS" >> $GITHUB_OUTPUT
9799
echo "server_output_tags=$SERVERTAGS" >> $GITHUB_OUTPUT
100+
echo "cache_output_tags=$CACHETAGS" # print out for debugging
98101
echo "full_output_tags=$FULLTAGS" # print out for debugging
99102
echo "light_output_tags=$LIGHTTAGS" # print out for debugging
100103
echo "server_output_tags=$SERVERTAGS" # print out for debugging
@@ -131,11 +134,14 @@ jobs:
131134
target: full
132135
provenance: false
133136
# using github experimental cache
134-
cache-from: type=gha
135-
cache-to: type=gha,mode=max
137+
#cache-from: type=gha
138+
#cache-to: type=gha,mode=max
136139
# return to this if the experimental github cache is having issues
137140
#cache-to: type=local,dest=/tmp/.buildx-cache
138141
#cache-from: type=local,src=/tmp/.buildx-cache
142+
# using registry cache (no storage limit)
143+
cache-from: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }}
144+
cache-to: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }},mode=max
139145

140146
- name: Build and push Light Docker image (tagged + versioned)
141147
if: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && matrix.config.light == true }}
@@ -150,11 +156,14 @@ jobs:
150156
target: light
151157
provenance: false
152158
# using github experimental cache
153-
cache-from: type=gha
154-
cache-to: type=gha,mode=max
159+
#cache-from: type=gha
160+
#cache-to: type=gha,mode=max
155161
# return to this if the experimental github cache is having issues
156162
#cache-to: type=local,dest=/tmp/.buildx-cache
157163
#cache-from: type=local,src=/tmp/.buildx-cache
164+
# using registry cache (no storage limit)
165+
cache-from: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }}
166+
cache-to: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }},mode=max
158167

159168
- name: Build and push Server Docker image (tagged + versioned)
160169
if: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && matrix.config.server == true }}
@@ -169,11 +178,14 @@ jobs:
169178
target: server
170179
provenance: false
171180
# using github experimental cache
172-
cache-from: type=gha
173-
cache-to: type=gha,mode=max
181+
#cache-from: type=gha
182+
#cache-to: type=gha,mode=max
174183
# return to this if the experimental github cache is having issues
175184
#cache-to: type=local,dest=/tmp/.buildx-cache
176185
#cache-from: type=local,src=/tmp/.buildx-cache
186+
# using registry cache (no storage limit)
187+
cache-from: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }}
188+
cache-to: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }},mode=max
177189

178190
create_tag:
179191
name: Create and push git tag

.github/workflows/release.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ jobs:
150150
- name: ccache
151151
uses: ggml-org/ccache-action@v1.2.16
152152
with:
153-
key: ubuntu-cpu-cmake
153+
key: ubuntu-cpu-cmake-${{ matrix.build }}
154154
evict-old-files: 1d
155155

156156
- name: Dependencies
@@ -543,10 +543,12 @@ jobs:
543543
id: checkout
544544
uses: actions/checkout@v4
545545

546-
- name: Clone rocWMMA repository
547-
id: clone_rocwmma
546+
- name: Grab rocWMMA package
547+
id: grab_rocwmma
548548
run: |
549-
git clone https://github.com/rocm/rocwmma --branch develop --depth 1
549+
curl -o rocwmma.deb "https://repo.radeon.com/rocm/apt/7.0.1/pool/main/r/rocwmma-dev/rocwmma-dev_2.0.0.70001-42~24.04_amd64.deb"
550+
7z x rocwmma.deb
551+
7z x data.tar
550552
551553
- name: Cache ROCm Installation
552554
id: cache-rocm
@@ -601,7 +603,7 @@ jobs:
601603
cmake -G "Unix Makefiles" -B build -S . `
602604
-DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" `
603605
-DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" `
604-
-DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/rocwmma/library/include/ -Wno-ignored-attributes -Wno-nested-anon-types" `
606+
-DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/opt/rocm-7.0.1/include/ -Wno-ignored-attributes -Wno-nested-anon-types" `
605607
-DCMAKE_BUILD_TYPE=Release `
606608
-DGGML_BACKEND_DL=ON `
607609
-DGGML_NATIVE=OFF `

CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
/common/build-info.* @ggerganov
1515
/common/common.* @ggerganov
1616
/common/console.* @ggerganov
17+
/common/http.* @angt
1718
/common/llguidance.* @ggerganov
1819
/common/log.* @ggerganov
1920
/common/sampling.* @ggerganov
@@ -60,6 +61,7 @@
6061
/ggml/src/ggml-cuda/mmvq.* @JohannesGaessler
6162
/ggml/src/ggml-impl.h @ggerganov @slaren
6263
/ggml/src/ggml-metal/ @ggerganov
64+
/ggml/src/ggml-opencl/ @lhez @max-krasnyansky
6365
/ggml/src/ggml-opt.cpp @JohannesGaessler
6466
/ggml/src/ggml-quants.* @ggerganov
6567
/ggml/src/ggml-rpc/ @rgerganov

ci/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ if [ ! -z ${GG_BUILD_NO_SVE} ]; then
114114
# arm 9 and newer enables sve by default, adjust these flags depending on the cpu used
115115
CMAKE_EXTRA="${CMAKE_EXTRA} -DGGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=armv8.5-a+fp16+i8mm"
116116
fi
117+
117118
## helpers
118119

119120
# download a file if it does not exist or if it is outdated

common/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ add_library(${TARGET} STATIC
5656
common.h
5757
console.cpp
5858
console.h
59+
http.h
5960
json-partial.cpp
6061
json-partial.h
6162
json-schema-to-grammar.cpp

0 commit comments

Comments
 (0)