Skip to content

Commit eb574b6

Browse files
committed
bench: REPS env var for run-all-langs.sh (vllm needs ≥4 to stabilise)
Per the post-mortem in 2026-05-08T01-15-02Z/MATRIX.md §7, vllm has ~10–20 % wire-byte variance across reps from non-deterministic batching even at temperature=0. The 2-rep median is too few to collapse that noise. Sglang + llama.cpp are deterministic and stable at 2 reps. Adds REPS env var (default 2) to run-all-langs.sh so the next matrix rerun can pass REPS=4 just for vllm: REPS=2 packages/bench/scripts/run-all-langs.sh $RUN_ID sglang REPS=4 packages/bench/scripts/run-all-langs.sh $RUN_ID vllm REPS=2 packages/bench/scripts/run-all-langs.sh $RUN_ID llama.cpp
1 parent 7c12286 commit eb574b6

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

packages/bench/scripts/run-all-langs.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,54 +50,60 @@ mkdir -p "$OUTDIR"
5050
# shellcheck disable=SC2206
5151
SIZES_ARR=($SIZES)
5252

53-
echo "=== run_id=$RUN_ID engine=$ENGINE sizes=$SIZES ==="
53+
# Reps default to 2 (sglang + llama.cpp are stable at 2). Override via env
54+
# for noisier engines — vllm at 2K tokens has ~10–20 % wire-byte variance
55+
# from non-deterministic batching/scheduling even at temperature=0; bumping
56+
# REPS=4 stabilises the median. See packages/bench/results/2026-05-08T01-15-02Z/MATRIX.md §7.
57+
REPS="${REPS:-2}"
58+
59+
echo "=== run_id=$RUN_ID engine=$ENGINE sizes=$SIZES reps=$REPS ==="
5460

5561
# 1. Python
5662
echo
5763
echo "--- python ---"
5864
.venv/bin/python -m codec_demo.matrix_run \
5965
--methodology "$METHODOLOGY" \
60-
--sizes "${SIZES_ARR[@]}" --reps 2 \
66+
--sizes "${SIZES_ARR[@]}" --reps "$REPS" \
6167
--out "$OUTDIR/python.json"
6268

6369
# 2. TypeScript / Node
6470
echo
6571
echo "--- web ---"
6672
( cd packages/demo && npx -y tsx src/matrix_run.ts \
6773
--methodology "../../$METHODOLOGY" \
68-
--sizes "${SIZES_ARR[@]}" --reps 2 \
74+
--sizes "${SIZES_ARR[@]}" --reps "$REPS" \
6975
--out "../../$OUTDIR/web.json" )
7076

7177
# 3. .NET
7278
echo
7379
echo "--- dotnet ---"
7480
PATH="$HOME/.dotnet:$PATH" dotnet run --project packages/demo-dotnet -c Release --no-build -- \
7581
--methodology "$METHODOLOGY" \
76-
--sizes "${SIZES_ARR[@]}" --reps 2 \
82+
--sizes "${SIZES_ARR[@]}" --reps "$REPS" \
7783
--out "$OUTDIR/dotnet.json"
7884

7985
# 4. Rust
8086
echo
8187
echo "--- rust ---"
8288
./packages/demo-rust/target/release/codec-bench \
8389
--methodology "$METHODOLOGY" \
84-
--sizes "${SIZES_ARR[@]}" --reps 2 \
90+
--sizes "${SIZES_ARR[@]}" --reps "$REPS" \
8591
--out "$OUTDIR/rust.json"
8692

8793
# 5. Java
8894
echo
8995
echo "--- java ---"
9096
PATH="$HOME/jdk/bin:$PATH" java -jar packages/demo-java/target/codec-bench.jar \
9197
--methodology "$METHODOLOGY" \
92-
--sizes "${SIZES_ARR[@]}" --reps 2 \
98+
--sizes "${SIZES_ARR[@]}" --reps "$REPS" \
9399
--out "$OUTDIR/java.json"
94100

95101
# 6. C
96102
echo
97103
echo "--- c ---"
98104
./packages/demo-c/build/codec-matrix \
99105
--methodology "$METHODOLOGY" \
100-
--sizes "${SIZES_ARR[@]}" --reps 2 \
106+
--sizes "${SIZES_ARR[@]}" --reps "$REPS" \
101107
--out "$OUTDIR/c.json"
102108

103109
echo

0 commit comments

Comments
 (0)