From 7238474094906c3dc63c59a552e1d5d5271e6ad1 Mon Sep 17 00:00:00 2001 From: yuyazhua Date: Thu, 2 Jul 2026 11:12:47 +0800 Subject: [PATCH] Qualcomm AI Engine Direct - Fix sliding window attention --- examples/qualcomm/oss_scripts/llama/runner/kv_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/qualcomm/oss_scripts/llama/runner/kv_manager.cpp b/examples/qualcomm/oss_scripts/llama/runner/kv_manager.cpp index 7288ca5fbd1..6fb2255aa94 100644 --- a/examples/qualcomm/oss_scripts/llama/runner/kv_manager.cpp +++ b/examples/qualcomm/oss_scripts/llama/runner/kv_manager.cpp @@ -260,7 +260,7 @@ void KVManager::update_attention_mask( fill_mask( attention_mask_dtype_, cur_ptr - n_past * getDtypeSize(attention_mask_dtype_), - n_past + n_update, + n_past + n_update - available_cache_len, /*use_pos_value=*/false); } cur_ptr += metadata_.context_len * getDtypeSize(attention_mask_dtype_);