Skip to content

Commit 234cf70

Browse files
authored
add local benchmarks file (#2)
Summary: same as `run_all_benchmarks.sh`, but with `reduce-overhead` and for a local machine Test Plan: ``` // full run // note: this run used a local torchao build with pytorch/ao#4031 time HF_HUB_DISABLE_PROGRESS_BARS=1 ./run_all_benchmarks_local.sh 2>&1 | tee ~/tmp/20260313_diffusers_full_sweep_logs_mslk.tx // output: https://gist.github.com/vkuzo/40ee0268a590e270900a2538055b13f0 ```
1 parent 803909d commit 234cf70

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

run_all_benchmarks_local.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
# Run MX-format quantization benchmarks locally across all models, batch sizes, and quant modes.
3+
# Compilation is always enabled with reduce-overhead mode.
4+
#
5+
# Usage:
6+
# bash run_all_benchmarks_local.sh
7+
8+
set -euo pipefail
9+
10+
MODELS=(
11+
"black-forest-labs/FLUX.1-dev"
12+
"Qwen/Qwen-Image"
13+
"Lightricks/LTX-2"
14+
)
15+
16+
BATCH_SIZES=(1 4 8)
17+
18+
run() {
19+
local model_id="$1"
20+
local batch_size="$2"
21+
local quant_mode="$3" # "none", "nvfp4", or "fp8"
22+
23+
echo ""
24+
echo "================================================================"
25+
echo " model : ${model_id}"
26+
echo " batch_size: ${batch_size}"
27+
echo " quant_mode: ${quant_mode}"
28+
echo " compile : enabled (reduce-overhead)"
29+
echo "================================================================"
30+
31+
time python benchmark.py \
32+
--model_id "${model_id}" \
33+
--batch_size "${batch_size}" \
34+
--enable_compilation \
35+
--quant_mode "${quant_mode}" \
36+
--torch_compile_mode reduce-overhead
37+
}
38+
39+
for model in "${MODELS[@]}"; do
40+
for bs in "${BATCH_SIZES[@]}"; do
41+
for quant in "none" "nvfp4" "fp8"; do
42+
run "${model}" "${bs}" "${quant}"
43+
done
44+
done
45+
done
46+
47+
echo ""
48+
echo "All benchmarks complete."

0 commit comments

Comments
 (0)