Fix fmha_fwd early-exit bug: seqlen_q <= min_seqlen_q should be <

The kSkipMinSeqlenQ optimization incorrectly used <= comparison, causing
the kernel to skip batches where seqlen_q equals min_seqlen_q. This
happens in the common case of no padding (all batches have the same
seqlen_q == min_seqlen_q), producing all-zero output silently.

Changed to strict < so batches with exactly min_seqlen_q tokens are
still processed.

Made-with: Cursor
This commit is contained in:
root
2026-04-01 15:54:17 +00:00
parent cb6fb2802d
commit ec2db01e4a

View File

@@ -1509,7 +1509,7 @@ struct FmhaFwdKernel
if constexpr(kSkipMinSeqlenQ)
{
if(kargs.seqlen_q <= kargs.min_seqlen_q)
if(kargs.seqlen_q < kargs.min_seqlen_q)
{
return;
}