#!/bin/zsh # End-to-end run: three models x batch sizes 1-16 x 3 repeats, optional server test, # then results.json and throughput.png. No network needed (models come from the local HF cache). set -u cd "${0:A:h}" PY=/opt/homebrew/Caskroom/miniconda/base/bin/python export HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 TOKENIZERS_PARALLELISM=false export MPLCONFIGDIR="$PWD/.mplcache" BUDGET_MIN=${BUDGET_MIN:-35} # models + server test; analysis adds < 1 min rm -rf raw && mkdir -p raw "$MPLCONFIGDIR" { echo "start $(date)" sw_vers; sysctl -n hw.model machdep.cpu.brand_string hw.memsize $PY -c 'import sys, mlx.core as mx, mlx_lm; print("python", sys.version.split()[0], "mlx", mx.__version__, "mlx_lm", mlx_lm.__version__)' pmset -g therm; sysctl vm.swapusage } 2>&1 | tee run.log $PY orchestrate.py --python $PY --budget-min $BUDGET_MIN "$@" 2>&1 | tee -a run.log $PY analyze.py --raw raw --out results.json 2>&1 | tee -a run.log PYTHONPATH="$PWD/vendor" $PY plot.py results.json throughput.png 2>&1 | tee -a run.log echo "end $(date)" | tee -a run.log [[ -s results.json ]]