interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / tests / models / capacity.sh

30 lines · 1349 bytes Raw Blame History
1#!/bin/sh
2# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3# The real mxmm entry must reject full-width dimensions before multiplication.
4set -eu
5ROOT=$(CDPATH= cd -- "$(dirname "$0")/../.." && pwd)
6: "${OMEGA_OMC:?set OMEGA_OMC to the pinned compiler}"
7expected=2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f
8actual=$(sha256sum < "$OMEGA_OMC" | cut -c1-64)
9[ "$actual" = "$expected" ] || { echo 'NOT_RUN: model capacity compiler pin mismatch'; exit 3; }
10T=$(mktemp -d)
11trap 'rm -rf "$T"' EXIT HUP INT TERM
12cat "$ROOT/native/models/fp8.om" "$ROOT/native/models/nvfp4.om" \
13 "$ROOT/native/models/mxdot.om" "$ROOT/tests/models/mxdot-capacity.om" > "$T/input.om"
14"$OMEGA_OMC" < "$T/input.om" > "$T/check"
15chmod +x "$T/check"
16check() {
17 rc=0
18 printf '%b' "$1" | "$T/check" || rc=$?
19 [ "$rc" -eq "$2" ] || { echo "FAIL model capacity: $3 expected=$2 actual=$rc"; exit 1; }
20}
21check '\000' 0 output-capacity-boundary
22check '\001' 105 full-width-output-product
23check '\002' 105 full-width-right-row
24check '\003' 105 full-width-left-row
25check '\004' 0 zero-left-dimension
26check '\005' 0 zero-right-dimension
27check '\006' 105 output-over-capacity
28check '\007' 105 scales-over-capacity
29check '\010' 105 elements-over-capacity
30echo 'MODEL CAPACITY PASS: full-width refusals, boundaries, zero dimensions and output values'