Skip to content

Commit 5aac19d

Browse files
authored
Merge branch 'master' into Motif3
2 parents 6f51521 + e79e4bf commit 5aac19d

968 files changed

Lines changed: 70516 additions & 16585 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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ COPY --from=web /app/tools/ui/dist tools/ui/dist
5757
RUN HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" \
5858
cmake -S . -B build \
5959
-DGGML_HIP=ON \
60-
-DGGML_HIP_ROCWMMA_FATTN=ON \
6160
-DAMDGPU_TARGETS="$ROCM_DOCKER_ARCH" \
6261
-DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON \
6362
-DCMAKE_BUILD_TYPE=Release -DLLAMA_BUILD_TESTS=OFF \

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ inputs:
44
cuda_version:
55
description: "CUDA toolkit version"
66
required: true
7+
cuda_arch:
8+
description: "CUDA target architecture"
9+
required: false
10+
default: "x64"
711

812
runs:
913
using: "composite"
@@ -127,3 +131,26 @@ runs:
127131
echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.3\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
128132
echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.3" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
129133
echo "CUDA_PATH_V13_3=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.3" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
134+
135+
- name: Install Cuda Toolkit 13.4 for ARM64
136+
if: ${{ inputs.cuda_version == '13.4' && inputs.cuda_arch == 'arm64' }}
137+
shell: pwsh
138+
run: |
139+
mkdir -p "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4"
140+
choco install unzip -y
141+
curl -O "https://packages.nvidia.com/bin-archive/pool/windows-x86_64/5B515474-7E78-11F1-8656-C51E4F4B317F/cccl-windows-x86_64-13.3.4.1.2-archive.zip"
142+
curl -O "https://packages.nvidia.com/bin-archive/pool/windows-x86_64/5B515474-7E78-11F1-8656-C51E4F4B317F/cuda_crt-windows-x86_64-13.4.46-archive.zip"
143+
curl -O "https://packages.nvidia.com/bin-archive/pool/windows-x86_64/5B515474-7E78-11F1-8656-C51E4F4B317F/cuda_nvcc-windows-x86_64-13.4.46-archive.zip"
144+
curl -O "https://packages.nvidia.com/bin-archive/pool/windows-x86_64/5B515474-7E78-11F1-8656-C51E4F4B317F/libnvvm-windows-x86_64-13.4.46-archive.zip"
145+
curl -O "https://packages.nvidia.com/bin-archive/pool/windows-arm64/5B515474-7E78-11F1-8656-C51E4F4B317F/cuda_cudart-windows-arm64-13.4.46-archive.zip"
146+
curl -O "https://packages.nvidia.com/bin-archive/pool/windows-arm64/5B515474-7E78-11F1-8656-C51E4F4B317F/libcublas-windows-arm64-13.7.0.10-archive.zip"
147+
unzip '*.zip' -d "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4"
148+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4\cccl-windows-x86_64-13.3.4.1.2-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4" /E /I /H /Y
149+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4\cuda_crt-windows-x86_64-13.4.46-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4" /E /I /H /Y
150+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4\cuda_nvcc-windows-x86_64-13.4.46-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4" /E /I /H /Y
151+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4\libnvvm-windows-x86_64-13.4.46-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4" /E /I /H /Y
152+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4\cuda_cudart-windows-arm64-13.4.46-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4" /E /I /H /Y
153+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4\libcublas-windows-arm64-13.7.0.10-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4" /E /I /H /Y
154+
echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
155+
echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
156+
echo "CUDA_PATH_V13_4=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.4" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8

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

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,26 @@ inputs:
88
runs:
99
using: "composite"
1010
steps:
11-
- name: Setup ROCm
12-
uses: ./.github/actions/install-exe
13-
with:
14-
url: https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ inputs.version }}-Win11-For-HIP.exe
15-
args: -install
11+
- name: Install ROCm with Wheels
12+
shell: pwsh
13+
run: |
14+
$ErrorActionPreference = "Stop"
15+
write-host "Setting up Python virtual environment"
16+
17+
# Create the venv directly at the cache location to avoid relocation issues
18+
New-Item -Path "C:\TheRock\build" -ItemType Directory -Force | Out-Null
19+
python -m venv C:\TheRock\build\.venv
20+
& C:\TheRock\build\.venv\Scripts\Activate.ps1
21+
22+
write-host "Upgrading pip"
23+
python -m pip install --upgrade pip
24+
25+
write-host "Installing ROCm wheels for multi-arch support"
26+
# Install ROCm wheels for multi-arch support (this may take several minutes)
27+
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "rocm[libraries,devel]==${{ inputs.version }}"
28+
29+
# Pre-expand the devel tree so it is included in the cache
30+
write-host "Initializing ROCm devel tree"
31+
rocm-sdk init
32+
if ($LASTEXITCODE -ne 0) { throw "rocm-sdk init failed with exit code $LASTEXITCODE" }
33+
write-host "Completed ROCm wheel installation to C:\TheRock\build"

.github/workflows/build-apple.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ jobs:
6060
-DCMAKE_BUILD_RPATH="@loader_path" \
6161
-DLLAMA_FATAL_WARNINGS=ON \
6262
-DLLAMA_BUILD_BORINGSSL=ON \
63-
-DGGML_METAL_USE_BF16=ON \
6463
-DGGML_METAL_EMBED_LIBRARY=OFF \
6564
-DGGML_METAL_SHADER_DEBUG=ON \
66-
-DGGML_RPC=ON
65+
-DGGML_RPC=ON \
66+
-DCMAKE_OSX_DEPLOYMENT_TARGET=13.3
6767
time cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
6868
leaks -atExit -- ./build/bin/test-thread-safety -hf ggml-org/gemma-3-270m-qat-GGUF -ngl 99 -p "$(printf 'hello %.0s' {1..128})" -n 16 -c 512 -ub 32 -np 2 -t 2 -lv 1
6969
@@ -126,7 +126,6 @@ jobs:
126126
run: |
127127
sysctl -a
128128
cmake -B build -G Xcode \
129-
-DGGML_METAL_USE_BF16=ON \
130129
-DGGML_METAL_EMBED_LIBRARY=ON \
131130
-DLLAMA_OPENSSL=OFF \
132131
-DLLAMA_BUILD_APP=OFF \
@@ -177,7 +176,6 @@ jobs:
177176
run: |
178177
sysctl -a
179178
cmake -B build -G Xcode \
180-
-DGGML_METAL_USE_BF16=ON \
181179
-DGGML_METAL_EMBED_LIBRARY=ON \
182180
-DLLAMA_BUILD_COMMON=OFF \
183181
-DLLAMA_BUILD_APP=OFF \
@@ -211,7 +209,6 @@ jobs:
211209
run: |
212210
sysctl -a
213211
cmake -B build -G Xcode \
214-
-DGGML_METAL_USE_BF16=ON \
215212
-DGGML_METAL_EMBED_LIBRARY=ON \
216213
-DLLAMA_BUILD_COMMON=OFF \
217214
-DLLAMA_BUILD_APP=OFF \
@@ -256,7 +253,6 @@ jobs:
256253
run: |
257254
sysctl -a
258255
cmake -B build -G Xcode \
259-
-DGGML_METAL_USE_BF16=ON \
260256
-DGGML_METAL_EMBED_LIBRARY=ON \
261257
-DLLAMA_OPENSSL=OFF \
262258
-DLLAMA_BUILD_APP=OFF \

.github/workflows/build-cache.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -119,27 +119,27 @@ jobs:
119119
version_major: ${{ env.OPENVINO_VERSION_MAJOR }}
120120
version_full: ${{ env.OPENVINO_VERSION_FULL }}
121121

122-
windows-2022-rocm-cache:
123-
runs-on: windows-2022
124-
125-
env:
126-
# Make sure this is in sync with build.yml
127-
HIPSDK_INSTALLER_VERSION: "26.Q1"
128-
129-
steps:
130-
- name: Clone
131-
id: checkout
132-
uses: actions/checkout@v6
133-
134-
- name: Setup Cache
135-
uses: actions/cache@v5
136-
id: cache-rocm
137-
with:
138-
path: C:\Program Files\AMD\ROCm
139-
key: cache-gha-rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }}
140-
141-
- name: Setup ROCm
142-
if: steps.cache-rocm.outputs.cache-hit != 'true'
143-
uses: ./.github/actions/windows-setup-rocm
144-
with:
145-
version: ${{ env.HIPSDK_INSTALLER_VERSION }}
122+
# windows-2022-rocm-cache:
123+
# runs-on: windows-2022
124+
125+
# env:
126+
# # Make sure this is in sync with release.yml and build-cuda-windows.yml
127+
# ROCM_VERSION: "7.14.0"
128+
129+
# steps:
130+
# - name: Clone
131+
# id: checkout
132+
# uses: actions/checkout@v6
133+
134+
# - name: Setup Cache
135+
# uses: actions/cache@v5
136+
# id: cache-rocm
137+
# with:
138+
# path: C:\TheRock\build
139+
# key: rocm-wheels-${{ env.ROCM_VERSION }}-multi-arch-${{ runner.os }}
140+
141+
# - name: Setup ROCm
142+
# if: steps.cache-rocm.outputs.cache-hit != 'true'
143+
# uses: ./.github/actions/windows-setup-rocm
144+
# with:
145+
# version: ${{ env.ROCM_VERSION }}

.github/workflows/build-cmake-pkg.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55

66
jobs:
77
linux:
8-
runs-on: [self-hosted, Linux, CPU]
8+
runs-on: [self-hosted, Linux]
99
steps:
1010
- uses: actions/checkout@v6
1111
with:
@@ -21,15 +21,21 @@ jobs:
2121
-DLLAMA_BUILD_TOOLS=OFF \
2222
-DLLAMA_BUILD_EXAMPLES=OFF \
2323
-DLLAMA_BUILD_APP=OFF \
24+
-DLLAMA_BUILD_IS_DEV=OFF \
2425
-DCMAKE_BUILD_TYPE=Release
25-
cmake --build build --config Release
26+
cmake --build build --config Release -j $(nproc)
2627
cmake --install build --prefix "$PREFIX" --config Release
2728
2829
export LLAMA_CONFIG="$PREFIX"/lib/cmake/llama/llama-config.cmake
2930
tclsh <<'EOF'
3031
set build(commit) [string trim [exec git rev-parse --short HEAD]]
3132
set build(number) [string trim [exec git rev-list --count HEAD]]
32-
set build(version) "0.0.$build(number)"
33+
34+
set cmakelists [read [open "CMakeLists.txt" r]]
35+
regexp {set\(LLAMA_VERSION_MAJOR\s+(\d+)\)} $cmakelists -> major
36+
regexp {set\(LLAMA_VERSION_MINOR\s+(\d+)\)} $cmakelists -> minor
37+
regexp {set\(LLAMA_VERSION_PATCH\s+(\d+)\)} $cmakelists -> patch
38+
set build(version) "$major.$minor.$patch"
3339
3440
set llamaconfig [read [open "$env(LLAMA_CONFIG)" r]]
3541
set checks [list "set\\(LLAMA_VERSION \\s+$build(version)\\)" \
@@ -48,4 +54,4 @@ jobs:
4854
4955
cd examples/simple-cmake-pkg
5056
cmake -S . -B build -DCMAKE_PREFIX_PATH="$PREFIX"/lib/cmake
51-
cmake --build build
57+
cmake --build build -j $(nproc)

.github/workflows/build-cpu.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@ jobs:
9494
id: cmake_build
9595
run: |
9696
cmake -B build \
97+
-DGGML_NATIVE=OFF \
9798
-DLLAMA_FATAL_WARNINGS=ON \
98-
-DGGML_RPC=ON
99+
-DGGML_RPC=ON \
100+
-DGGML_NATIVE=OFF
99101
time cmake --build build --config Release -j $(nproc)
100102
101103
- name: Test

.github/workflows/build-cuda-ubuntu.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ jobs:
9999
run: |
100100
cmake -B build -S . \
101101
-DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \
102-
-DGGML_HIP_ROCWMMA_FATTN=ON \
103102
-DGPU_TARGETS="gfx1030" \
104103
-DGGML_HIP=ON
105104
cmake --build build --config Release -j $(nproc)

.github/workflows/build-cuda-windows.yml

Lines changed: 50 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383

8484
env:
8585
# Make sure this is in sync with build-cache.yml
86-
HIPSDK_INSTALLER_VERSION: "26.Q1"
86+
ROCM_VERSION: "7.14.0"
8787

8888
strategy:
8989
matrix:
@@ -97,66 +97,81 @@ jobs:
9797
id: checkout
9898
uses: actions/checkout@v6
9999

100-
- name: Grab rocWMMA package
101-
id: grab_rocwmma
102-
run: |
103-
curl -o rocwmma.deb "https://repo.radeon.com/rocm/apt/7.2.1/pool/main/r/rocwmma-dev/rocwmma-dev_2.2.0.70201-81~24.04_amd64.deb"
104-
7z x rocwmma.deb
105-
7z x data.tar
106-
107-
- name: Use ROCm Installation Cache
108-
uses: actions/cache@v5
109-
id: cache-rocm
110-
with:
111-
path: C:\Program Files\AMD\ROCm
112-
key: cache-gha-rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }}
100+
# - name: Cache ROCm Installation
101+
# uses: actions/cache@v5
102+
# id: cache-rocm
103+
# with:
104+
# path: C:\TheRock\build
105+
# key: rocm-wheels-${{ env.ROCM_VERSION }}-multi-arch-${{ runner.os }}
113106

114107
- name: Setup ROCm
115-
if: steps.cache-rocm.outputs.cache-hit != 'true'
108+
# if: steps.cache-rocm.outputs.cache-hit != 'true'
116109
uses: ./.github/actions/windows-setup-rocm
117110
with:
118-
version: ${{ env.HIPSDK_INSTALLER_VERSION }}
111+
version: ${{ env.ROCM_VERSION }}
112+
113+
- name: Setup ROCm Environment
114+
run: |
115+
$ErrorActionPreference = "Stop"
116+
117+
# Activate venv from cache or fresh install
118+
& C:\TheRock\build\.venv\Scripts\Activate.ps1
119+
120+
# Expand the devel tree (idempotent; no-op if already done during install)
121+
rocm-sdk init
122+
if ($LASTEXITCODE -ne 0) { throw "rocm-sdk init failed with exit code $LASTEXITCODE" }
123+
124+
# Get ROCm installation paths using the rocm-sdk CLI tool
125+
$rocmPath = (rocm-sdk path --root)
126+
if (-not $rocmPath) { throw "rocm-sdk path --root returned empty - devel package may not be installed" }
127+
$rocmPath = $rocmPath.Trim()
128+
$cmakePath = (rocm-sdk path --cmake).Trim()
129+
$binPath = (rocm-sdk path --bin).Trim()
130+
write-host "ROCm root: $rocmPath"
131+
132+
echo "HIP_PATH=$rocmPath" >> $env:GITHUB_ENV
133+
echo "CMAKE_PREFIX_PATH=$cmakePath" >> $env:GITHUB_ENV
134+
echo "HIP_DEVICE_LIB_PATH=$rocmPath\lib\llvm\amdgcn\bitcode" >> $env:GITHUB_ENV
135+
echo "HIP_PLATFORM=amd" >> $env:GITHUB_ENV
136+
echo "LLVM_PATH=$rocmPath\lib\llvm" >> $env:GITHUB_ENV
137+
echo "$binPath" >> $env:GITHUB_PATH
138+
139+
# Keep venv in PATH for subsequent steps
140+
echo "C:\TheRock\build\.venv\Scripts" >> $env:GITHUB_PATH
119141
120142
- name: Verify ROCm
121143
id: verify
122144
run: |
123-
# Find and test ROCm installation
124-
$clangPath = Get-ChildItem 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | Select-Object -First 1
125-
if (-not $clangPath) {
126-
Write-Error "ROCm installation not found"
127-
exit 1
128-
}
129-
& $clangPath.FullName --version
145+
# Test the ROCm clang shipped in the installed wheel
146+
& "${env:HIP_PATH}\lib\llvm\bin\clang.exe" --version
130147
131148
- name: ccache
132149
uses: ggml-org/ccache-action@v1.2.21
133150
with:
134151
# TODO: this build does not match the build in release.yml, so we use a different cache key
135152
# ideally, the builds should match, similar to the CUDA build above so that we would be able
136153
# to populate the ccache for the release with manual runs of this workflow
137-
#key: release-windows-2022-x64-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ matrix.name }}
138-
key: cuda-windows-2022-x64-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ matrix.name }}
154+
#key: release-windows-2022-x64-hip-${{ env.ROCM_VERSION }}-${{ matrix.name }}
155+
key: cuda-windows-2022-x64-hip-${{ env.ROCM_VERSION }}-${{ matrix.name }}
139156

140157
- name: Build
141158
id: cmake_build
142159
run: |
143-
$env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
144-
$env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
145160
cmake -G "Unix Makefiles" -B build -S . `
146-
-DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" `
147-
-DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" `
148-
-DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/opt/rocm-7.2.1/include/" `
161+
-DCMAKE_PREFIX_PATH="${env:HIP_PATH}" `
162+
-DCMAKE_C_COMPILER="${env:HIP_PATH}\lib\llvm\bin\clang.exe" `
163+
-DCMAKE_CXX_COMPILER="${env:HIP_PATH}\lib\llvm\bin\clang++.exe" `
164+
-DCMAKE_HIP_COMPILER="${env:HIP_PATH}\lib\llvm\bin\clang.exe" `
149165
-DCMAKE_BUILD_TYPE=Release `
150166
-DLLAMA_BUILD_BORINGSSL=ON `
151-
-DROCM_DIR="${env:HIP_PATH}" `
167+
-DHIP_PATH="${env:HIP_PATH}" `
152168
-DGGML_HIP=ON `
153-
-DGGML_HIP_ROCWMMA_FATTN=ON `
154-
-DGPU_TARGETS="gfx1100" `
169+
-DGPU_TARGETS="gfx1100" `
155170
-DGGML_RPC=ON
156171
cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
157172
158173
- name: ccache-clear
159174
uses: ./.github/actions/ccache-clear
160175
with:
161-
#key: release-windows-2022-x64-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ matrix.name }}
162-
key: cuda-windows-2022-x64-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ matrix.name }}
176+
#key: release-windows-2022-x64-hip-${{ env.ROCM_VERSION }}-${{ matrix.name }}
177+
key: cuda-windows-2022-x64-hip-${{ env.ROCM_VERSION }}-${{ matrix.name }}

0 commit comments

Comments
 (0)