Implementation:Ggml org Ggml Ci runner
Appearance
| File Name | ci/run.sh
|
| Repository | ggml-org/ggml |
| Lines | 395 |
| Language | Shell (Bash) |
| Domain Tags | CI_CD, Build_System, Testing |
| Status | Active |
| Last Updated | 2025-05-15 12:00 GMT |
| Knowledge Sources | ggml-org/ggml repository |
Overview
ci/run.sh is the CI build and test runner script supporting multiple GPU backends. It provides a unified CI entry point for building and testing GGML across all supported hardware accelerator backends (CPU, CUDA, Metal, ROCm, SYCL, Vulkan, WebGPU, MUSA), used in both local and automated CI environments.
Description
The script accepts output and mount directories as arguments and detects GPU backend configuration via environment variables:
GG_BUILD_METAL-- Enables Metal backend (-DGGML_METAL=ON)GG_BUILD_CUDA-- Enables CUDA with auto-detected GPU architecture vianvidia-smiGG_BUILD_ROCM-- Enables HIP/ROCm with requiredGG_BUILD_AMDGPU_TARGETSGG_BUILD_SYCL-- Enables SYCL with oneAPI environment setup (icx/icpx compilers)GG_BUILD_VULKAN-- Enables Vulkan (disables Metal on macOS)GG_BUILD_WEBGPU-- Enables WebGPU backendGG_BUILD_MUSA-- Enables MUSA backend for Moore Threads GPUs
The workflow:
- Cleans previous output logs
- Configures CMake with backend-specific flags
- Builds with cmake
- Runs tests via ctest
- Logs results to the output directory
Usage
mkdir -p tmp/results tmp/mnt # CPU-only build bash ./ci/run.sh ./tmp/results ./tmp/mnt # With CUDA support GG_BUILD_CUDA=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt # With SYCL support GG_BUILD_SYCL=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt # With Vulkan support GG_BUILD_VULKAN=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
Code Reference
Source Location
| Repository | File | Lines |
|---|---|---|
| ggml-org/ggml | ci/run.sh |
395 |
Key Signatures
#!/bin/bash # Usage: bash ./ci/run.sh <output-dir> <mnt-dir> # Environment variables controlling backend selection: # GG_BUILD_METAL, GG_BUILD_CUDA, GG_BUILD_ROCM, # GG_BUILD_SYCL, GG_BUILD_VULKAN, GG_BUILD_WEBGPU, GG_BUILD_MUSA # CUDA architecture auto-detection: CUDA_ARCH=$(nvidia-smi --query-gpu=compute_cap --format=csv,noheader,nounits 2>/dev/null | head -1 | tr -d '.') # SYCL environment setup: export ONEAPI_DEVICE_SELECTOR="level_zero:0" export ZES_ENABLE_SYSMAN=1
I/O Contract
Inputs
$1-- Output directory for build logs and results$2-- Mount directory for test data- Environment variables -- Backend selection flags
Outputs
- Build artifacts -- Compiled GGML library and tests
- Test results -- ctest output logs in output directory
- Exit codes -- Per-test exit status files (
*.exit)
Usage Examples
Full CI pipeline:
# 1. Create output directories mkdir -p results mnt # 2. Run CI with CUDA GG_BUILD_CUDA=1 bash ./ci/run.sh ./results ./mnt # 3. Check results ls results/*.log # Build and test logs ls results/*.exit # Per-test exit codes ls results/*.md # Summary reports
Related Pages
Implements Principle
Related Implementations
- Implementation:Ggml_org_Ggml_Ggml_backend_load_all -- Backend loading tested by CI
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment