Skip to content
Merged
22 changes: 9 additions & 13 deletions benchmarks/attention_benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ python benchmark.py \
--backends flash triton flashinfer \
--batch-specs "q2k" "8q1s1k" "2q2k_32q1s1k" \
--num-layers 10 \
--repeats 5 \
--output-csv results.csv
```

Expand Down Expand Up @@ -164,14 +163,17 @@ python benchmark.py \
# Model configuration
--num-layers N # Number of layers
--head-dim N # Head dimension
--v-head-dim N # Value head dimension (defaults to --head-dim)
--num-q-heads N # Query heads
--num-kv-heads N # KV heads
--block-size N # Block size
--kv-lora-rank N # MLA KV LoRA rank
--qk-nope-head-dim N # MLA non-RoPE QK head dim
--qk-rope-head-dim N # MLA RoPE QK head dim

# Benchmark settings
--device DEVICE # Device (default: cuda:0)
--repeats N # Repetitions
--warmup-iters N # Warmup iterations
--warmup-ms N # Warmup window in ms for triton do_bench
--profile-memory # Profile memory usage

# Parameter sweeps
Expand Down Expand Up @@ -211,8 +213,6 @@ config = BenchmarkConfig(
num_kv_heads=1,
block_size=128,
device="cuda:0",
repeats=5,
warmup_iters=3,
)

# CUTLASS MLA with specific num_kv_splits
Expand Down Expand Up @@ -253,14 +253,10 @@ formatter.save_json(results, "output.json")

## Tips

**1. Warmup matters** - Use `--warmup-iters 10` for stable results
**1. Save results** - Always use `--output-csv` or `--output-json`

**2. Multiple repeats** - Use `--repeats 20` for low variance
**2. Test incrementally** - Start with `--num-layers 1`

**3. Save results** - Always use `--output-csv` or `--output-json`
**3. Extended grammar** - Leverage spec decode, chunked prefill patterns

**4. Test incrementally** - Start with `--num-layers 1 --repeats 1`

**5. Extended grammar** - Leverage spec decode, chunked prefill patterns

**6. Parameter sweeps** - Use `--sweep-param` and `--sweep-values` to find optimal values
**4. Parameter sweeps** - Use `--sweep-param` and `--sweep-values` to find optimal values
Loading
Loading