llama : simplify causal mask condition

ggml-ci
This commit is contained in:
Georgi Gerganov 2024-03-04 19:39:40 +02:00
parent fc9af156ff
commit c23c554744
No known key found for this signature in database
GPG key ID: 449E073F9DC10735

View file

@ -8045,8 +8045,7 @@ static void llama_set_inputs(llama_context & lctx, const llama_batch & batch) {
for (int i = 0; i < n_kv; ++i) {
float f;
if (!lctx.kv_self.cells[i].has_seq_id(seq_id) ||
(hparams.causal_attn && lctx.kv_self.cells[i].pos > pos)) {
if (!lctx.kv_self.cells[i].has_seq_id(seq_id) || lctx.kv_self.cells[i].pos > pos) {
f = -INFINITY;
} else {
f = 0.0f;