Skip to content

Commit bbb592d

Browse files
authored
Merge branch 'master' into master
2 parents 8bb8680 + 56b4795 commit bbb592d

File tree

277 files changed

+7675
-3196
lines changed

Some content is hidden

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

277 files changed

+7675
-3196
lines changed

.devops/intel.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG ONEAPI_VERSION=2025.1.1-0-devel-ubuntu24.04
1+
ARG ONEAPI_VERSION=2025.2.2-0-devel-ubuntu24.04
22

33
## Build Image
44

5-
FROM intel/oneapi-basekit:$ONEAPI_VERSION AS build
5+
FROM intel/deep-learning-essentials:$ONEAPI_VERSION AS build
66

77
ARG GGML_SYCL_F16=OFF
88
RUN apt-get update && \
@@ -31,7 +31,7 @@ RUN mkdir -p /app/full \
3131
&& cp requirements.txt /app/full \
3232
&& cp .devops/tools.sh /app/full/tools.sh
3333

34-
FROM intel/oneapi-basekit:$ONEAPI_VERSION AS base
34+
FROM intel/deep-learning-essentials:$ONEAPI_VERSION AS base
3535

3636
RUN apt-get update \
3737
&& apt-get install -y libgomp1 curl\

.devops/nix/package.nix

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,6 @@ effectiveStdenv.mkDerivation (finalAttrs: {
128128
};
129129

130130
postPatch = ''
131-
substituteInPlace ./ggml/src/ggml-metal/ggml-metal.m \
132-
--replace '[bundle pathForResource:@"ggml-metal" ofType:@"metal"];' "@\"$out/bin/ggml-metal.metal\";"
133-
substituteInPlace ./ggml/src/ggml-metal/ggml-metal.m \
134-
--replace '[bundle pathForResource:@"default" ofType:@"metallib"];' "@\"$out/bin/default.metallib\";"
135131
'';
136132

137133
# With PR#6015 https://github.com/ggml-org/llama.cpp/pull/6015,

.devops/rocm.Dockerfile

Lines changed: 4 additions & 8 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,9 +13,8 @@ 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

2019
ARG ROCM_DOCKER_ARCH='gfx803;gfx900;gfx906;gfx908;gfx90a;gfx942;gfx1010;gfx1030;gfx1032;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201;gfx1151'
2120
#ARG ROCM_DOCKER_ARCH='gfx1151'
@@ -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 \
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "Install exe"
2+
description: "Download and install exe"
3+
inputs:
4+
url:
5+
description: "URL of the exe installer"
6+
required: true
7+
args:
8+
description: "Installer arguments"
9+
required: true
10+
timeout:
11+
description: "Timeout (in ms)"
12+
required: false
13+
default: "600000"
14+
15+
runs:
16+
using: "composite"
17+
steps:
18+
- name: Install EXE
19+
shell: pwsh
20+
run: |
21+
$ErrorActionPreference = "Stop"
22+
write-host "Downloading Installer EXE"
23+
Invoke-WebRequest -Uri "${{ inputs.url }}" -OutFile "${env:RUNNER_TEMP}\temp-install.exe"
24+
write-host "Installing"
25+
$proc = Start-Process "${env:RUNNER_TEMP}\temp-install.exe" -ArgumentList '${{ inputs.args }}' -NoNewWindow -PassThru
26+
$completed = $proc.WaitForExit(${{ inputs.timeout }})
27+
if (-not $completed) {
28+
Write-Error "Installer timed out. Killing the process"
29+
$proc.Kill()
30+
exit 1
31+
}
32+
if ($proc.ExitCode -ne 0) {
33+
Write-Error "Installer failed with exit code $($proc.ExitCode)"
34+
exit 1
35+
}
36+
write-host "Completed installation"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Linux - Setup SpacemiT Toolchain"
2+
description: "Setup SpacemiT Toolchain for Linux"
3+
inputs:
4+
path:
5+
description: "Installation path"
6+
required: true
7+
version:
8+
description: "SpacemiT toolchain version"
9+
required: true
10+
11+
runs:
12+
using: "composite"
13+
steps:
14+
- name: Setup SpacemiT Toolchain
15+
id: setup
16+
uses: ./.github/actions/unarchive-tar
17+
with:
18+
url: https://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v${{ inputs.version }}.tar.xz
19+
path: ${{ inputs.path }}
20+
strip: 1
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Linux - Setup Vulkan SDK"
2+
description: "Setup Vulkan SDK for Linux"
3+
inputs:
4+
path:
5+
description: "Installation path"
6+
required: true
7+
version:
8+
description: "Vulkan SDK version"
9+
required: true
10+
11+
runs:
12+
using: "composite"
13+
steps:
14+
- name: Setup Vulkan SDK
15+
id: setup
16+
uses: ./.github/actions/unarchive-tar
17+
with:
18+
url: https://sdk.lunarg.com/sdk/download/${{ inputs.version }}/linux/vulkan_sdk.tar.xz
19+
path: ${{ inputs.path }}
20+
strip: 1
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Unarchive tar"
2+
description: "Download and unarchive tar into directory"
3+
inputs:
4+
url:
5+
description: "URL of the tar archive"
6+
required: true
7+
path:
8+
description: "Directory to unarchive into"
9+
required: true
10+
type:
11+
description: "Compression type (tar option)"
12+
required: false
13+
default: "J"
14+
strip:
15+
description: "Strip components"
16+
required: false
17+
default: "0"
18+
19+
runs:
20+
using: "composite"
21+
steps:
22+
- name: Unarchive into directory
23+
shell: bash
24+
run: |
25+
mkdir -p ${{ inputs.path }}
26+
cd ${{ inputs.path }}
27+
curl --no-progress-meter ${{ inputs.url }} | tar -${{ inputs.type }}x --strip-components=${{ inputs.strip }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: "Windows - Setup ROCm"
2+
description: "Setup ROCm for Windows"
3+
inputs:
4+
version:
5+
description: "ROCm version"
6+
required: true
7+
8+
runs:
9+
using: "composite"
10+
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 }}-WinSvr2022-For-HIP.exe
15+
args: -install

.github/workflows/build-cache.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Build Actions Cache
2+
3+
on:
4+
workflow_dispatch: # allows manual triggering
5+
schedule:
6+
- cron: '0 * * * *'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
ubuntu-24-vulkan-cache:
14+
runs-on: ubuntu-24.04
15+
16+
steps:
17+
- name: Clone
18+
id: checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Get latest Vulkan SDK version
22+
id: vulkan_sdk_version
23+
run: |
24+
echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV"
25+
26+
- name: Setup Cache
27+
uses: actions/cache@v4
28+
id: cache-sdk
29+
with:
30+
path: ./vulkan_sdk
31+
key: vulkan-sdk-${{ env.VULKAN_SDK_VERSION }}-${{ runner.os }}
32+
33+
- name: Setup Vulkan SDK
34+
if: steps.cache-sdk.outputs.cache-hit != 'true'
35+
uses: ./.github/actions/linux-setup-vulkan
36+
with:
37+
path: ./vulkan_sdk
38+
version: ${{ env.VULKAN_SDK_VERSION }}
39+
40+
ubuntu-24-spacemit-cache:
41+
runs-on: ubuntu-24.04
42+
43+
env:
44+
# Make sure this is in sync with build-linux-cross.yml
45+
SPACEMIT_IME_TOOLCHAIN_VERSION: "1.1.2"
46+
47+
steps:
48+
- name: Clone
49+
id: checkout
50+
uses: actions/checkout@v4
51+
52+
- name: Setup Cache
53+
uses: actions/cache@v4
54+
id: cache-toolchain
55+
with:
56+
path: ./spacemit_toolchain
57+
key: spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}-${{ runner.os }}
58+
59+
- name: Setup SpacemiT Toolchain
60+
if: steps.cache-toolchain.outputs.cache-hit != 'true'
61+
uses: ./.github/actions/linux-setup-spacemit
62+
with:
63+
path: ./spacemit_toolchain
64+
version: ${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}
65+
66+
windows-2022-rocm-cache:
67+
runs-on: windows-2022
68+
69+
env:
70+
# Make sure this is in sync with build.yml
71+
HIPSDK_INSTALLER_VERSION: "25.Q3"
72+
73+
steps:
74+
- name: Clone
75+
id: checkout
76+
uses: actions/checkout@v4
77+
78+
- name: Setup Cache
79+
uses: actions/cache@v4
80+
id: cache-rocm
81+
with:
82+
path: C:\Program Files\AMD\ROCm
83+
key: rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }}
84+
85+
- name: Setup ROCm
86+
if: steps.cache-rocm.outputs.cache-hit != 'true'
87+
uses: ./.github/actions/windows-setup-rocm
88+
with:
89+
version: ${{ env.HIPSDK_INSTALLER_VERSION }}

.github/workflows/build-linux-cross.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -258,31 +258,29 @@ jobs:
258258
runs-on: ubuntu-24.04
259259

260260
env:
261+
# Make sure this is in sync with build-cache.yml
261262
SPACEMIT_IME_TOOLCHAIN_VERSION: "1.1.2"
262-
SPACEMIT_IME_TOOLCHAIN_PATH: "spacemit-toolchain-linux-glibc-x86_64"
263263

264264
steps:
265265
- uses: actions/checkout@v4
266266

267-
- name: Cache Toolchain
267+
- name: Use SpacemiT Toolchain Cache
268268
uses: actions/cache@v4
269-
id: cache-spacemit-ime-cross-toolchain
269+
id: cache-toolchain
270270
with:
271-
path: ./${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}
272-
key: ${{ runner.os }}-spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}
271+
path: ./spacemit_toolchain
272+
key: spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}-${{ runner.os }}
273273

274-
- name: Setup Toolchain
275-
if: steps.cache-spacemit-ime-cross-toolchain.outputs.cache-hit != 'true'
276-
run: |
277-
wget --quiet --no-check-certificate https://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}.tar.xz -O ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}.tar.xz
278-
rm -rf ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}
279-
mkdir -p ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}
280-
tar xf ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}.tar.xz -C ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }} --strip-components=1
281-
rm -rf ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}.tar.xz
274+
- name: Setup SpacemiT Toolchain
275+
if: steps.cache-toolchain.outputs.cache-hit != 'true'
276+
uses: ./.github/actions/linux-setup-spacemit
277+
with:
278+
path: ./spacemit_toolchain
279+
version: ${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}
282280

283281
- name: Build
284282
run: |
285-
export RISCV_ROOT_PATH=${PWD}/${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}
283+
export RISCV_ROOT_PATH=${PWD}/spacemit_toolchain
286284
cmake -B build -DLLAMA_CURL=OFF \
287285
-DCMAKE_BUILD_TYPE=Release \
288286
-DGGML_OPENMP=OFF \

0 commit comments

Comments
 (0)