Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmarks/backward_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ def run_backward_performance_benchmark(test_type='all', num_runs=3, warmup_runs=

# Format configuration string
batch_size, num_heads, num_kv_heads, query_len, key_len, head_dim, keep_window_size, is_causal = config
config_str = f"B{batch_size}H{num_heads}K{num_kv_heads}Q{query_len}K{key_len}D{head_dim}W{keep_window_size}{'C' if is_causal else 'N'}"
config_str = f"B{batch_size} Hq{num_heads} Hkv{num_kv_heads} Q{query_len} K{key_len} D{head_dim} W{keep_window_size} {'C' if is_causal else 'N'}"
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter label 'K' is used twice in the configuration string - once for num_kv_heads and once for key_len. This creates ambiguity in the output. Consider using 'Kl' for key_len to differentiate it from the 'Hkv' label for num_kv_heads.

Suggested change
config_str = f"B{batch_size} Hq{num_heads} Hkv{num_kv_heads} Q{query_len} K{key_len} D{head_dim} W{keep_window_size} {'C' if is_causal else 'N'}"
config_str = f"B{batch_size} Hq{num_heads} Hkv{num_kv_heads} Q{query_len} Kl{key_len} D{head_dim} W{keep_window_size} {'C' if is_causal else 'N'}"

Copilot uses AI. Check for mistakes.

# Calculate averages and format results
sdpa_avg = f"{sum(results['sdpa_backward_times'])/len(results['sdpa_backward_times']):.2f}ms" if results['sdpa_backward_times'] else results['sdpa_backward_status']
Expand Down
6 changes: 4 additions & 2 deletions benchmarks/forward_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,9 +832,11 @@ def run_performance_benchmark(test_type='all', num_runs=3, warmup_runs=2):
speedup_strs[impl_key] = "N/A"

# Format output with shorter config string
config_short = f" b{batch_size} h{num_heads} kv{num_kv_heads} q{query_len} k{key_len} d{head_dim} w{keep_window_size} "
config_short = f" B{batch_size} Hq{num_heads} Hkv{num_kv_heads} Q{query_len} K{key_len} D{head_dim} W{keep_window_size} "
if not is_causal:
config_short += "nc"
config_short += "N"
else:
config_short += "C"

# Add status icons
icons = ""
Expand Down