mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-10-27 08:21:30 +00:00
ci : refactor sdk caching to minimize storage (#16414)
* refactor sdk caching to minimize storage * use correct action * add myself as owner to /.github/actions/ [no ci]
This commit is contained in:
36
.github/actions/install-exe/action.yml
vendored
Normal file
36
.github/actions/install-exe/action.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
name: "Install exe"
|
||||||
|
description: "Download and install exe"
|
||||||
|
inputs:
|
||||||
|
url:
|
||||||
|
description: "URL of the exe installer"
|
||||||
|
required: true
|
||||||
|
args:
|
||||||
|
description: "Installer arguments"
|
||||||
|
required: true
|
||||||
|
timeout:
|
||||||
|
description: "Timeout (in ms)"
|
||||||
|
required: false
|
||||||
|
default: "600000"
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Install EXE
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
write-host "Downloading Installer EXE"
|
||||||
|
Invoke-WebRequest -Uri "${{ inputs.url }}" -OutFile "${env:RUNNER_TEMP}\temp-install.exe"
|
||||||
|
write-host "Installing"
|
||||||
|
$proc = Start-Process "${env:RUNNER_TEMP}\temp-install.exe" -ArgumentList '${{ inputs.args }}' -NoNewWindow -PassThru
|
||||||
|
$completed = $proc.WaitForExit(${{ inputs.timeout }})
|
||||||
|
if (-not $completed) {
|
||||||
|
Write-Error "Installer timed out. Killing the process"
|
||||||
|
$proc.Kill()
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
if ($proc.ExitCode -ne 0) {
|
||||||
|
Write-Error "Installer failed with exit code $($proc.ExitCode)"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
write-host "Completed installation"
|
||||||
20
.github/actions/linux-setup-spacemit/action.yml
vendored
Normal file
20
.github/actions/linux-setup-spacemit/action.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
name: "Linux - Setup SpacemiT Toolchain"
|
||||||
|
description: "Setup SpacemiT Toolchain for Linux"
|
||||||
|
inputs:
|
||||||
|
path:
|
||||||
|
description: "Installation path"
|
||||||
|
required: true
|
||||||
|
version:
|
||||||
|
description: "SpacemiT toolchain version"
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Setup SpacemiT Toolchain
|
||||||
|
id: setup
|
||||||
|
uses: ./.github/actions/unarchive-tar
|
||||||
|
with:
|
||||||
|
url: https://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v${{ inputs.version }}.tar.xz
|
||||||
|
path: ${{ inputs.path }}
|
||||||
|
strip: 1
|
||||||
20
.github/actions/linux-setup-vulkan/action.yml
vendored
Normal file
20
.github/actions/linux-setup-vulkan/action.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
name: "Linux - Setup Vulkan SDK"
|
||||||
|
description: "Setup Vulkan SDK for Linux"
|
||||||
|
inputs:
|
||||||
|
path:
|
||||||
|
description: "Installation path"
|
||||||
|
required: true
|
||||||
|
version:
|
||||||
|
description: "Vulkan SDK version"
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Setup Vulkan SDK
|
||||||
|
id: setup
|
||||||
|
uses: ./.github/actions/unarchive-tar
|
||||||
|
with:
|
||||||
|
url: https://sdk.lunarg.com/sdk/download/${{ inputs.version }}/linux/vulkan_sdk.tar.xz
|
||||||
|
path: ${{ inputs.path }}
|
||||||
|
strip: 1
|
||||||
27
.github/actions/unarchive-tar/action.yml
vendored
Normal file
27
.github/actions/unarchive-tar/action.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
name: "Unarchive tar"
|
||||||
|
description: "Download and unarchive tar into directory"
|
||||||
|
inputs:
|
||||||
|
url:
|
||||||
|
description: "URL of the tar archive"
|
||||||
|
required: true
|
||||||
|
path:
|
||||||
|
description: "Directory to unarchive into"
|
||||||
|
required: true
|
||||||
|
type:
|
||||||
|
description: "Compression type (tar option)"
|
||||||
|
required: false
|
||||||
|
default: "J"
|
||||||
|
strip:
|
||||||
|
description: "Strip components"
|
||||||
|
required: false
|
||||||
|
default: "0"
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Unarchive into directory
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir -p ${{ inputs.path }}
|
||||||
|
cd ${{ inputs.path }}
|
||||||
|
curl --no-progress-meter ${{ inputs.url }} | tar -${{ inputs.type }}x --strip-components=${{ inputs.strip }}
|
||||||
15
.github/actions/windows-setup-rocm/action.yml
vendored
Normal file
15
.github/actions/windows-setup-rocm/action.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
name: "Windows - Setup ROCm"
|
||||||
|
description: "Setup ROCm for Windows"
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: "ROCm version"
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Setup ROCm
|
||||||
|
uses: ./.github/actions/install-exe
|
||||||
|
with:
|
||||||
|
url: https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ inputs.version }}-WinSvr2022-For-HIP.exe
|
||||||
|
args: -install
|
||||||
89
.github/workflows/build-cache.yml
vendored
Normal file
89
.github/workflows/build-cache.yml
vendored
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
name: Build Actions Cache
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch: # allows manual triggering
|
||||||
|
schedule:
|
||||||
|
- cron: '0 * * * *'
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ubuntu-24-vulkan-cache:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone
|
||||||
|
id: checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Get latest Vulkan SDK version
|
||||||
|
id: vulkan_sdk_version
|
||||||
|
run: |
|
||||||
|
echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Setup Cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
id: cache-sdk
|
||||||
|
with:
|
||||||
|
path: ./vulkan_sdk
|
||||||
|
key: vulkan-sdk-${{ env.VULKAN_SDK_VERSION }}-${{ runner.os }}
|
||||||
|
|
||||||
|
- name: Setup Vulkan SDK
|
||||||
|
if: steps.cache-sdk.outputs.cache-hit != 'true'
|
||||||
|
uses: ./.github/actions/linux-setup-vulkan
|
||||||
|
with:
|
||||||
|
path: ./vulkan_sdk
|
||||||
|
version: ${{ env.VULKAN_SDK_VERSION }}
|
||||||
|
|
||||||
|
ubuntu-24-spacemit-cache:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
|
env:
|
||||||
|
# Make sure this is in sync with build-linux-cross.yml
|
||||||
|
SPACEMIT_IME_TOOLCHAIN_VERSION: "1.1.2"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone
|
||||||
|
id: checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
id: cache-toolchain
|
||||||
|
with:
|
||||||
|
path: ./spacemit_toolchain
|
||||||
|
key: spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}-${{ runner.os }}
|
||||||
|
|
||||||
|
- name: Setup SpacemiT Toolchain
|
||||||
|
if: steps.cache-toolchain.outputs.cache-hit != 'true'
|
||||||
|
uses: ./.github/actions/linux-setup-spacemit
|
||||||
|
with:
|
||||||
|
path: ./spacemit_toolchain
|
||||||
|
version: ${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}
|
||||||
|
|
||||||
|
windows-2022-rocm-cache:
|
||||||
|
runs-on: windows-2022
|
||||||
|
|
||||||
|
env:
|
||||||
|
# Make sure this is in sync with build.yml
|
||||||
|
HIPSDK_INSTALLER_VERSION: "25.Q3"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone
|
||||||
|
id: checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
id: cache-rocm
|
||||||
|
with:
|
||||||
|
path: C:\Program Files\AMD\ROCm
|
||||||
|
key: rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }}
|
||||||
|
|
||||||
|
- name: Setup ROCm
|
||||||
|
if: steps.cache-rocm.outputs.cache-hit != 'true'
|
||||||
|
uses: ./.github/actions/windows-setup-rocm
|
||||||
|
with:
|
||||||
|
version: ${{ env.HIPSDK_INSTALLER_VERSION }}
|
||||||
26
.github/workflows/build-linux-cross.yml
vendored
26
.github/workflows/build-linux-cross.yml
vendored
@@ -258,31 +258,29 @@ jobs:
|
|||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
# Make sure this is in sync with build-cache.yml
|
||||||
SPACEMIT_IME_TOOLCHAIN_VERSION: "1.1.2"
|
SPACEMIT_IME_TOOLCHAIN_VERSION: "1.1.2"
|
||||||
SPACEMIT_IME_TOOLCHAIN_PATH: "spacemit-toolchain-linux-glibc-x86_64"
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Cache Toolchain
|
- name: Use SpacemiT Toolchain Cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
id: cache-spacemit-ime-cross-toolchain
|
id: cache-toolchain
|
||||||
with:
|
with:
|
||||||
path: ./${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}
|
path: ./spacemit_toolchain
|
||||||
key: ${{ runner.os }}-spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}
|
key: spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}-${{ runner.os }}
|
||||||
|
|
||||||
- name: Setup Toolchain
|
- name: Setup SpacemiT Toolchain
|
||||||
if: steps.cache-spacemit-ime-cross-toolchain.outputs.cache-hit != 'true'
|
if: steps.cache-toolchain.outputs.cache-hit != 'true'
|
||||||
run: |
|
uses: ./.github/actions/linux-setup-spacemit
|
||||||
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
|
with:
|
||||||
rm -rf ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}
|
path: ./spacemit_toolchain
|
||||||
mkdir -p ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}
|
version: ${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}
|
||||||
tar xf ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}.tar.xz -C ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }} --strip-components=1
|
|
||||||
rm -rf ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}.tar.xz
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
export RISCV_ROOT_PATH=${PWD}/${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}
|
export RISCV_ROOT_PATH=${PWD}/spacemit_toolchain
|
||||||
cmake -B build -DLLAMA_CURL=OFF \
|
cmake -B build -DLLAMA_CURL=OFF \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DGGML_OPENMP=OFF \
|
-DGGML_OPENMP=OFF \
|
||||||
|
|||||||
45
.github/workflows/build.yml
vendored
45
.github/workflows/build.yml
vendored
@@ -413,20 +413,19 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV"
|
echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Cache Vulkan SDK
|
- name: Use Vulkan SDK Cache
|
||||||
id: cache_vulkan_sdk
|
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
|
id: cache-sdk
|
||||||
with:
|
with:
|
||||||
path: ./vulkan_sdk
|
path: ./vulkan_sdk
|
||||||
key: vulkan-sdk-${{ env.VULKAN_SDK_VERSION }}-${{ runner.os }}
|
key: vulkan-sdk-${{ env.VULKAN_SDK_VERSION }}-${{ runner.os }}
|
||||||
|
|
||||||
- name: Install Vulkan SDK
|
- name: Setup Vulkan SDK
|
||||||
if: steps.cache_vulkan_sdk.outputs.cache-hit != 'true'
|
if: steps.cache-sdk.outputs.cache-hit != 'true'
|
||||||
id: vulkan_sdk_install
|
uses: ./.github/actions/linux-setup-vulkan
|
||||||
run: |
|
with:
|
||||||
mkdir -p vulkan_sdk
|
path: ./vulkan_sdk
|
||||||
cd vulkan_sdk
|
version: ${{ env.VULKAN_SDK_VERSION }}
|
||||||
curl --no-progress-meter https://sdk.lunarg.com/sdk/download/latest/linux/vulkan_sdk.tar.xz | tar -Jx --strip-components=1
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
id: cmake_build
|
id: cmake_build
|
||||||
@@ -1111,6 +1110,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
# The ROCm version must correspond to the version used in the HIP SDK.
|
# The ROCm version must correspond to the version used in the HIP SDK.
|
||||||
ROCM_VERSION: "6.4.2"
|
ROCM_VERSION: "6.4.2"
|
||||||
|
# Make sure this is in sync with build-cache.yml
|
||||||
HIPSDK_INSTALLER_VERSION: "25.Q3"
|
HIPSDK_INSTALLER_VERSION: "25.Q3"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -1125,33 +1125,18 @@ jobs:
|
|||||||
7z x rocwmma.deb
|
7z x rocwmma.deb
|
||||||
7z x data.tar
|
7z x data.tar
|
||||||
|
|
||||||
- name: Cache ROCm Installation
|
- name: Use ROCm Installation Cache
|
||||||
id: cache-rocm
|
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
|
id: cache-rocm
|
||||||
with:
|
with:
|
||||||
path: C:\Program Files\AMD\ROCm
|
path: C:\Program Files\AMD\ROCm
|
||||||
key: rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }}
|
key: rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }}
|
||||||
|
|
||||||
- name: Install ROCm
|
- name: Setup ROCm
|
||||||
if: steps.cache-rocm.outputs.cache-hit != 'true'
|
if: steps.cache-rocm.outputs.cache-hit != 'true'
|
||||||
id: depends
|
uses: ./.github/actions/windows-setup-rocm
|
||||||
run: |
|
with:
|
||||||
$ErrorActionPreference = "Stop"
|
version: ${{ env.HIPSDK_INSTALLER_VERSION }}
|
||||||
write-host "Downloading AMD HIP SDK Installer"
|
|
||||||
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"
|
|
||||||
write-host "Installing AMD HIP SDK"
|
|
||||||
$proc = Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -PassThru
|
|
||||||
$completed = $proc.WaitForExit(600000)
|
|
||||||
if (-not $completed) {
|
|
||||||
Write-Error "ROCm installation timed out after 10 minutes. Killing the process"
|
|
||||||
$proc.Kill()
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
if ($proc.ExitCode -ne 0) {
|
|
||||||
Write-Error "ROCm installation failed with exit code $($proc.ExitCode)"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
write-host "Completed AMD HIP SDK installation"
|
|
||||||
|
|
||||||
- name: Verify ROCm
|
- name: Verify ROCm
|
||||||
id: verify
|
id: verify
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# multiplie collaborators per item can be specified
|
# multiplie collaborators per item can be specified
|
||||||
|
|
||||||
/.devops/*.Dockerfile @ngxson
|
/.devops/*.Dockerfile @ngxson
|
||||||
/.github/actions/ @slaren
|
/.github/actions/ @slaren @CISC
|
||||||
/.github/workflows/ @CISC
|
/.github/workflows/ @CISC
|
||||||
/.github/workflows/release.yml @slaren
|
/.github/workflows/release.yml @slaren
|
||||||
/.github/workflows/winget.yml @slaren
|
/.github/workflows/winget.yml @slaren
|
||||||
|
|||||||
Reference in New Issue
Block a user