Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/blob/main/tools/artifact_export_shapes.sh # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `CUDApp / tools / artifact_export_shapes.sh` 38 lines · 1797 bytes Raw Blame History 1 #!/bin/sh 2 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 3 # Shape checks for `artifact-export matmul` against the matmul-bf16-v1 bounds. Opens no device. 4 # K = 16 uses the single-tile kernel, whose CTA computes one 16 x 8 tile: grid must be (n/8, m/16). 5 # K > 16 uses the looped kernel, whose CTA x walks column tiles x, x + grid_x, ...: 1 <= grid_x <= n/8. 6 # Shapes off the 16 x 8 x 16 tiling are refused (exit 3). 7 # usage: artifact_export_shapes.sh EXPORTER OUTDIR 8 set -eu 9 exp=$1 out=$2 10 rm -rf "$out"; mkdir -p "$out" 11 cm=`647116fc1ba1e1394982fc8ba181ce565293f160a6b56afc0f02b2128a675704` 12 commit=`0000000000000000000000000000000000000000` 13 fail=0 14 grid() { sed -n 's/^grid=//p' "$out/mm_$1.manifest"; } 15 for s in 16x16x8 32x16x64 64x2048x512 16x32x8 8192x16384x8192; do 16 IFS=x read -r m k n </dev/null; then 20 echo "FAIL: in-contract matmul $s refused"; fail=1; continue 21 fi 22 g=$(grid "$s"); gx=${g%%,*}; rest=${g#*,}; gy=${rest%%,*} 23 [ "$gy" = $((m / 16)) ] || { echo "FAIL: $s grid_y $gy != m/16"; fail=1; } 24 if [ "$k" = 16 ]; then 25 [ "$gx" = $((n / 8)) ] || { echo "FAIL: $s single-tile grid_x $gx != n/8 (columns left unwritten)"; fail=1; } 26 elif [ "$gx" -lt 1 ] || [ "$gx" -gt $((n / 8)) ]; then 27 echo "FAIL: $s looped grid_x $gx outside 1..n/8"; fail=1 28 fi 29 done 30 for s in 16x24x8 24x16x8 16x16x12; do 31 IFS=x read -r m k n </dev/null 2>&1 || rc=$? 35 [ "$rc" = 3 ] || { echo "FAIL: off-tiling matmul $s exit $rc, want 3"; fail=1; } 36 done 37 [ $fail -eq 0 ] && echo "ARTIFACT EXPORT SHAPES PASS" 38 exit $fail