okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
5649b9e52
main
1name : Backend compile checks 2 3# Compile and link every engine backend with a pinned toolchain, without a GPU: nothing is run, so a call into a kernel that only 4# exists for another backend (or an API a toolkit version dropped) fails here instead of on a user's machine. Hardware runs are separate. 5# CUDA 12.9 and 13.0 nvidia/cuda devel container target strata (no MMQ, the default) (CMake preset cuda-compile) 6# HIP (ROCm 7.2) rocm/dev container target strata (CMake preset hip-compile) 7# SYCL (oneAPI 2026.1) ubuntu + Intel's apt repo target strata of sycl/ (the commands of packaging/build_sycl_linux.sh) 8# Metal macOS runner target strata (metal/; metal-build.yml keeps its own strata build) 9# ggml comes from the vendored third_party/strata-ggml (frozen at llama.cpp's pin), the same tree the release builds use: nothing is downloaded. 10# Architectures are fewer than the release package's (compile time); the flags that decide which sources and defines are built are the release's. 11 12on : 13push : 14branches : [ main ] 15paths : 16- .github/workflows/backends.yml 17- CMakeLists.txt 18- CMakePresets.json 19- cmake/** 20- src/** 21- include/** 22- third_party/** 23- sycl/** 24- metal/** 25- setup.py 26- packaging/build_cuda_linux.sh 27- packaging/build_hip_linux.sh 28- packaging/build_sycl_linux.sh 29pull_request : 30paths : 31- .github/workflows/backends.yml 32- CMakeLists.txt 33- CMakePresets.json 34- cmake/** 35- src/** 36- include/** 37- third_party/** 38- sycl/** 39- metal/** 40- setup.py 41- packaging/build_cuda_linux.sh 42- packaging/build_hip_linux.sh 43- packaging/build_sycl_linux.sh 44workflow_dispatch : 45 46permissions : 47contents : read 48 49concurrency : 50group : backends-${{ github.ref }} 51cancel-in-progress : true 52 53env : 54CCACHE_DIR : ${{ github.workspace }}/.ccache 55CCACHE_MAXSIZE : 2G 56 57jobs : 58cuda : 59name : CUDA ${{ matrix.cuda }} 60runs-on : ubuntu-24.04 61timeout-minutes : 120 62container : nvidia/cuda:${{ matrix.image }} 63strategy : 64fail-fast : false 65matrix : 66include : 67# the cuda12 package is the one for Pascal and Volta: sm_60 needs STRATA_EXPERIMENTAL_SM60 (packaging/build_cuda_linux.sh) 68- { cuda : '12.9' , image : '12.9.1-devel-ubuntu24.04' , archs : '60-real;61-real;70-real;86-real' , sm60 : 'ON' } 69- { cuda : '13.0' , image : '13.0.2-devel-ubuntu24.04' , archs : '75-real;86-real;120-real' , sm60 : 'OFF' } 70steps : 71- name : Tools 72run : | 73apt-get update 74DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends git ca-certificates cmake ninja-build ccache 75cmake --version | head -1 76- uses : actions/checkout@v4 77with : 78persist-credentials : false 79- uses : actions/cache@v4 80with : 81path : .ccache 82key : ccache-cuda${{ matrix.cuda }}-${{ hashFiles('CMakeLists.txt', 'src/**', 'include/**', 'cmake/**') }} 83restore-keys : ccache-cuda${{ matrix.cuda }}- 84- name : Configure (preset cuda-compile) 85run : | 86nvcc --version | tail -2 87cmake --preset cuda-compile -B build \ 88"-DCMAKE_CUDA_ARCHITECTURES=${{ matrix.archs }}" -DSTRATA_EXPERIMENTAL_SM60=${{ matrix.sm60 }} \ 89-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache 90- name : Build strata 91run : cmake --build build --target strata -j "$(nproc)" 92- name : Cache statistics 93run : ccache -s | head -8 94 95hip : 96name : HIP ROCm 7.2 97runs-on : ubuntu-24.04 98timeout-minutes : 120 99container : rocm/dev-ubuntu-24.04:7.2.4-complete 100steps : 101- name : Tools 102run : | 103apt-get update 104DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends git ca-certificates cmake ninja-build ccache 105cmake --version | head -1 106- uses : actions/checkout@v4 107with : 108persist-credentials : false 109- uses : actions/cache@v4 110with : 111path : .ccache 112key : ccache-hip72-${{ hashFiles('CMakeLists.txt', 'src/**', 'include/**', 'cmake/**') }} 113restore-keys : ccache-hip72- 114- name : Configure (preset hip-compile) 115run : | 116/opt/rocm/llvm/bin/clang++ --version | head -1 117cmake --preset hip-compile -B build \ 118-DCMAKE_HIP_COMPILER=/opt/rocm/llvm/bin/clang++ -DCMAKE_HIP_COMPILER_ROCM_ROOT=/opt/rocm -DCMAKE_PREFIX_PATH=/opt/rocm \ 119-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_HIP_COMPILER_LAUNCHER=ccache 120- name : Build strata 121run : cmake --build build --target strata -j "$(nproc)" 122- name : Cache statistics 123run : ccache -s | head -8 124 125sycl : 126# The engine needs oneAPI 2026.1 or newer (sycl/include/dpct/util.hpp uses the entangle and chunked_partition extensions, which the 127# 2025.3.2 compiler does not have: it stops at "no member named 'entangle'"; the intel/oneapi-basekit images end at 2025.3), so the 128# compiler comes from Intel's apt repository at a pinned version. 129name : SYCL oneAPI 2026.1 130runs-on : ubuntu-24.04 131timeout-minutes : 120 132container : ubuntu:24.04 133steps : 134- name : Tools and oneAPI 2026.1 135run : | 136apt-get update 137DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends git ca-certificates cmake ninja-build ccache wget gpg 138wget -qO- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor -o /usr/share/keyrings/oneapi-archive-keyring.gpg 139echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" > /etc/apt/sources.list.d/oneAPI.list 140apt-get update 141DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ 142intel-oneapi-compiler-dpcpp-cpp-2026.1=2026.1.1-325 intel-oneapi-mkl-devel-2026.1=2026.1.0-236 143- uses : actions/checkout@v4 144with : 145persist-credentials : false 146- uses : actions/cache@v4 147with : 148path : .ccache 149key : ccache-sycl-${{ hashFiles('CMakeLists.txt', 'src/**', 'include/**', 'sycl/**') }} 150restore-keys : ccache-sycl- 151- name : Configure and build (the commands of packaging/build_sycl_linux.sh) 152shell : bash 153run : | 154. /opt/intel/oneapi/setvars.sh --force >/dev/null 155icpx --version | head -1 156cmake -S sycl -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx \ 157-DSTRATA_SYCL_PARITY=OFF -DSTRATA_SYCL_IQ_DECODE_FAST=ON \ 158-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache 159cmake --build build --target strata -j "$(nproc)" 160- name : Cache statistics 161run : ccache -s | head -8 162 163metal : 164name : Metal strata 165# the macOS 26 SDK: metal/src/mtl_rt.mm names MTLGPUFamilyMetal4 behind @available (a run-time check); the names must be in the SDK 166runs-on : macos-26 167timeout-minutes : 60 168env : 169# metal/setup_mac.py's metal-cpp pin (the same as metal-build.yml) 170METAL_CPP_URL : https://developer.apple.com/metal/cpp/files/metal-cpp_26.zip 171METAL_CPP_SHA256 : 4df3c078b9aadcb516212e9cb03004cbc5ce9a3e9c068fa3144d021db585a3a4 172steps : 173- uses : actions/checkout@v4 174with : 175persist-credentials : false 176- name : Tools 177run : brew install ninja ccache 178- name : metal-cpp 179run : | 180curl -fsSL "$METAL_CPP_URL" -o metal-cpp.zip 181echo "$METAL_CPP_SHA256 metal-cpp.zip" | shasum -a 256 -c - 182unzip -q metal-cpp.zip -d _mcpp 183- uses : actions/cache@v4 184with : 185path : .ccache 186key : ccache-metal-${{ hashFiles('CMakeLists.txt', 'src/**', 'include/**', 'metal/**') }} 187restore-keys : ccache-metal- 188- name : Configure 189run : | 190cmake -S metal -B build-metal -G Ninja -DCMAKE_BUILD_TYPE=Release \ 191-DMETAL_CPP_DIR="$PWD/_mcpp/metal-cpp" \ 192-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache 193- name : Build and link strata 194run : cmake --build build-metal --target strata