kv-cache : fix SWA checks + disable cacheless iSWA (#15811)

ggml-ci
This commit is contained in:
Georgi Gerganov
2025-09-05 10:39:22 +03:00
committed by GitHub
parent 5d6688de08
commit c610b6c11b
9 changed files with 29 additions and 11 deletions

View File

@@ -229,7 +229,10 @@ struct llama_hparams {
// number of layers for which has_kv() returns true
uint32_t n_layer_kv() const;
bool is_masked_swa(llama_pos p0, llama_pos p1) const;
// note that this function uses different SWA parameters from those in the hparams
// TODO: think of a better place for this function
// TODO: pack the SWA params in a struct?
static bool is_masked_swa(uint32_t n_swa, llama_swa_type swa_type, llama_pos p0, llama_pos p1);
};
static_assert(std::is_trivially_copyable<llama_hparams>::value, "llama_hparams must be trivially copyable");