Skip to content

Commit

Permalink
follow the original expression more closely
Browse files Browse the repository at this point in the history
  • Loading branch information
timt51 authored Feb 8, 2025
1 parent a645edd commit f5ce6ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion csrc/flash_attn/src/mask.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ struct Mask {
tensor(make_coord(i, mi), make_coord(j, nj)) += ((col_idx == (col_idx_limit_right - 1)) ? 0 : alibi_slope);

} else {
tensor(make_coord(i, mi), make_coord(j, nj)) += ((row_idx + max_seqlen_k == max_seqlen_q + col_idx) ? 0 : alibi_slope);
tensor(make_coord(i, mi), make_coord(j, nj)) += (((row_idx + max_seqlen_k - max_seqlen_q - col_idx) == 0) ? 0 : alibi_slope);

}
}
Expand Down

0 comments on commit f5ce6ee

Please sign in to comment.