Repository navigation
Conversation
With --swa-full the SWA cache is full-size, but find_slot still recycles cells outside the window and state_write skips them, so a restored slot that diverges deeper than the window is fully re-processed. Add swa_keep_all, set by llama_kv_cache_iswa when swa_full is on, to stop both. The attention mask is unchanged. Add a server test with the SWA window shrunk via --override-kv. Assisted-by: Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
フォーク内の確認用 PR(base=このフォークの
master)。上流 ggml-org/llama.cpp へ出す本文はオーナーが自分の言葉で書く(AGENTS.md)。ここは差分と CI の様子を見るためだけ。--swa-fullのとき SWA キャッシュは全量サイズになるが、find_slotは窓の外のセルを再利用候補にし、state_writeは窓の外のセルを書かない。そのため、スロットを保存→復元して窓より深く分岐すると全文が再処理される。swa_keep_allを足し、llama_kv_cache_iswaがswa_fullのとき SWA 側に立てて両方を止める。アテンションマスクは触らない。Additional information
test_slot_restore_swa_full_reuses_prefix_beyond_window(tools/server/tests/unit/test_slot_save.py):tinygemma3 の窓を--override-kv gemma3.attention.sliding_window=int:64で縮め、--swa-fullで save → 上書き → restore → 窓より深く分岐した続きでcache_nが live と同じになることを見る。修正前は落ちる(cache_n0)、修正後は通る。test_slot_save.py全 18 本通過。tools/server/tests/utils.pyにoverride_kvを追加(--override-kv)。--swa-fullでは無効)。Requirements
Assisted-by:を参照)。上流への PR 本文・コミットメッセージはオーナーが書き直す。🤖 Generated with Claude Code
https://claude.ai/code/session_01AytyTnFz3SY5KAonPoXbLU
Generated by Claude Code