You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(memory-tier): size embedder KV to fit full-length inputs (n_ctx_seq)
The prior embedder config (n_ctx=512, n_seq_max=32) made llama.cpp derive
n_ctx_seq = GGML_PAD(n_ctx/n_seq_max, 256) = 256 cells per sequence. Any
single input longer than 256 tokens (notably the semantic-restore QUERY
embed, whose q_max is capped at 512 upstream) then failed llama_decode with
"find_slot: n_tokens > size=256" — a NON-fatal failure that returns an empty
embedding and silently drops the fingerprint / skips the restore. Fingerprint
blocks (16 tokens) always fit, so this hid as "fingerprints work but semantic
restore is dead"; the earlier crash-only verification missed it entirely.
Fix: set n_ctx = EMBED_BATCH_TOKENS * EMBED_BATCH_SEQS (n_seq_max=16), so
n_ctx_seq = 512 — a full-length input fits in one stream. Same total cell
count as before (8192: 16x512 vs 32x256), so no extra RAM. Each input is now
hard-clamped to the ACTUAL llama_n_ctx_seq() at runtime, so the cap can never
silently desync from the model/config again.
Verified on R9700/gfx1201 (6900xt LFM2.5 swarm): 370- and 504-token query
embeds now succeed (0 llama_decode failures vs 12 on the old binary).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GxHFe5y6ACxqFmFFzDBwtg
0 commit comments