CPU FA: Check for empty attention mask (#1923)

This commit is contained in:
Kawrakow 2026-06-08 07:54:57 +02:00 committed by GitHub
parent 2f2ca7adb1
commit b50b0919d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -216,6 +216,10 @@ extern "C" IQK_API bool iqk_flash_attn_noalibi(int type_q, int type_mask, float
for (; first_k < last_k; ++first_k) {
if (umask[first_k] == 0) break;
}
if (first_k == last_k) {
fprintf(stderr, "============================== %s: found empty attention mask: nek1 = %d, first_k = %d\n", __func__, nek1, first_k);
GGML_ABORT("Fatal error");
}
for (; last_k > first_k; --last_k) {
if (umask[last_k-1] == 0) break;
}