CUDA: fix FA VKQ accumulator overflow (#17746)

This commit is contained in:
Johannes Gäßler
2025-12-05 09:18:10 +01:00
committed by GitHub
parent 668ed76574
commit e95d0bc8fd
5 changed files with 11 additions and 5 deletions
+1 -1
View File
@@ -270,7 +270,7 @@ static __global__ void flash_attn_ext_vec(
sum += slope*__half2float(maskh[j*ne11 + i_KQ]);
}
KQ_max_new[j] = fmaxf(KQ_max_new[j], sum);
KQ_max_new[j] = fmaxf(KQ_max_new[j], sum + FATTN_KQ_MAX_OFFSET);
if ((nthreads_KQ == WARP_SIZE ? threadIdx.x : threadIdx.x % nthreads_KQ) == uint32_t(i_KQ_0)) {
KQ_reg[j] = sum;