interplane.Get Omega
Read in your language

openaccel-lab

aien-dev/openaccel-lab

Brought by drakestapleton

branch main Branches Tags History

openaccel-lab / runners / cuda / run_all.sh

25 lines · 1636 bytes Raw Blame History
1#!/bin/sh
2# SPDX-License-Identifier: Apache-2.0
3# runners/cuda/run_all.sh OUT.jsonl [oal-matrix options...]
4# Run the CUDA entrant of every workload and control on the GPU of this machine and write
5# oal-result/1 lines to OUT.jsonl. Needs nvcc, nvidia-smi and one NVIDIA GPU; the lab never runs
6# this on CI. The records carry the GPU name, compute capability and driver in machine.runner and
7# the label below, so the board can tell them from CPU rows.
8# Exit: oal-matrix's status (0 when every line was written), 2 on a usage error, 4 without a GPU.
9# INTERIM host glue (POSIX sh). Successor: an Omega runner script once omega-mv has one.
10set -eu
11[ $# -ge 1 ] || { echo "usage: run_all.sh OUT.jsonl [oal-matrix options]" >&2; exit 2; }
12out=$1; shift
13here=$(cd "$(dirname "$0")/../.." && pwd)
14q=$(nvidia-smi --query-gpu=name,compute_cap,driver_version --format=csv,noheader 2>/dev/null | sed -n 1p) || true
15[ -n "$q" ] || { echo "run_all.sh: no NVIDIA GPU visible" >&2; exit 4; }
16name=$(echo "$q" | cut -d, -f1 | sed 's/^ *//;s/ *$//')
17cc=$(echo "$q" | cut -d, -f2 | tr -d ' .')
18drv=$(echo "$q" | cut -d, -f3 | tr -d ' ')
19export OAL_CUDA_RUN=1
20export OAL_CUDA_ARCH="${OAL_CUDA_ARCH:-sm_$cc}"
21export OAL_RUNNER_LABEL="${OAL_RUNNER_LABEL:-$name sm_$cc driver $drv}"
22export OAL_TIMING_LABEL="${OAL_TIMING_LABEL:-GPU: launch + cudaDeviceSynchronize, host steady_clock, per repeat}"
23export OAL_EVIDENCE="${OAL_EVIDENCE:-QUALIFIED-on-$name candidate: GPU run, driver $drv, $(date -u +%Y-%m-%dT%H:%MZ)}"
24echo "run_all.sh: $OAL_RUNNER_LABEL arch $OAL_CUDA_ARCH" >&2
25exec python3 "$here/bin/oal-matrix" --backends cuda --controls "$@" > "$out"