DeepSpeed
d5a5edf0 - fix(segki): let decode_attn serve any integer GQA ratio

Commit
2 hours ago
fix(segki): let decode_attn serve any integer GQA ratio decode_attn_kernel maps one block to a (row, query head) and splits that head's KV range over its 16 warps; the GQA ratio is used only to select the head's KV head (kv_head = q_head / q_per_kv). The host-side TORCH_CHECK(warps_per_block % q_per_kv == 0) and the matching predicate in _validate_qwen3_5_decode_attention are leftovers of an earlier per-KV-head block mapping (still described in the kernel header comment). They rejected shapes the kernel handles: Qwen3.5-27B (24 q / 4 kv heads, ratio 6) never got the fused decode attention while the 0.8B/4B models (ratio 4) did, at every TP degree. The Python predicate also used floor division and raised ZeroDivisionError for num_q_heads < num_kv_heads. Require only the integer ratio the kernel needs, describe the actual warp mapping in the kernel header, and cover ratio 6 at both the validator and the kernel level against the PyTorch reference. Part of #9222 Signed-off-by: Guokai Ma <guokai.ma@intel.com>
Author
Parents
Loading