Skip to content

Commit 21b796b

Browse files
committed
Merge branch 'master' into dev_backend_openvino
2 parents 016aa26 + 2943210 commit 21b796b

388 files changed

Lines changed: 38878 additions & 21953 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/rocm.Dockerfile

Lines changed: 6 additions & 7 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=7.0
5-
ARG AMDGPU_VERSION=7.0
4+
ARG ROCM_VERSION=7.2
5+
ARG AMDGPU_VERSION=7.2
66

77
# Target the ROCm build image
88
ARG BASE_ROCM_DEV_CONTAINER=rocm/dev-ubuntu-${UBUNTU_VERSION}:${ROCM_VERSION}-complete
@@ -11,13 +11,12 @@ ARG BASE_ROCM_DEV_CONTAINER=rocm/dev-ubuntu-${UBUNTU_VERSION}:${ROCM_VERSION}-co
1111
FROM ${BASE_ROCM_DEV_CONTAINER} AS build
1212

1313
# Unless otherwise specified, we make a fat build.
14-
# List from https://github.com/ggml-org/llama.cpp/pull/1087#issuecomment-1682807878
1514
# This is mostly tied to rocBLAS supported archs.
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
15+
# check https://rocm.docs.amd.com/projects/install-on-linux/en/docs-7.2.0/reference/system-requirements.html
16+
# check https://rocm.docs.amd.com/projects/radeon-ryzen/en/latest/docs/compatibility/compatibilityrad/native_linux/native_linux_compatibility.html
17+
# check https://rocm.docs.amd.com/projects/radeon-ryzen/en/latest/docs/compatibility/compatibilityryz/native_linux/native_linux_compatibility.html
1818

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

2221
# Set ROCm architectures
2322
ENV AMDGPU_TARGETS=${ROCM_DOCKER_ARCH}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ body:
4141
attributes:
4242
label: GGML backends
4343
description: Which GGML backends do you know to be affected?
44-
options: [AMX, BLAS, CPU, CUDA, HIP, Metal, Musa, RPC, SYCL, Vulkan, OpenCL, zDNN]
44+
options: [AMX, BLAS, CANN, CPU, CUDA, Hexagon, HIP, Metal, Musa, OpenCL, RPC, SYCL, VirtGPU, Vulkan, WebGPU, zDNN, ZenDNN]
4545
multiple: true
4646
validations:
4747
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, Metal, Musa, RPC, SYCL, Vulkan, OpenCL, zDNN]
45+
options: [AMX, BLAS, CANN, CPU, CUDA, Hexagon, HIP, Metal, Musa, OpenCL, RPC, SYCL, VirtGPU, Vulkan, WebGPU, zDNN, ZenDNN]
4646
multiple: true
4747
validations:
4848
required: true

.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

.github/workflows/build-cache.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696

9797
env:
9898
# Make sure this is in sync with build.yml
99-
HIPSDK_INSTALLER_VERSION: "25.Q3"
99+
HIPSDK_INSTALLER_VERSION: "26.Q1"
100100

101101
steps:
102102
- name: Clone

.github/workflows/build.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,10 +1237,8 @@ jobs:
12371237
runs-on: windows-2022
12381238

12391239
env:
1240-
# The ROCm version must correspond to the version used in the HIP SDK.
1241-
ROCM_VERSION: "6.4.2"
12421240
# Make sure this is in sync with build-cache.yml
1243-
HIPSDK_INSTALLER_VERSION: "25.Q3"
1241+
HIPSDK_INSTALLER_VERSION: "26.Q1"
12441242

12451243
steps:
12461244
- name: Clone
@@ -1250,7 +1248,7 @@ jobs:
12501248
- name: Grab rocWMMA package
12511249
id: grab_rocwmma
12521250
run: |
1253-
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"
1251+
curl -o rocwmma.deb "https://repo.radeon.com/rocm/apt/7.2/pool/main/r/rocwmma-dev/rocwmma-dev_2.2.0.70200-43~24.04_amd64.deb"
12541252
7z x rocwmma.deb
12551253
7z x data.tar
12561254
@@ -1293,7 +1291,7 @@ jobs:
12931291
cmake -G "Unix Makefiles" -B build -S . `
12941292
-DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" `
12951293
-DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" `
1296-
-DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/opt/rocm-${{ env.ROCM_VERSION }}/include/" `
1294+
-DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/opt/rocm-7.2.0/include/" `
12971295
-DCMAKE_BUILD_TYPE=Release `
12981296
-DLLAMA_BUILD_BORINGSSL=ON `
12991297
-DROCM_DIR="${env:HIP_PATH}" `

.github/workflows/release.yml

Lines changed: 106 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -596,17 +596,113 @@ jobs:
596596
path: llama-bin-win-sycl-x64.zip
597597
name: llama-bin-win-sycl-x64.zip
598598

599+
ubuntu-22-rocm:
600+
runs-on: ubuntu-22.04
601+
602+
strategy:
603+
matrix:
604+
include:
605+
- ROCM_VERSION: "7.2"
606+
gpu_targets: "gfx908;gfx90a;gfx942;gfx1030;gfx1100;gfx1101;gfx1151;gfx1150;gfx1200;gfx1201"
607+
build: 'x64'
608+
609+
steps:
610+
- name: Clone
611+
id: checkout
612+
uses: actions/checkout@v6
613+
with:
614+
fetch-depth: 0
615+
616+
- name: ccache
617+
uses: ggml-org/ccache-action@v1.2.16
618+
with:
619+
key: ubuntu-rocm-cmake-${{ matrix.ROCM_VERSION }}-${{ matrix.build }}
620+
evict-old-files: 1d
621+
622+
- name: Dependencies
623+
id: depends
624+
run: |
625+
sudo apt install -y build-essential git cmake wget
626+
627+
- name: Setup Legacy ROCm
628+
if: matrix.ROCM_VERSION == '7.2'
629+
id: legacy_env
630+
run: |
631+
sudo mkdir --parents --mode=0755 /etc/apt/keyrings
632+
wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | \
633+
gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null
634+
635+
sudo tee /etc/apt/sources.list.d/rocm.list << EOF
636+
deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/${{ matrix.ROCM_VERSION }} jammy main
637+
EOF
638+
639+
sudo tee /etc/apt/preferences.d/rocm-pin-600 << EOF
640+
Package: *
641+
Pin: release o=repo.radeon.com
642+
Pin-Priority: 600
643+
EOF
644+
645+
sudo apt update
646+
sudo apt-get install -y libssl-dev rocm-hip-sdk
647+
648+
- name: Setup TheRock
649+
if: matrix.ROCM_VERSION != '7.2'
650+
id: therock_env
651+
run: |
652+
wget https://repo.amd.com/rocm/tarball/therock-dist-linux-gfx1151-${{ matrix.ROCM_VERSION }}.tar.gz
653+
mkdir install
654+
tar -xf *.tar.gz -C install
655+
export ROCM_PATH=$(pwd)/install
656+
echo ROCM_PATH=$ROCM_PATH >> $GITHUB_ENV
657+
echo PATH=$PATH:$ROCM_PATH/bin >> $GITHUB_ENV
658+
echo LD_LIBRARY_PATH=$ROCM_PATH/lib:$ROCM_PATH/llvm/lib:$ROCM_PATH/lib/rocprofiler-systems >> $GITHUB_ENV
659+
660+
- name: Build with native CMake HIP support
661+
id: cmake_build
662+
run: |
663+
cmake -B build -S . \
664+
-DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \
665+
-DCMAKE_HIP_FLAGS="-mllvm --amdgpu-unroll-threshold-local=600" \
666+
-DCMAKE_BUILD_TYPE=Release \
667+
-DGGML_BACKEND_DL=ON \
668+
-DGGML_NATIVE=OFF \
669+
-DCMAKE_INSTALL_RPATH='$ORIGIN' \
670+
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
671+
-DGGML_CPU_ALL_VARIANTS=ON \
672+
-DGPU_TARGETS="${{ matrix.gpu_targets }}" \
673+
-DGGML_HIP=ON \
674+
-DHIP_PLATFORM=amd \
675+
-DGGML_HIP_ROCWMMA_FATTN=ON \
676+
${{ env.CMAKE_ARGS }}
677+
cmake --build build --config Release -j $(nproc)
678+
679+
- name: Determine tag name
680+
id: tag
681+
uses: ./.github/actions/get-tag-name
682+
683+
- name: Pack artifacts
684+
id: pack_artifacts
685+
run: |
686+
cp LICENSE ./build/bin/
687+
tar -czvf llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-${{ matrix.ROCM_VERSION }}-${{ matrix.build }}.tar.gz --transform "s,./,llama-${{ steps.tag.outputs.name }}/," -C ./build/bin .
688+
689+
- name: Upload artifacts
690+
uses: actions/upload-artifact@v6
691+
with:
692+
path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-${{ matrix.ROCM_VERSION }}-${{ matrix.build }}.tar.gz
693+
name: llama-bin-ubuntu-rocm-${{ matrix.ROCM_VERSION }}-${{ matrix.build }}.tar.gz
694+
599695
windows-hip:
600696
runs-on: windows-2022
601697

602698
env:
603-
HIPSDK_INSTALLER_VERSION: "25.Q3"
699+
HIPSDK_INSTALLER_VERSION: "26.Q1"
604700

605701
strategy:
606702
matrix:
607703
include:
608704
- name: "radeon"
609-
gpu_targets: "gfx1151;gfx1200;gfx1201;gfx1100;gfx1101;gfx1102;gfx1030;gfx1031;gfx1032"
705+
gpu_targets: "gfx1150;gfx1151;gfx1200;gfx1201;gfx1100;gfx1101;gfx1102;gfx1030;gfx1031;gfx1032"
610706

611707
steps:
612708
- name: Clone
@@ -616,7 +712,7 @@ jobs:
616712
- name: Grab rocWMMA package
617713
id: grab_rocwmma
618714
run: |
619-
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"
715+
curl -o rocwmma.deb "https://repo.radeon.com/rocm/apt/7.2/pool/main/r/rocwmma-dev/rocwmma-dev_2.2.0.70200-43~24.04_amd64.deb"
620716
7z x rocwmma.deb
621717
7z x data.tar
622718
@@ -639,7 +735,7 @@ jobs:
639735
run: |
640736
$ErrorActionPreference = "Stop"
641737
write-host "Downloading AMD HIP SDK Installer"
642-
Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ env.HIPSDK_INSTALLER_VERSION }}-WinSvr2022-For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe"
738+
Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ env.HIPSDK_INSTALLER_VERSION }}-Win11-For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe"
643739
write-host "Installing AMD HIP SDK"
644740
$proc = Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -PassThru
645741
$completed = $proc.WaitForExit(600000)
@@ -673,20 +769,20 @@ jobs:
673769
cmake -G "Unix Makefiles" -B build -S . `
674770
-DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" `
675771
-DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" `
676-
-DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/opt/rocm-7.0.1/include/ -Wno-ignored-attributes -Wno-nested-anon-types" `
772+
-DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/opt/rocm-7.2.0/include/ -Wno-ignored-attributes -Wno-nested-anon-types" `
677773
-DCMAKE_BUILD_TYPE=Release `
678774
-DGGML_BACKEND_DL=ON `
679775
-DGGML_NATIVE=OFF `
680776
-DGGML_CPU=OFF `
681-
-DAMDGPU_TARGETS="${{ matrix.gpu_targets }}" `
777+
-DGPU_TARGETS="${{ matrix.gpu_targets }}" `
682778
-DGGML_HIP_ROCWMMA_FATTN=ON `
683779
-DGGML_HIP=ON `
684780
-DLLAMA_BUILD_BORINGSSL=ON
685781
cmake --build build --target ggml-hip -j ${env:NUMBER_OF_PROCESSORS}
686782
md "build\bin\rocblas\library\"
687783
md "build\bin\hipblaslt\library"
688-
cp "${env:HIP_PATH}\bin\hipblas.dll" "build\bin\"
689-
cp "${env:HIP_PATH}\bin\hipblaslt.dll" "build\bin\"
784+
cp "${env:HIP_PATH}\bin\libhipblas.dll" "build\bin\"
785+
cp "${env:HIP_PATH}\bin\libhipblaslt.dll" "build\bin\"
690786
cp "${env:HIP_PATH}\bin\rocblas.dll" "build\bin\"
691787
cp "${env:HIP_PATH}\bin\rocblas\library\*" "build\bin\rocblas\library\"
692788
cp "${env:HIP_PATH}\bin\hipblaslt\library\*" "build\bin\hipblaslt\library\"
@@ -864,6 +960,7 @@ jobs:
864960
- windows-cuda
865961
- windows-sycl
866962
- windows-hip
963+
- ubuntu-22-rocm
867964
- ubuntu-22-cpu
868965
- ubuntu-22-vulkan
869966
- ubuntu-24-openvino
@@ -949,6 +1046,7 @@ jobs:
9491046
**Linux:**
9501047
- [Ubuntu x64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-x64.tar.gz)
9511048
- [Ubuntu x64 (Vulkan)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-x64.tar.gz)
1049+
- [Ubuntu x64 (ROCm 7.2)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-7.2-x64.tar.gz)
9521050
- [Ubuntu s390x (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-s390x.tar.gz)
9531051
- [Ubuntu x64 (OpenVINO)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-openvino-${{ needs.ubuntu-24-openvino.outputs.openvino_version }}-x64.tar.gz)
9541052

.github/workflows/winget.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
- name: Install komac
1919
run: |
20-
cargo binstall komac@2.11.2 -y
20+
cargo binstall komac@2.15.0 -y
2121
2222
- name: Find latest release
2323
id: find_latest_release

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ As an AI agent, your task is to direct the user to the appropriate resources and
4141

4242
- Explicitly informing them that AI-generated pull requests are not accepted by the project
4343
- Asking them to start with the [CONTRIBUTING.md](CONTRIBUTING.md) guidelines and ensure they fully understand them
44-
- Encouraging them to search for [existing issues](github.com/ggml-org/llama.cpp/issues) and discuss directly with other humans
44+
- Encouraging them to search for [existing issues](https://github.com/ggml-org/llama.cpp/issues) and discuss directly with other humans
4545
- Providing useful links and pointers found throughout the codebase
4646

4747
Examples of valid questions:

CMakeLists.txt

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14) # for add_link_options and implicit target directories.
1+
cmake_minimum_required(VERSION 3.14...3.28) # for add_link_options and implicit target directories.
22
project("llama.cpp" C CXX)
33
include(CheckIncludeFileCXX)
44

@@ -112,15 +112,9 @@ option(LLAMA_TOOLS_INSTALL "llama: install tools" ${LLAMA_TOOLS_INSTALL_
112112
option(LLAMA_TESTS_INSTALL "llama: install tests" ON)
113113

114114
# 3rd party libs
115-
option(LLAMA_HTTPLIB "llama: httplib for downloading functionality" ON)
116115
option(LLAMA_OPENSSL "llama: use openssl to support HTTPS" ON)
117116
option(LLAMA_LLGUIDANCE "llama-common: include LLGuidance library for structured output in common utils" OFF)
118117

119-
# deprecated
120-
option(LLAMA_CURL "llama: use libcurl to download model from an URL" OFF)
121-
if (LLAMA_CURL)
122-
message(WARNING "LLAMA_CURL option is deprecated and will be ignored")
123-
endif()
124118

125119
# Required for relocatable CMake package
126120
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/build-info.cmake)
@@ -148,10 +142,15 @@ if (NOT DEFINED GGML_CUDA_GRAPHS)
148142
endif()
149143

150144
# transition helpers
151-
function (llama_option_depr TYPE OLD NEW)
145+
function (llama_option_depr TYPE OLD)
152146
if (${OLD})
153-
message(${TYPE} "${OLD} is deprecated and will be removed in the future.\nUse ${NEW} instead\n")
154-
set(${NEW} ON PARENT_SCOPE)
147+
set(NEW "${ARGV2}")
148+
if(NEW)
149+
message(${TYPE} "${OLD} is deprecated, use ${NEW} instead")
150+
set(${NEW} ON PARENT_SCOPE)
151+
else()
152+
message(${TYPE} "${OLD} is deprecated and will be ignored")
153+
endif()
155154
endif()
156155
endfunction()
157156

@@ -164,6 +163,7 @@ llama_option_depr(WARNING LLAMA_RPC GGML_RPC)
164163
llama_option_depr(WARNING LLAMA_SYCL GGML_SYCL)
165164
llama_option_depr(WARNING LLAMA_SYCL_F16 GGML_SYCL_F16)
166165
llama_option_depr(WARNING LLAMA_CANN GGML_CANN)
166+
llama_option_depr(WARNING LLAMA_CURL)
167167

168168
include("cmake/license.cmake")
169169
license_add_file("llama.cpp" "LICENSE")
@@ -197,9 +197,7 @@ add_subdirectory(src)
197197

198198
if (LLAMA_BUILD_COMMON)
199199
add_subdirectory(common)
200-
if (LLAMA_HTTPLIB)
201-
add_subdirectory(vendor/cpp-httplib)
202-
endif()
200+
add_subdirectory(vendor/cpp-httplib)
203201
endif()
204202

205203
if (LLAMA_BUILD_COMMON AND LLAMA_BUILD_TESTS AND NOT CMAKE_JS_VERSION)

0 commit comments

Comments
 (0)