Skip to content

Commit acfbbc7

Browse files
committed
cont : simplify SWA mask condition
ggml-ci
1 parent e05055f commit acfbbc7

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/llama-hparams.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ struct llama_hparams {
102102
// Sliding Window Attention (SWA)
103103
llama_swa_type swa_type = LLAMA_SWA_TYPE_STANDARD;
104104

105-
uint32_t n_swa = 0; // sliding window attention (SWA)
105+
uint32_t n_swa = 0; // the size of the sliding window (0 - no SWA)
106106
uint32_t n_swa_pattern = 1; // by default, all layers use non-sliding-window attention
107107

108108
// for State Space Models

src/llama-kv-cache.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -687,10 +687,7 @@ void llama_kv_cache_unified::set_input_kq_mask(ggml_tensor * dst, const llama_ub
687687
{
688688
const llama_pos pos_chunk_start = (pos / hparams.n_swa) * hparams.n_swa;
689689

690-
// TODO: should this be simply:
691-
// if (cells[i].pos < pos_chunk_start) {
692-
//
693-
if (cells[i].pos < pos_chunk_start || pos < pos_chunk_start) {
690+
if (cells[i].pos < pos_chunk_start) {
694691
f = -INFINITY;
695692
}
696693
} break;

0 commit comments

Comments
 (0)