open-standards/wai/research/determinism-cost/runs/linux-a-energy.sh
Transaction Science 89cc4bfdfe wai: the determinism-cost runs, and the record's summary of divergent float decodes
The per-host scripts that took the readings (build host, two x86_64
hosts) go beside the record, with how each platform is tagged. The
summary gains the integer decodes' total across platforms and the PSNR
change of float decodes whose entropy decode diverged, in both the tool
and its independent verifier; per-decode energy is stated in joules.
wai_det_energy reads each accelerator client's GPU time per registry
node. The conformance workflow's independent-verifiers job checks the
record, the texts quoting it, and the decoder bin.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 13:32:56 -04:00

24 lines
1.5 KiB
Shell

# Time and energy on the x86_64 Linux host: package energy (powercap package-0) around each round.
set -euo pipefail
R=$HOME/wai-build/det1; W=$R/work; PY=$R/venv/bin/python; BIN=$R/target/release/wai_det_cost; O=$W/energy; mkdir -p $O
cd $R/src/wai
IDS=$(python3 -c "import json;print(','.join(p['id'] for p in json.load(open('$W/pictures.json'))['pictures'][:8]))")
E="python3 -I tools/wai_det_energy.py --rounds ${ROUNDS:-7} --k 1 --idle-s 5 --counter rapl"
HW='"system": "Linux 7.0", "hardware": "x86_64 SoC, 16 cores, 32 threads, AVX-512, integrated GPU PCI vendor 0x1002", "pictures": 8'
for q in ${QS:-2 6}; do
python3 - "$W" "$q" "$IDS" > $W/jobs.energy.q$q.tsv <<'PY'
import sys
w, q, ids = sys.argv[1], sys.argv[2], sys.argv[3].split(",")
for i in ids:
print(f"{w}/sets/q{q}\t{w}/int/q{q}/{i}.wih1\t-")
PY
for v in ${VARIANTS:-int-cpu float-cpu int-gpu}; do
case $v in
int-cpu) CH="$BIN serve $W/jobs.energy.q$q.tsv"; M='"path": "integer", "fabric": "CPU", "threads": "all (32)"' ;;
int-gpu) CH="env WAI_DET_GPU_KEY=gpu-vulkan-1002 $BIN --gpu serve $W/jobs.energy.q$q.tsv"; M='"path": "integer", "fabric": "GPU (Vulkan) for the graphs it takes, CPU for the rest", "threads": "all (32)"' ;;
float-cpu) CH="$PY -I tools/wai_determinism_cost.py fserve $W $q --device cpu --ids $IDS"; M='"path": "float", "fabric": "CPU", "threads": "the library default"' ;;
esac
$E --label linux-$v-q$q --meta "{$HW, $M, \"quality\": $q, \"nice\": 10}" -- nice -n 10 $CH > $O/linux-$v-q$q.json
done
done
ls -la $O