# The 192 integer decodes on x86_64 host A with each kernel set, its integrated GPU, and the build host's wasm. set -euo pipefail R=$HOME/wai-build/idf; W=$R/work; export CARGO_TARGET_DIR=$R/target # the toolchain: rustup 1.98.0 on PATH TAG=${1:?tag}; shift X=$R/xplat; mkdir -p $X OS="Linux $(uname -r), $(ldd --version 2>&1 | sed -n '1s/.* //p') glibc"; HW="x86_64 SoC, 16 cores, 32 threads, AVX-512" meta() { printf '{"system": "%s", "hardware": "%s", "target": "%s", "fabric": "%s", "kernels": "%s", "threads": "%s", "rustc": "%s", "runtime": "%s", "measured": "%s"}\n' "$OS" "$HW" "$1" "$2" "$3" "$4" "1.98.0" "$5" "$(date +%F)"; } for step in "$@"; do case $step in avx512-vnni|avx512|avx2-vnni|avx2|wide) WAI_INT_ISA=$step nice -n 10 $R/bin/native.$TAG decode $W/jobs.all.tsv > $X/linux-x86_64-cpu-isa-$step.tsv meta x86_64-unknown-linux-gnu CPU "fast, kernel set $step" "all (32)" native > $X/linux-x86_64-cpu-isa-$step.json ;; gpu) WAI_INT_ISA=avx512-vnni WAI_DET_GPU_KEY=gpu-vulkan-1002 nice -n 10 $R/bin/gpu.$TAG --gpu decode $W/jobs.all.tsv > $X/linux-x86_64-gpu-vulkan-isa-avx512-vnni.raw 2> $X/linux-x86_64-gpu-vulkan-isa-avx512-vnni.err cut -f1-4 $X/linux-x86_64-gpu-vulkan-isa-avx512-vnni.raw > $X/linux-x86_64-gpu-vulkan-isa-avx512-vnni.tsv meta x86_64-unknown-linux-gnu "GPU, Vulkan, integrated, PCI vendor 0x1002" "fast, kernel set avx512-vnni" "all (32) for graphs off the device" "wgpu 30.0.1, $(grep -o 'adapter: .*' $X/linux-x86_64-gpu-vulkan-isa-avx512-vnni.err | head -1 | sed 's/"/'"'"'/g')" > $X/linux-x86_64-gpu-vulkan-isa-avx512-vnni.json ;; wasm) WT=$R/wasmtime/wasmtime-v49.0.3-x86_64-linux/wasmtime; Sd=$R/wasm-shards rm -rf $Sd; mkdir -p $Sd awk "{print > (\"$Sd/jobs.\" (NR-1)%16)}" $W/jobs.all.tsv for f in $Sd/jobs.*; do nice -n 10 $WT run --dir $W::$W --dir $Sd::$Sd $R/bin/wasm.$TAG decode $f > $f.out & done; wait cat $Sd/jobs.*.out > $X/wasm32-wasip2-x86_64-isa-wide.tsv printf '{"system": "Linux %s", "hardware": "x86_64 SoC, 16 cores, 32 threads, AVX-512", "target": "wasm32-wasip2", "fabric": "CPU, WebAssembly", "kernels": "fast, kernel set wide (the only set on wasm)", "threads": "1 (sixteen decoder processes side by side)", "rustc": "1.98.0", "runtime": "%s, the build host'"'"'s .wasm", "measured": "%s"}\n' "$(uname -r)" "$($WT --version | cut -d' ' -f1-2)" "$(date +%F)" > $X/wasm32-wasip2-x86_64-isa-wide.json ;; esac; wc -l $X/*.tsv | tail -1; done