Skip to content

Commit 4bda2db

Browse files
authored
alibi.h use the non max seqlen formula which seems more correct actually?
1 parent 88e1cc9 commit 4bda2db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

csrc/flash_attn/src/alibi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ struct Alibi {
6767
#pragma unroll
6868
for (int j = 0; j < size<1, 0>(tensor); ++j) {
6969
const int col_idx = col_idx_base + j;
70-
tensor(make_coord(i, mi), make_coord(j, nj)) += (((row_idx + max_seqlen_k - max_seqlen_q - col_idx) == 0) ? 0 : alibi_slope);
70+
tensor(make_coord(i, mi), make_coord(j, nj)) += ((col_idx == row_idx) ? 0 : alibi_slope);
7171
}
7272
}
7373
}

0 commit comments

Comments
 (0)