-
Notifications
You must be signed in to change notification settings - Fork 281
MI350 mla ps mode suppport nhead128,1 128,2 128,3 128,4 64,4 64,2 32,4 through kernel hsa/gfx950/mla/mla_a16w16_qh32_qseqlen4_gqaratio32_ps.co #2727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -146,7 +146,7 @@ void mla_decode_stage1_asm_fwd( | |||
| args.scalar = softmax_scale; | ||||
| args.s_MQA = gqa_ratio * max_seqlen_q; | ||||
| args.s_kv_split = kv_split; | ||||
| args.s_Q_Bs = stride_Q; | ||||
| args.s_Q_Bs = stride_Q; | ||||
| args.s_Bs = stride_Page; | ||||
| args.s_log2_plen = log2_page; | ||||
| args.out_16_nosplit = kv_split; | ||||
|
|
@@ -260,12 +260,13 @@ void mla_decode_stage1_asm_fwd( | |||
| int prefill = 0; // decode stage | ||||
| int causal = 0; | ||||
| int config_max_seqlen_q = max_seqlen_q; | ||||
| int config_gqa_ratio = gqa_ratio; | ||||
| int sub_Q = 128; // default value | ||||
|
|
||||
| if(gqa_ratio == 128){ | ||||
| config_max_seqlen_q = 0; | ||||
| sub_Q = 128; | ||||
| if (q_type == "bf16" && kv_type == "bf16"){ | ||||
| if (q_type == "bf16" && kv_type == "bf16" && arch_id == "gfx942"){ | ||||
| ps = 0; // not use ps | ||||
| } | ||||
| } | ||||
|
|
@@ -338,9 +339,14 @@ void mla_decode_stage1_asm_fwd( | |||
| } | ||||
| } | ||||
|
|
||||
| if (arch_id == "gfx950" && q_type == "bf16" && kv_type == "bf16" && persistent && (gqa_ratio* max_seqlen_q % 128 == 0)){ | ||||
| config_max_seqlen_q = 4; | ||||
| config_gqa_ratio = 32; | ||||
| args.s_Q_Bs = gqa_ratio; | ||||
|
||||
| args.s_Q_Bs = gqa_ratio; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TORCH_CHECK error text is now outdated: this function also accepts gfx950 bf16/bf16 cases when
(num_heads * max_seqlen_qo) % 128 == 0, but the message still says it "only supports #heads in [16, 64, 128]" and fp8-only special cases. Please update the message to include the new gfx950 bf16/bf16 rule so failures are actionable.