Skip to content

Commit ee13aa0

Browse files
authored
Static attention IO manager: fix causal mask bug for last input position
Differential Revision: D80098286 Pull Request resolved: #13332
1 parent d7ecd87 commit ee13aa0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/models/llama/runner/static_attention_io_manager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ class StaticAttentionMask {
328328
}
329329

330330
void set_causal_mask() {
331-
for (size_t i = 0; i < input_len_ - 1; i++) {
331+
for (size_t i = 0; i < input_len_; i++) {
332332
auto* p = data_ + (cache_len_ + input_len_) * i;
333333
std::fill(p + cache_len_, p + cache_len_ + 1 + i, zero_val_);
334334
std::fill(p + cache_len_ + 1 + i, p + cache_len_ + input_len_, mask_val_);

0 commit comments

Comments
 (0)