From 7cfb7dccaf320a5576bca1e56e71bc29e7a1cb72 Mon Sep 17 00:00:00 2001 From: Robert Karl Date: Sun, 11 Oct 2026 12:54:36 -0700 Subject: [PATCH] generate: --kv-resident refused before any weight moves when the model's attention is dense qsa_kv_streaming_applies (the attention branch) is called right after the geometry is read, so a Qwen3.6 start with --kv-resident fails with the reason instead of reaching qsa_state_init's backstop. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr --- src/program/generate.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/program/generate.cpp b/src/program/generate.cpp index 4e34575..0f5e31f 100644 --- a/src/program/generate.cpp +++ b/src/program/generate.cpp @@ -2076,6 +2076,12 @@ int main(int argc, char** argv) { if (g.arch != strata::core::ModelArch::Qwen4Exp) std::fprintf(stderr, "strata generate: model geometry (%s, from the file's metadata):\n%s", o.native_preset.c_str(), strata::core::model_geometry_text(g).c_str()); + // KV streaming is a lever only for selected attention: with no indexer every cell is read every token + // (qsa_state_init refuses as the backstop; this names it before any weight moves) + if (o.kv_resident > 0 && !strata::core::qsa_kv_streaming_applies(g, err)) { + std::fprintf(stderr, "strata generate: %s\n", err.c_str()); + return 1; + } // the fused tensor layouts llama.cpp accepts and this engine refuses by name (no shipped file uses them) try { const strata::GgufModel model(o.native_shards);