Skip to content

Commit

Permalink
Tune paged attention parameters for AMD GPU.
Browse files Browse the repository at this point in the history
Changes:
- num_kv_splits
- BLOCK
- num_warps
  • Loading branch information
whchung committed Feb 1, 2025
1 parent 9602c2a commit c145acb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def _decode_att_m_fwd(
sm_scale,
logit_cap,
):
BLOCK = 64
BLOCK = 8
NUM_KV_SPLITS = num_kv_splits
Lk = k_buffer.shape[-1]
Lv = v_buffer.shape[-1]
Expand All @@ -193,7 +193,7 @@ def _decode_att_m_fwd(
if kv_group_num == 1:
num_warps = 4
else:
num_warps = 2
num_warps = 1

BLOCK_DMODEL = triton.next_power_of_2(Lk)
BLOCK_DV = triton.next_power_of_2(Lv)
Expand Down
2 changes: 1 addition & 1 deletion python/sglang/srt/server_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class ServerArgs:
enable_nan_detection: bool = False
enable_p2p_check: bool = False
triton_attention_reduce_in_fp32: bool = False
triton_attention_num_kv_splits: int = 8
triton_attention_num_kv_splits: int = 16
num_continuous_decode_steps: int = 1
delete_ckpt_after_loading: bool = False
enable_memory_saver: bool = False
Expand Down

0 comments on commit c145acb

Please sign in to comment.