Download code/scripts/ab.sh from changh95/hamer-p150: direct link, hf CLI and curl.
- Browser
- Download file 955 Bytes
-
https://huggingface.co/changh95/hamer-p150/resolve/main/code/scripts/ab.sh
- Command line
-
hf download hf://changh95/hamer-p150/code/scripts/ab.sh
-
curl -L -o ab.sh https://huggingface.co/changh95/hamer-p150/resolve/main/code/scripts/ab.sh
955 Bytes
| # A/B helper: bench.py (device trace ms, served stages, 4-sample PCC) + acc.py (32 real-ckpt crops) | |
| # under the current environment (TT_FUSED_* knobs). usage: [VAR=val ...] scripts/ab.sh [tag] | |
| ROOT=/home/ttuser/experiments/tt-models | |
| M=${M:-$(cd "$(dirname "$0")/../.." && pwd)} | |
| VENV=${VENV:-$ROOT/models/hamer-p150/.venv} | |
| source $ROOT/tools/chipenv.sh ${CHIP:?set CHIP=<healthy chip>} $VENV >/dev/null || exit 1 | |
| cd $M/code | |
| echo "== $1" | |
| timeout -k 10 -s INT 900 python scripts/bench.py --dispatch ${DISPATCH:-eth} --grid 12x10 --iters 100 > /tmp/ab_bench_$$.log 2>&1 | |
| rc=$? | |
| grep -E "device_trace_ms=.*served|stages|autotune" /tmp/ab_bench_$$.log | |
| # a timeout / hang must NOT be followed by another device run on the same chip (HANG PROTOCOL) | |
| [ $rc -eq 0 ] || { echo "bench.py rc=$rc: stop, do not reopen the chip (write chipstate/chip$CHIP/FAULT)"; exit 1; } | |
| [ -n "$NO_ACC" ] || timeout -k 10 -s INT 900 python scripts/acc.py 2>&1 | grep "^ACC" | |