Skip to content
Open
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
10 changes: 10 additions & 0 deletions aiter/ops/triton/attention/pa_decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ def paged_attn_decode_v1(
QUERY_GRP_SZ_POW2=query_grp_sz_pow2,
KV_BLK_SZ=kv_blk_sz,
KV_BLK_SZ_POW2=kv_blk_sz,
# triton 3.8 inflated this GQA dot kernel to 202 VGPR (occ 3->2).
# Raising the VGPR budget to 256 (waves_per_eu=2) lets regalloc pipeline
# LDS reads deeper: s_waitcnt lgkmcnt(0) 72->50, s_nop 36->9, ~+42% on
# llama3 decode. NOTE: v2_w_dot is intentionally NOT changed -- there
# waves_per_eu=2 spills and regresses ~-15% on llama3-405B.
waves_per_eu=2,
)


Expand Down Expand Up @@ -536,6 +542,10 @@ def paged_attn_decode_v1_per_token_quant(
QUERY_GRP_SZ_POW2=query_grp_sz_pow2,
KV_BLK_SZ=kv_blk_sz,
KV_BLK_SZ_POW2=kv_blk_sz,
# Same VGPR-budget fix as the non-quant v1_w_dot path above: this is the
# identical GQA dot compute kernel (per-token FP8 scale loads only), so
# the occ 3->2 inflation and the waves_per_eu=2 recovery apply equally.
waves_per_eu=2,
)


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"M_LEQ_8": {
"BLOCK_SIZE_M": 16,
"BLOCK_SIZE_N": 32,
"BLOCK_SIZE_K": 256,
"GROUP_SIZE_M": 1,
"num_warps": 4,
"num_stages": 3,
"waves_per_eu": 8,
"matrix_instr_nonkdim": 16,
"cache_modifier": ".cg",
"NUM_KSPLIT": 1
},
"M_LEQ_16": {
"BLOCK_SIZE_M": 32,
"BLOCK_SIZE_N": 32,
"BLOCK_SIZE_K": 256,
"GROUP_SIZE_M": 1,
"num_warps": 4,
"num_stages": 3,
"waves_per_eu": 6,
"matrix_instr_nonkdim": 16,
"cache_modifier": ".cg",
"NUM_KSPLIT": 1
},
"M_LEQ_32": {
"BLOCK_SIZE_M": 32,
"BLOCK_SIZE_N": 32,
"BLOCK_SIZE_K": 256,
"GROUP_SIZE_M": 1,
"num_warps": 4,
"num_stages": 3,
"waves_per_eu": 4,
"matrix_instr_nonkdim": 16,
"cache_modifier": ".cg",
"NUM_KSPLIT": 1
},
"M_LEQ_64": {
"BLOCK_SIZE_M": 64,
"BLOCK_SIZE_N": 32,
"BLOCK_SIZE_K": 256,
"GROUP_SIZE_M": 4,
"num_warps": 4,
"num_stages": 3,
"waves_per_eu": 4,
"matrix_instr_nonkdim": 16,
"cache_modifier": ".cg",
"NUM_KSPLIT": 1
},
"M_LEQ_128": {
"BLOCK_SIZE_M": 64,
"BLOCK_SIZE_N": 64,
"BLOCK_SIZE_K": 128,
"GROUP_SIZE_M": 8,
"num_warps": 8,
"num_stages": 3,
"waves_per_eu": 4,
"matrix_instr_nonkdim": 16,
"cache_modifier": ".cg",
"NUM_KSPLIT": 1
},
"M_LEQ_256": {
"BLOCK_SIZE_M": 128,
"BLOCK_SIZE_N": 64,
"BLOCK_SIZE_K": 128,
"GROUP_SIZE_M": 4,
"num_warps": 8,
"num_stages": 3,
"waves_per_eu": 4,
"matrix_instr_nonkdim": 16,
"cache_modifier": ".cg",
"NUM_KSPLIT": 1
},
"M_LEQ_512": {
"BLOCK_SIZE_M": 128,
"BLOCK_SIZE_N": 64,
"BLOCK_SIZE_K": 128,
"GROUP_SIZE_M": 4,
"num_warps": 8,
"num_stages": 3,
"waves_per_eu": 1,
"matrix_instr_nonkdim": 16,
"cache_modifier": ".cg",
"NUM_KSPLIT": 1
},
"M_LEQ_2048": {
"BLOCK_SIZE_M": 256,
"BLOCK_SIZE_N": 256,
"BLOCK_SIZE_K": 64,
"GROUP_SIZE_M": 1,
"num_warps": 8,
"num_stages": 2,
"waves_per_eu": 2,
"matrix_instr_nonkdim": 16,
"cache_modifier": null,
"NUM_KSPLIT": 1
},
"any": {
"BLOCK_SIZE_M": 256,
"BLOCK_SIZE_N": 128,
"BLOCK_SIZE_K": 64,
"GROUP_SIZE_M": 8,
"num_warps": 8,
"num_stages": 3,
"waves_per_eu": 2,
"matrix_instr_nonkdim": 16,
"cache_modifier": null,
"NUM_KSPLIT": 1
}
}
Loading