Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Ggml org Ggml Ci runner

From Leeroopedia
Revision as of 15:01, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Ggml_org_Ggml_Ci_runner.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Implementation Metadata
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 via nvidia-smi
  • GG_BUILD_ROCM -- Enables HIP/ROCm with required GG_BUILD_AMDGPU_TARGETS
  • GG_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 backend
  • GG_BUILD_MUSA -- Enables MUSA backend for Moore Threads GPUs

The workflow:

  1. Cleans previous output logs
  2. Configures CMake with backend-specific flags
  3. Builds with cmake
  4. Runs tests via ctest
  5. 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

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment