Optimize GDN decode for Qwen3 Next (#17094)

This commit is contained in:
Sam (Kesen Li)
2026-01-31 01:02:12 +08:00
committed by GitHub
parent abf13ccc11
commit 81449b4bee

View File

@@ -136,7 +136,7 @@ def fused_recurrent_gated_delta_rule_fwd(
B, T, H, K, V = *k.shape, v.shape[-1]
HV = v.shape[2]
N = B if cu_seqlens is None else len(cu_seqlens) - 1
BK, BV = triton.next_power_of_2(K), min(triton.next_power_of_2(V), 8)
BK, BV = triton.next_power_of_2(K), min(triton.next_power_of_2(V), 32)
NK, NV = triton.cdiv(K, BK), triton.cdiv(V, BV)
assert NK == 1, "NK > 1 is not supported yet"
num_stages = 3