Prefill can retain only KV writes

For static graphs whose attention layers share KV-cache tensors, prefill can expose only cache writes as outputs. OpenVINO can then remove computation needed solely for logits, including the relevant tail layers and LM head. When an output token is required, one decode step computes it against the complete cache. The documentation names Gemma 3n and Gemma 4 E2B/E4B as examples. This depends on graph structure and should not be advertised as a universal speedup for every architecture or backend.

The fast path has explicit fallback conditions

GGML_OPENVINO_KV_ONLY_PREFILL defaults to enabled, but the tagged documentation excludes recurrent state and use with NPU_HFA_PREFILL. A batch requiring more than one output token switches to full prefill. The final implementation also supports decode KV windows: the output step uses the graph for the appropriate window. Consequently, an earlier commit description excluding windows no longer describes the finished implementation. Setting the option to zero disables the optimization, making the default and fallback behavior relevant when comparing runs.

Host gather remains an opt-in

GGML_OPENVINO_NPU_HOST_GATHER defaults to zero. When enabled, it selects rows from large host-resident embedding tables, at least 64 MiB, using GGUF data on the host and passes those rows into the NPU graph. A table used exclusively for these lookups need not be converted for the NPU at all. This is separate from KV-only prefill: it changes where table access happens rather than merely reducing the bit width of every weight or attaching a trained adapter.

Compiled graphs share a weight bank

On NPU, setting GGML_OPENVINO_COMPILED_MODEL_CACHE_DIR now selects the weightless-bank layout. Compiled blobs share a weight file instead of repeating weights inside every graph variant. The older SELF_CONTAINED_BLOB, NPU_WEIGHTLESS_BANK and NPU_SHARED_BANK switches are removed. SELF_CONTAINED_MMAP remains available for subsequent import runs but requires an existing usable cache. A missing required blob fails in that mode, so building the cache initially and importing it later remain different operations rather than interchangeable startup options.

Reported measurements belong to the contributor

The PR reports particular Gemma NPU configurations and a separate phi-4-mini check whose import measurements after refactoring remain close to baseline. It also records a near-tie token differing on one of four needle prompts, with that token changing between baseline runs too. This does not justify promising identical generation for an arbitrary workload. Our review read the diff and tagged documentation but did not run the tests. The improvement on another NPU or model is therefore unmeasured here, and memory, speed and output quality remain separate validation questions.