Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
276 commits
Select commit Hold shift + click to select a range
bb7c7c5
openvino: use L0 host tensors for NPU buffers
zhaixuejun1993 Sep 8, 2026
66d6956
openvino: fill NPU prefill masks directly
zhaixuejun1993 Sep 8, 2026
48ca52c
openvino: make NPU requant layout configurable
zhaixuejun1993 Sep 8, 2026
5793efa
openvino: centralize NPU plugin config overrides
zhaixuejun1993 Sep 8, 2026
39a0726
openvino: add scatter-elements KV update option
zhaixuejun1993 Sep 8, 2026
882600f
openvino: gather token embeddings from compressed rows
zhaixuejun1993 Sep 8, 2026
9416af3
openvino: stream u4 requantization chunks
zhaixuejun1993 Sep 8, 2026
31c6440
openvino: fail fast on static recompile after weight release
zhaixuejun1993 Sep 8, 2026
80691ae
openvino: add experimental NPU Q4_0 keep option
zhaixuejun1993 Sep 8, 2026
b078013
openvino: unfold NPUW only for decode graph
zhaixuejun1993 Sep 8, 2026
9ef1996
openvino: tidy NPU tuning helper ordering
zhaixuejun1993 Sep 8, 2026
a27ed62
openvino: normalize NPU compile env overrides
zhaixuejun1993 Sep 9, 2026
0a88745
openvino: stream NPU weight requant by default to cut compile peak
zhaixuejun1993 Sep 9, 2026
762a5d1
openvino: add self-contained NPU model cache
zhaixuejun1993 Sep 11, 2026
3a1dedd
openvino: add lazy import for self-contained mmap cache
zhaixuejun1993 Sep 16, 2026
67fb560
openvino: release GGUF mmap resident pages before blob import
zhaixuejun1993 Sep 17, 2026
0e103d3
openvino: add GGML_OPENVINO_NPU_SHARED_BANK to share prefill/decode w…
zhaixuejun1993 Sep 21, 2026
fe5f3a3
openvino: drop SELF_CONTAINED_LAZY_IMPORT and RELEASE_MMAP_PAGES
zhaixuejun1993 Sep 21, 2026
d472ba5
openvino: demand-page large NPU compute buffer in strict warm-mmap mode
zhaixuejun1993 Sep 22, 2026
2185291
perf improvement success
zhaixuejun1993 Sep 28, 2026
a6d074a
openvino: size static NPU sliding-window masks to the window cache
anikulk Oct 17, 2026
37bb3b7
ggml-openvino: create the model cache dir under a Windows drive root
anikulk Oct 19, 2026
55a8407
ggml-openvino: split device-specific passes and NPU config out of sha…
anikulk Oct 19, 2026
83f7973
ggml-openvino: one KV-slice switch for dynamic and static graphs
anikulk Oct 20, 2026
dfb94ba
ggml-openvino: initialize all ModelExtraInputInfo fields for the HFA …
anikulk Oct 23, 2026
7623d56
ggml-openvino: make new NPU defaults opt-in and fix static model conv…
ravi9 Oct 24, 2026
4facdd7
ggml-openvino: honour the -1 skip id in MUL_MAT_ID
ravi9 Oct 26, 2026
0ad6830
ggml-openvino: Gather rows before dequantizing a quantized embedding …
yzhou51 Oct 23, 2026
82f00d7
ggml-openvino: select the NPU token_embd type with GGML_OPENVINO_NPU_…
ravi9 Oct 26, 2026
b2dd96e
align PAD pads to input rank in stateful mode
swathiananth Oct 23, 2026
51a1308
Gate the changes under is_stateful check to address review comment
swathiananth Oct 27, 2026
e245db0
ggml-openvino: lift Q tensors for non-RoPE layers to rank 4 in statef…
osabnis Oct 28, 2026
5317291
ggml-openvino: unify KV slicing under GGML_OPENVINO_KV_SLICE, on by d…
zhaixuejun1993 Oct 29, 2026
17439e8
ggml-openvino: keep stateful execution with -fa off
osabnis Oct 26, 2026
e207597
ggml-openvino: Add the stateful check to make the gate safer
osabnis Oct 28, 2026
e5f11b1
ggml-openvino: support gemma-2 soft-capped attention
osabnis Oct 26, 2026
4781ac2
ggml-openvino: enable NPU Level Zero host tensors by default
zhaixuejun1993 Oct 29, 2026
fa01ae0
ggml-openvino: enable NPU fast prefill mask by default
zhaixuejun1993 Oct 29, 2026
3705f0d
ggml-openvino: add opt-in exact zero points for asymmetric weights
osabnis Oct 8, 2026
a293b94
ggml-openvino: rename npu/ to device/ and openvino/pipelines/ to open…
cavusmustafa Oct 29, 2026
fd64d51
docs: document NPU self-contained model cache and shared weights bank
zhaixuejun1993 Nov 2, 2026
5d24409
ggml-openvino: remove experimental GGML_OPENVINO_NPU_KEEP_Q4_0
zhaixuejun1993 Oct 30, 2026
faf1d94
ggml-openvino: Update PERMUTE and CONCAT dynamic dim axis selection, …
swathiananth Nov 5, 2026
60fc323
enable flash_attn with sink input
nazanin-beheshti Oct 27, 2026
838707c
ggml-openvino: fix FLASH_ATTN_EXT input detection and sink scale
ravi9 Oct 30, 2026
eca50d2
ggml-openvino: accept flash attention on layers without RoPE
osabnis Oct 30, 2026
bb571aa
ggml-openvino: keep only weight-divisor DIVs on CPU
osabnis Nov 2, 2026
fde5390
ggml-openvino: Qwen MTP and multi-seq optimization with new OV ops
wine99 Nov 5, 2026
0a675f6
ggml-openvino: drop the extra semicolons after OPENVINO_OP
ravi9 Nov 4, 2026
2f2b779
ggml-openvino: make q8_0_c the default NPU token_embd requant type
yzhou51 Nov 4, 2026
4d0146c
ggml-openvino: do not treat the recurrent state gather as out_ids
ravi9 Nov 4, 2026
e583cf8
ggml-openvino: prefer the size-preserving dim when a RESHAPE repeats …
ravi9 Nov 4, 2026
f2c1932
ggml-openvino: correct the RESHAPE dynamic-dim comment for size-1 dims
osabnis Nov 4, 2026
43142d4
examples: add llama-chat-replay
zhaixuejun1993 Nov 3, 2026
543de3d
ggml-openvino: make the NPU lazy host threshold configurable, default…
zhaixuejun1993 Nov 3, 2026
b86e8ce
ggml-openvino: fix NPU HFA prefill with ordinal-suffixed KV input names
zhaixuejun1993 Nov 3, 2026
49afff6
ggml-openvino: keep the NPU prefill model on cache hits after decode
zhaixuejun1993 Nov 3, 2026
7734494
ggml-openvino: bind NPU HFA past KV zero-copy in the cache layout
zhaixuejun1993 Nov 3, 2026
c38310a
ggml-openvino: size the NPU decode KV window by GGML_OPENVINO_NPU_DEC…
zhaixuejun1993 Nov 3, 2026
468495c
ggml-openvino: allocate the NPU KV cache on demand with GGML_OPENVINO…
zhaixuejun1993 Nov 3, 2026
8215f45
ggml-openvino: NPU weightless blob cache with one shared weights file
zhaixuejun1993 Nov 3, 2026
803ead4
ggml-openvino: prebuild all NPU decode KV windows with GGML_OPENVINO_…
zhaixuejun1993 Nov 4, 2026
14412b9
Revert "examples: add llama-chat-replay"
zhaixuejun1993 Nov 4, 2026
b30c552
ggml-openvino: initialize the new compiled-graph and build-args fields
ravi9 Nov 5, 2026
633a377
ggml-openvino: fix gemma-4 when only the output rows reach the KV-sha…
ravi9 Nov 5, 2026
e6d2460
ggml-openvino: keep the inp_pos layout for gemma-4's gathered positions
ravi9 Nov 5, 2026
759ccb7
ggml-openvino: enable stateless GPU execution for MLA models
osabnis Nov 2, 2026
0360d51
openvino : use writable recurrent cache inputs
wine99 Nov 5, 2026
080f7e8
ggml-openvino: fix decode crash for Qwen3.5 4B
yzhou51 Nov 6, 2026
68abd50
ggml-openvino: keep the GDN state in the OpenVINO layout
yzhou51 Oct 28, 2026
e23181d
ggml-openvino: disable output staging
osabnis Nov 6, 2026
1763e20
ggml-openvino: support Ling-mini-2.0 group-routed MoE
osabnis Nov 3, 2026
eff17d5
Remove legacy OpenVINO bridge code
preetha-intel Oct 12, 2026
a36fa70
ggml-openvino: add eltwise rank alignment and update decoder/utils
preetha-intel Oct 15, 2026
bd9b966
ggml-openvino: apply scale before MatMul on GPU/NPU to keep f16 in range
preetha-intel Oct 16, 2026
4aaa49c
Merge pull request #376 from osabnis/ov-ling-mini-stateless
cavusmustafa Nov 7, 2026
4f5218d
Merge pull request #396 from osabnis/ov-disable-output-staging
cavusmustafa Nov 7, 2026
0435983
ggml-openvino: match attention masks by identity
osabnis Nov 6, 2026
e8f06b6
ggml-openvino: preserve input mask names and window sizes
osabnis Nov 6, 2026
1d9a826
ggml-openvino: accept empty tensors in stride checks
osabnis Nov 6, 2026
2c2a2c9
ggml-openvino: classify transposed V caches using v_trans
osabnis Nov 6, 2026
7041946
ggml-openvino: use per-layer Split in stateful execution
osabnis Nov 6, 2026
0691f02
ggml-openvino: centralize stateful KQ mask lookup
osabnis Nov 6, 2026
5ab5f4e
ggml-openvino: translate convolution rollback snapshots
wine99 Nov 9, 2026
f9d415c
ggml-openvino: Removed duplicated if clause.
nproshun Nov 9, 2026
689a87e
fix flash_attn with sink conversion to OV SDPA
nazanin-beheshti Nov 4, 2026
9d50538
ggml-openvino: drop the unused sink-without-mask path in FLASH_ATTN_EXT
ravi9 Nov 9, 2026
e14cb1a
ggml-openvino: fix dimensions bug in stateful recurrent-state remaind…
nproshun Nov 9, 2026
53efc81
ggml-openvino: move scalar scales before weight MatMuls on GPU and NPU
ravi9 Nov 9, 2026
90588b2
Merge pull request #398 from ravi9/fix-openvino-mtp-snapshots
wine99 Nov 10, 2026
f55228c
ggml-openvino: own the scale reorder pass and weights-file layout
mvafin Nov 10, 2026
8d31ecb
Merge dev_backend_openvino; port snapshot, batched rows and arange to…
mvafin Nov 10, 2026
980e0a2
ggml-openvino: request per-layer Split views from the frontend
mvafin Nov 10, 2026
ebe2457
ggml-openvino: fix SWA mask detection
osabnis Oct 2, 2026
c2ab0bd
ggml-openvino: fix SWA KV cache write indices
osabnis Oct 2, 2026
54ab1d2
ggml-openvino: classify SWA layers only when the mask shows the window
osabnis Oct 4, 2026
e419d0a
ggml-openvino: classify SWA layers from the first graph
osabnis Oct 5, 2026
e476d74
ggml-openvino: mark SWA fallback as a model-level heuristic
osabnis Oct 6, 2026
4723851
ggml-openvino: derive attention sizes from the KQ mask shape
osabnis Oct 5, 2026
f20662a
ggml-openvino: only reuse Split outputs for exact chunk-aligned views
osabnis Oct 6, 2026
b4f99b9
ggml-openvino: initialize ModelExtraInputInfo shape fields
osabnis Oct 9, 2026
4b06501
ggml-openvino: remove GGML_OPENVINO_REQUANT_EMBD
osabnis Oct 9, 2026
5883011
ggml-openvino: keep manual GQA attention 4-D
osabnis Oct 12, 2026
8f05e55
ggml-openvino: use a 4-D stateless KV cache on GPU
osabnis Oct 12, 2026
ffc24ed
make embedding to have dynamic shape for OV GPU
nazanin-beheshti Oct 12, 2026
2df37e7
ggml-openvino: make the 4-D stateless KV cache opt-in
cavusmustafa Oct 15, 2026
acc7936
add support for Q5_0 data type in OV GPU backend
nazanin-beheshti Oct 13, 2026
8b48274
resolve CI test error
nazanin-beheshti Oct 14, 2026
f78153e
ggml-openvino: fix -fa off and optimize grouped-query attention
osabnis Oct 12, 2026
6545a46
ggml-openvino: fall back to stateless execution when -fa off
osabnis Oct 12, 2026
0214247
ggml-openvino: preserve flat KV cache layout when -fa is off
osabnis Oct 13, 2026
e70d395
ggml-openvino: extract Q5_0 weights when requantization is off
ravi9 Oct 20, 2026
7503989
ggml-openvino: Optimize GDN output pre-scale for the NPU static path
yzhou51 Oct 10, 2026
9558df3
Refine the code as review comments
yzhou51 Oct 21, 2026
bb39de3
ggml-openvino: reuse graph bindings between decode calls
osabnis Oct 19, 2026
77680a3
ggml-openvino: Add npuw dump envs for profiling
yzhou51 Oct 16, 2026
06c7948
Add the comments of new npu dump envs into doc
yzhou51 Oct 21, 2026
3ab7bb3
ggml-openvino : ensure all leaves have unique names, remove input_src…
mostafafaheem Oct 20, 2026
bce76fe
openvino: slice NPU prefill KV cache by active length
zhaixuejun1993 Sep 8, 2026
ea62592
openvino: use L0 host tensors for NPU buffers
zhaixuejun1993 Sep 8, 2026
0fda79c
openvino: fill NPU prefill masks directly
zhaixuejun1993 Sep 8, 2026
bd239b4
openvino: make NPU requant layout configurable
zhaixuejun1993 Sep 8, 2026
8e0857d
openvino: centralize NPU plugin config overrides
zhaixuejun1993 Sep 8, 2026
ebf5122
openvino: add scatter-elements KV update option
zhaixuejun1993 Sep 8, 2026
584e7db
openvino: gather token embeddings from compressed rows
zhaixuejun1993 Sep 8, 2026
9eb9c2c
openvino: stream u4 requantization chunks
zhaixuejun1993 Sep 8, 2026
4fb8f3b
openvino: fail fast on static recompile after weight release
zhaixuejun1993 Sep 8, 2026
9e1e527
openvino: add experimental NPU Q4_0 keep option
zhaixuejun1993 Sep 8, 2026
f1af552
openvino: unfold NPUW only for decode graph
zhaixuejun1993 Sep 8, 2026
d4344aa
openvino: tidy NPU tuning helper ordering
zhaixuejun1993 Sep 8, 2026
9096f0f
openvino: normalize NPU compile env overrides
zhaixuejun1993 Sep 9, 2026
0fd26bf
openvino: stream NPU weight requant by default to cut compile peak
zhaixuejun1993 Sep 9, 2026
1813a74
openvino: add self-contained NPU model cache
zhaixuejun1993 Sep 11, 2026
ce369db
openvino: add lazy import for self-contained mmap cache
zhaixuejun1993 Sep 16, 2026
96b0c88
openvino: release GGUF mmap resident pages before blob import
zhaixuejun1993 Sep 17, 2026
f37325a
openvino: add GGML_OPENVINO_NPU_SHARED_BANK to share prefill/decode w…
zhaixuejun1993 Sep 21, 2026
b47de10
openvino: drop SELF_CONTAINED_LAZY_IMPORT and RELEASE_MMAP_PAGES
zhaixuejun1993 Sep 21, 2026
40422bc
openvino: demand-page large NPU compute buffer in strict warm-mmap mode
zhaixuejun1993 Sep 22, 2026
f94b962
perf improvement success
zhaixuejun1993 Sep 28, 2026
e686762
openvino: size static NPU sliding-window masks to the window cache
anikulk Oct 17, 2026
81f89f6
ggml-openvino: create the model cache dir under a Windows drive root
anikulk Oct 19, 2026
4b3cac4
ggml-openvino: split device-specific passes and NPU config out of sha…
anikulk Oct 19, 2026
04133dc
ggml-openvino: one KV-slice switch for dynamic and static graphs
anikulk Oct 20, 2026
5ea74ea
ggml-openvino: initialize all ModelExtraInputInfo fields for the HFA …
anikulk Oct 23, 2026
2782fd5
ggml-openvino: make new NPU defaults opt-in and fix static model conv…
ravi9 Oct 24, 2026
48b991c
ggml-openvino: honour the -1 skip id in MUL_MAT_ID
ravi9 Oct 26, 2026
5381426
ggml-openvino: Gather rows before dequantizing a quantized embedding …
yzhou51 Oct 23, 2026
55f901a
ggml-openvino: select the NPU token_embd type with GGML_OPENVINO_NPU_…
ravi9 Oct 26, 2026
68c6421
align PAD pads to input rank in stateful mode
swathiananth Oct 23, 2026
02803d2
Gate the changes under is_stateful check to address review comment
swathiananth Oct 27, 2026
c2a2397
ggml-openvino: lift Q tensors for non-RoPE layers to rank 4 in statef…
osabnis Oct 28, 2026
3c2f5aa
ggml-openvino: unify KV slicing under GGML_OPENVINO_KV_SLICE, on by d…
zhaixuejun1993 Oct 29, 2026
d452a4d
ggml-openvino: keep stateful execution with -fa off
osabnis Oct 26, 2026
97e8c64
ggml-openvino: Add the stateful check to make the gate safer
osabnis Oct 28, 2026
04249fd
ggml-openvino: support gemma-2 soft-capped attention
osabnis Oct 26, 2026
ee902e9
ggml-openvino: enable NPU Level Zero host tensors by default
zhaixuejun1993 Oct 29, 2026
6d3ae4a
ggml-openvino: enable NPU fast prefill mask by default
zhaixuejun1993 Oct 29, 2026
fd98425
ggml-openvino: add opt-in exact zero points for asymmetric weights
osabnis Oct 8, 2026
57f5b7e
ggml-openvino: rename npu/ to device/ and openvino/pipelines/ to open…
cavusmustafa Oct 29, 2026
0cfab94
docs: document NPU self-contained model cache and shared weights bank
zhaixuejun1993 Nov 2, 2026
220eacd
ggml-openvino: remove experimental GGML_OPENVINO_NPU_KEEP_Q4_0
zhaixuejun1993 Oct 30, 2026
96d742d
ggml-openvino: Update PERMUTE and CONCAT dynamic dim axis selection, …
swathiananth Nov 5, 2026
0eb1027
enable flash_attn with sink input
nazanin-beheshti Oct 27, 2026
f7a0e12
ggml-openvino: fix FLASH_ATTN_EXT input detection and sink scale
ravi9 Oct 30, 2026
ddd6bb6
ggml-openvino: accept flash attention on layers without RoPE
osabnis Oct 30, 2026
ae5ee15
ggml-openvino: keep only weight-divisor DIVs on CPU
osabnis Nov 2, 2026
2eb784a
ggml-openvino: Qwen MTP and multi-seq optimization with new OV ops
wine99 Nov 5, 2026
4e26b4c
ggml-openvino: drop the extra semicolons after OPENVINO_OP
ravi9 Nov 4, 2026
2cc651a
ggml-openvino: make q8_0_c the default NPU token_embd requant type
yzhou51 Nov 4, 2026
68fa722
ggml-openvino: do not treat the recurrent state gather as out_ids
ravi9 Nov 4, 2026
541ff19
ggml-openvino: prefer the size-preserving dim when a RESHAPE repeats …
ravi9 Nov 4, 2026
a427fca
ggml-openvino: correct the RESHAPE dynamic-dim comment for size-1 dims
osabnis Nov 4, 2026
70638fb
examples: add llama-chat-replay
zhaixuejun1993 Nov 3, 2026
c89fc1c
ggml-openvino: make the NPU lazy host threshold configurable, default…
zhaixuejun1993 Nov 3, 2026
1079e9a
ggml-openvino: fix NPU HFA prefill with ordinal-suffixed KV input names
zhaixuejun1993 Nov 3, 2026
a96357f
ggml-openvino: keep the NPU prefill model on cache hits after decode
zhaixuejun1993 Nov 3, 2026
1295ea9
ggml-openvino: bind NPU HFA past KV zero-copy in the cache layout
zhaixuejun1993 Nov 3, 2026
69715e4
ggml-openvino: size the NPU decode KV window by GGML_OPENVINO_NPU_DEC…
zhaixuejun1993 Nov 3, 2026
49b8164
ggml-openvino: allocate the NPU KV cache on demand with GGML_OPENVINO…
zhaixuejun1993 Nov 3, 2026
f482422
ggml-openvino: NPU weightless blob cache with one shared weights file
zhaixuejun1993 Nov 3, 2026
116f009
ggml-openvino: prebuild all NPU decode KV windows with GGML_OPENVINO_…
zhaixuejun1993 Nov 4, 2026
413877b
Revert "examples: add llama-chat-replay"
zhaixuejun1993 Nov 4, 2026
e15515b
ggml-openvino: initialize the new compiled-graph and build-args fields
ravi9 Nov 5, 2026
a8f9e04
ggml-openvino: fix gemma-4 when only the output rows reach the KV-sha…
ravi9 Nov 5, 2026
4bac5f5
ggml-openvino: keep the inp_pos layout for gemma-4's gathered positions
ravi9 Nov 5, 2026
0d39aa9
ggml-openvino: enable stateless GPU execution for MLA models
osabnis Nov 2, 2026
a238dd3
openvino : use writable recurrent cache inputs
wine99 Nov 5, 2026
d764a8e
ggml-openvino: fix decode crash for Qwen3.5 4B
yzhou51 Nov 6, 2026
38d2a67
ggml-openvino: keep the GDN state in the OpenVINO layout
yzhou51 Oct 28, 2026
a07e543
ggml-openvino: support Ling-mini-2.0 group-routed MoE
osabnis Nov 3, 2026
b077064
ggml-openvino: disable output staging
osabnis Nov 6, 2026
4a98858
ggml-openvino: match attention masks by identity
osabnis Nov 6, 2026
0ab3813
ggml-openvino: preserve input mask names and window sizes
osabnis Nov 6, 2026
a40a2e2
ggml-openvino: accept empty tensors in stride checks
osabnis Nov 6, 2026
47edc1d
ggml-openvino: classify transposed V caches using v_trans
osabnis Nov 6, 2026
62c478b
ggml-openvino: use per-layer Split in stateful execution
osabnis Nov 6, 2026
1c7dee2
ggml-openvino: centralize stateful KQ mask lookup
osabnis Nov 6, 2026
1e0a840
ggml-openvino: Removed duplicated if clause.
nproshun Nov 9, 2026
3e655a8
fix flash_attn with sink conversion to OV SDPA
nazanin-beheshti Nov 4, 2026
8c486e4
ggml-openvino: drop the unused sink-without-mask path in FLASH_ATTN_EXT
ravi9 Nov 9, 2026
3d7ade8
ggml-openvino: fix dimensions bug in stateful recurrent-state remaind…
nproshun Nov 9, 2026
f7b2c37
ggml-openvino: move scalar scales before weight MatMuls on GPU and NPU
ravi9 Nov 9, 2026
78abd8a
ggml-openvino: translate convolution rollback snapshots
wine99 Nov 9, 2026
873461d
ggml-openvino: run GDN rollback snapshots in OpenVINO on CPU
ravi9 Nov 10, 2026
c78e888
ggml-openvino: abort when GDN snapshots would run in ggml
ravi9 Nov 10, 2026
33219b2
ggml-openvino: share one weights file and NPUW bank across all NPU pr…
zhaixuejun1993 Nov 5, 2026
db62825
ggml-openvino: export and preload NPU prefill blobs for every KV window
zhaixuejun1993 Nov 6, 2026
f2e8cfb
ggml-openvino: drop invalid prefill blobs and clear blob caches on ba…
ravi9 Nov 10, 2026
7e61bee
ggml-openvino: enable NPU KV windows by default
ravi9 Nov 10, 2026
aeb7cfc
ggml-openvino: add POOL_1D and allow F32 EXP on GPU
nproshun Nov 10, 2026
167c233
skip empty tensors
nazanin-beheshti Nov 10, 2026
f3a2e28
ggml-openvino: detect the gated LFM2 conv input as a recurrent sequence
ravi9 Nov 10, 2026
2870bac
ggml-openvino: always stream weight requantization
osabnis Nov 10, 2026
1fb9dde
ggml-openvino: allocate host buffers as untouched OS memory
osabnis Nov 10, 2026
2f53090
ggml-openvino: release GGUF file pages once a weight is converted
osabnis Nov 10, 2026
1bd76c4
ggml-openvino: key weight constants by name for the NPU model cache
ravi9 Nov 11, 2026
2f5cfcb
ggml-openvino: drop CACHE_MODE=OPTIMIZE_SIZE from the NPU plugin cache
ravi9 Nov 11, 2026
e312c59
ggml-openvino: load each self-contained NPU blob once per process
ravi9 Nov 11, 2026
da99e12
ggml-openvino: update the Docker image GPU drivers to 26.40.40196.8
ravi9 Nov 11, 2026
b065bdb
ggml-openvino: fix long NPU prompts failing with KV slicing
ravi9 Nov 11, 2026
70c0469
ggml-openvino: pre-scale the GDN q input by default on the NPU
ravi9 Nov 11, 2026
c5882ee
openvino-ggml: Decompose the GDN for LNL
yzhou51 Nov 10, 2026
4d358a5
ggml-openvino: fix GDN decomposition in decode and on long prompts
ravi9 Nov 11, 2026
51265b0
openvino-ggml: Enhance the safe env parsing
yzhou51 Nov 11, 2026
d21bd5a
ggml-openvino: keep the GDN q pre-scaling on when its variable is unset
ravi9 Nov 11, 2026
984b5d1
ggml-openvino: use the PLUGIN compiler for GDN graphs on the NPU
ravi9 Nov 11, 2026
136cea4
ggml-openvino: fix gemma-4 E2B on the Lunar Lake NPU at small contexts
ravi9 Nov 12, 2026
58709d9
ggml-openvino: support multiple GPUs with -sm layer
suhas-somashekar-intel Nov 10, 2026
ff15603
ggml-openvino: check GGML_OPENVINO_* variables and reorganize the docs
ravi9 Nov 12, 2026
9556fb8
docs : add LFM2.5 and Ling-mini-2.0 to the OpenVINO validated models
ravi9 Nov 12, 2026
3029b99
ggml-openvino: rebuild converted weights in get_tensor
ravi9 Nov 12, 2026
13c980e
ggml-openvino: drop the GDN test cases from test-backend-ops
ravi9 Nov 12, 2026
24142ca
docs : improve the OpenVINO backend docs
ravi9 Nov 13, 2026
312e9a9
docs : restore the OpenVINO intro and the development note
ravi9 Nov 13, 2026
bb87094
ggml-openvino: fix slow performance of MoE models with requantize and…
suhas-somashekar-intel Nov 13, 2026
56860f3
ggml-openvino: document the fused GPU MoE op limits
ravi9 Nov 14, 2026
1c862a7
ggml-openvino : FILL for in-place clear of recurrent cache, sticky Na…
sanmai Nov 14, 2026
258ff36
restore this part
sanmai Nov 14, 2026
c4b99de
ggml-openvino: bump the model-cache version for the recurrent-cache r…
ravi9 Nov 14, 2026
e15f17c
ggml-openvino: read rope_factors_short/long as weight constants
ravi9 Nov 15, 2026
84aa113
ggml-openvino: import cached models from a memory-mapped tensor
ravi9 Nov 15, 2026
0f98ca3
ggml-openvino: do not write CPU model-cache blobs for MoE models
ravi9 Nov 15, 2026
42e9fb1
ggml-openvino: fix GGML_OPENVINO_DEBUG_INPUT on GPU
ravi9 Nov 15, 2026
ea32407
docs : add OpenVINO memory optimization tips and MiniCPM-V-4.5
ravi9 Nov 15, 2026
4303ac2
ggml-openvino: run MoE models with F16 and BF16 weights on GPU
ravi9 Nov 16, 2026
4973f9a
ggml-openvino: fix BERT embedding models on CPU and GPU
ravi9 Nov 16, 2026
2910fcd
docs : add bge-m3 and nomic-embed-text-v1.5 to the OpenVINO validated…
ravi9 Nov 16, 2026
d09d19b
ggml-openvino: pass named translator attributes instead of op_case
mvafin Nov 16, 2026
b4a5434
Merge ravi9/dev_backend_openvino into ov-pr342-rebased
mvafin Nov 16, 2026
1009018
ggml-openvino: fix in-place SCALE outputs and op test tolerances
mvafin Nov 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .devops/openvino.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ ARG OPENVINO_VERSION_FULL=2026.4.1.22982.07f9c262b05
ARG UBUNTU_VERSION=24.04

# Intel GPU driver versions. https://github.com/intel/compute-runtime/releases
ARG IGC_VERSION=v2.41.5
ARG IGC_VERSION_FULL=2_2.41.5+22716
ARG COMPUTE_RUNTIME_VERSION=26.35.39758.10
ARG COMPUTE_RUNTIME_VERSION_FULL=26.35.39758.10-0
ARG IGDGMM_VERSION=22.10.0
ARG IGC_VERSION=v2.42.6
ARG IGC_VERSION_FULL=2_2.42.6+23070
ARG COMPUTE_RUNTIME_VERSION=26.40.40196.8
ARG COMPUTE_RUNTIME_VERSION_FULL=26.40.40196.8-0
ARG IGDGMM_VERSION=22.10.2

# Intel NPU driver versions. https://github.com/intel/linux-npu-driver/releases
ARG NPU_DRIVER_VERSION=v1.38.0
Expand Down
614 changes: 417 additions & 197 deletions docs/backend/OPENVINO.md

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions ggml/src/ggml-openvino/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
find_package(OpenVINO REQUIRED COMPONENTS Runtime Threading)
find_package(OpenCL REQUIRED)

if(NOT TARGET openvino::frontend::gguf)
message(FATAL_ERROR "OpenVINO GGUF frontend target openvino::frontend::gguf is required")
endif()

message(STATUS "Found OpenVINO: ${OpenVINO_DIR} (found version \"${OpenVINO_VERSION}\")")

file(GLOB_RECURSE GGML_HEADERS_OPENVINO "*.h" "*.hpp")
file(GLOB_RECURSE GGML_SOURCES_OPENVINO "*.cpp")
file(GLOB GGML_HEADERS_OPENVINO "*.h" "*.hpp" "device/*.h")
file(GLOB GGML_SOURCES_OPENVINO "*.cpp" "device/*.cpp")

ggml_add_backend_library(ggml-openvino
${GGML_SOURCES_OPENVINO}
${GGML_HEADERS_OPENVINO}
)

target_link_libraries(ggml-openvino PRIVATE openvino::runtime openvino::threading OpenCL::OpenCL)
target_link_libraries(ggml-openvino PRIVATE openvino::runtime openvino::threading openvino::frontend::gguf OpenCL::OpenCL)

# the OpenVINO RTTI macros take one argument and leave __VA_ARGS__ empty, which -Wpedantic reports
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
Expand Down
64 changes: 61 additions & 3 deletions ggml/src/ggml-openvino/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
# Per-operation graph boundaries

The supplied GGUF decoder includes VIEW, RESHAPE, PERMUTE and TRANSPOSE inputs
omitted by per-operation graph views. Quantized VIEW strides and offsets describe
the decoded F32 weight layout. CPY returns its logical destination in this path;
writeback honors destination strides and preserves storage outside the view.
Full model graphs continue to expose updated in-place storage as their output.

Quantized CPY destinations and conversions to BF16 from other types are not
offloaded: the former require quantized writeback and the latter require
round-to-nearest-even conversion. Quantized inputs with a non-unit fourth
dimension are also unsupported by the weight extraction path.

# Qwen MTP

The default Qwen3.5/Qwen3.6 GPU path is dynamic stateless execution with in-place fused recurrent ops and stable MTP sampling. Build against the matching OpenVINO runtime/GPU plugin with independent `RecurrentConvCacheUpdate` and `RecurrentGatedDeltaNetUpdate` ops. The native Update ops return computation results and update writable cache inputs in place, including rollback snapshots where required. No recurrent/sampling opt-in flag is needed on supported graphs. See the [development documentation index](dev_doc/README.md) for the implementation and the MTP sampling graph.

Use `--spec-type draft-mtp --spec-draft-n-max 2` with a GGUF that contains MTP weights. Parallel execution uses `-np` and `--kv-unified`. CPU snapshot execution, NPU execution, and forced static MTP are not supported.

Stateless recurrent execution uses the same reset, reorder, and partial cache-writeback paths at every slot capacity, including one slot without MTP.

The matched stateless GPU path uses `RecurrentConvCacheUpdate` and
`RecurrentGatedDeltaNetUpdate`. Each cache is a writable Parameter backed by one
stable caller-owned USM allocation. The ops return only convolution or attention;
there are no recurrent cache Results. Required source rows are staged before
writes, preserving resets, cyclic reorders and rollback. Cache readers must be
exclusive, including Reshape aliases.
`GGML_OPENVINO_DISABLE_FUSED_RECURRENCE=1` retains the ordinary cache decomposition.
Unmatched snapshot GDN uses ordinary GDN token prefixes with functional writeback.
Build both repos against the matching single-output op spec. Translation revision
15 requires regenerating compiled-model blobs once without cache-only mode.

Cache-only MTP serving still requires the separate OpenVINO dynamic output-binding fix (PR #39354). Removing recurrent cache Results does not eliminate that independent trigger in imported MTP graphs.

The upstream stateless in-place attention KV update pattern is on by default where
eligible (`GGML_OPENVINO_ENABLE_KV_4D=0` disables it). It binds full-capacity cache tensors
and lets the GPU fusion expose the live prefix to attention. The current upstream
eligibility check supports one physical stream (including unified KV); explicit
split multi-slot KV retains the ordinary full-cache path. This option does not
change recurrent cache handling. Unified KV is recommended for multi-slot GPU
execution because it enables this in-place attention update.

The recommended Qwen3.6-35B-A3B Q4_K_M setup uses GPU with `GGML_OPENVINO_REQUANT_KQUANT=q4_asym64_all` and `GGML_OPENVINO_NATIVE_SOFTPLUS=1`. Leave `GGML_OPENVINO_KV_SLICE` at its default (`1`). See [attention KV layout](dev_doc/OPENVINO-RECURRENT-CACHE.md#attention-kv-layout) for eligibility.

`q4_asym64_all` converts Q4_K/Q5_K/Q6_K/Q8_0/Q5_1 weights, including dense Q8_0 projections, to asymmetric INT4 with group size 64. `token_embd.weight` and `output.weight` retain symmetric channel-wise INT8. Q8_0/Q5_1 rows whose width is not divisible by 64 also use channel-wise INT8. This follows the primary/backup precision scheme of NNCF `INT4_ASYM`, `ratio=1.0`, `group_size=64`, `backup_mode=INT8_SYM` for these supported source types; it requantizes GGUF values rather than the original floating-point model and leaves floating-point weights unchanged. Earlier versions kept dense Q8_0 at INT8/group-32. Repopulate compiled-model caches without cache-only mode after this change; the cache fingerprint invalidates the old precision policy.

See the [implementation guide](dev_doc/OPENVINO-RECURRENT-CACHE.md) for buffer ownership and rollback.

# Compiled model cache

`GGML_OPENVINO_COMPILED_MODEL_CACHE_DIR` exports compiled CPU/GPU graphs with their weights. It bypasses the plugin-level `GGML_OPENVINO_CACHE_DIR` and uses `OPTIMIZE_SPEED`, so weightless caching is disabled.
Expand All @@ -7,7 +55,6 @@ One directory can hold blobs for different models and compilation settings. Run
```sh
GGML_OPENVINO_DEVICE=GPU \
GGML_OPENVINO_NATIVE_SOFTPLUS=1 \
GGML_OPENVINO_DISABLE_KV_SLICE=1 \
GGML_OPENVINO_REQUANT_KQUANT=q4_asym64_all \
GGML_OPENVINO_COMPILED_MODEL_CACHE_DIR=/path/to/qwen-cache \
./build/ReleaseOV/bin/llama-bench -m /path/to/model.gguf -r 1
Expand All @@ -20,7 +67,6 @@ On later runs, supply the same compilation settings and enable `GGML_OPENVINO_CO
```sh
GGML_OPENVINO_DEVICE=GPU \
GGML_OPENVINO_NATIVE_SOFTPLUS=1 \
GGML_OPENVINO_DISABLE_KV_SLICE=1 \
GGML_OPENVINO_REQUANT_KQUANT=q4_asym64_all \
GGML_OPENVINO_COMPILED_MODEL_CACHE_DIR=/path/to/qwen-cache \
GGML_OPENVINO_COMPILED_MODEL_CACHE_ONLY=1 \
Expand All @@ -29,10 +75,22 @@ GGML_OPENVINO_COMPILED_MODEL_CACHE_ONLY=1 \

Cache-only mode allocates backend address space without filling weight pages. On Windows, this also uses system commit capacity. The model-buffer size in the loader log is this virtual size. Weight uploads only record source identity; they do not read or requantize the weights. Graph conversion and compilation are skipped. Runtime buffers are still allocated and populated normally.

Cache-only mode uses the settings provided by the current process. Keep these values exactly the same, including set versus unset: `GGML_OPENVINO_REQUANT_KQUANT`, `GGML_OPENVINO_NATIVE_SOFTPLUS`, `GGML_OPENVINO_DISABLE_KV_SLICE`, `GGML_OPENVINO_MANUAL_GQA_ATTN`, `GGML_OPENVINO_STATEFUL_EXECUTION`, `GGML_OPENVINO_DISABLE_KV_STATE_RELAYOUT`, `GGML_OPENVINO_DISABLE_REMOTE_OUTPUTS`, `GGML_OPENVINO_REDUCE_COMPILE_MEM`, `GGML_OPENVINO_MEMORY_OPTIMIZE`, `GGML_OPENVINO_PROFILING`, and `GGML_OPENVINO_DEBUG_NODE`. On GPU, also repeat `GGML_OPENVINO_MOE_OP=0` if used. `GGML_OPENVINO_SPILL_DIR` is optional on the first run and ignored in cache-only mode; host-weight release is disabled in cache-only mode.
Cache-only mode uses the settings provided by the current process. Keep these values exactly the same, including set versus unset: `GGML_OPENVINO_REQUANT_KQUANT`, `GGML_OPENVINO_EXACT_ZERO_POINT`, `GGML_OPENVINO_NATIVE_SOFTPLUS`, `GGML_OPENVINO_MANUAL_GQA_ATTN`, `GGML_OPENVINO_STATEFUL_EXECUTION`, `GGML_OPENVINO_DISABLE_KV_STATE_RELAYOUT`, `GGML_OPENVINO_DISABLE_REMOTE_OUTPUTS`, `GGML_OPENVINO_REDUCE_COMPILE_MEM`, `GGML_OPENVINO_MEMORY_OPTIMIZE`, `GGML_OPENVINO_PROFILING`, `GGML_OPENVINO_DISABLE_SHAPE_FROM_MASK`, and `GGML_OPENVINO_DEBUG_NODE`, `GGML_OPENVINO_ENABLE_KV_4D`, and `GGML_OPENVINO_DISABLE_SCALE_REORDER`. On GPU, also repeat `GGML_OPENVINO_MOE_OP=0` if used. `GGML_OPENVINO_SPILL_DIR` is optional on the first run and ignored in cache-only mode; host-weight release is disabled in cache-only mode.

`GGML_OPENVINO_KV_SLICE` is a runtime binding option for dynamic graphs and can differ between cache population and cache-only runs. The same dynamic compiled graph accepts full-capacity and live-prefix attention K/V tensors. Slicing is enabled by default for contiguous ordinary K/V roots with one allocated stream, one active sequence at offset zero, and no sliding-window attention. Recurrent convolution/GDN caches and their rollback snapshots always retain their full stored row bank. Other layouts use full bindings. Repopulate caches made before this option was removed from the fingerprint once without cache-only mode.

A missing or incompatible graph fails with an error instead of compiling with absent weights. The fingerprint uses the dynamic graph's topology, ports, model parameters, weights, settings, and OpenVINO version; changing only dynamic token or KV sizes does not require a new entry. A different workload can still require another graph; populate it first without cache-only mode.

## MTP sampling and active slots

Qwen3.5/Qwen3.6 MTP uses a pure top-k backend sampler. Dynamic stateless execution retains its sampling branches for every configured slot and output row, including inactive branches. One packed `sampling_rows` input selects logits rows at runtime. Graph node names and candidate-output ports stay fixed, so changing the active subset of four slots reuses the same compiled draft model instead of creating up to 15 variants.

Active candidate IDs and scores are written to the normal GGML outputs. Inactive branches read row 0 (the padding row when there are no logits) and write to private scratch tensors (device USM on GPU), without changing sampler state or touching inactive GGML buffers. The top-k computations remain separate per branch; this trades some extra sampling work for a stable graph interface. Other sampler chains retain their existing branch-selection behavior.

This is one draft model per compatible graph configuration, not one compiled blob for the whole server. The trunk and other graph stages still have their own entries. Different sampler configurations, recurrent capacities, rollback modes or incompatible KV layouts can require additional models. Cache-only mode still requires initial preparation; changing just the active subset no longer requires exhaustive subset priming.

The generic recurrent-cache translation invalidates blobs made with the former single-slot shortcuts. Run once without `GGML_OPENVINO_COMPILED_MODEL_CACHE_ONLY` to populate compatible entries before enabling cache-only mode again.

## Restrictions

- Cache-only mode requires Linux or Windows and mmap loading (`--load-mode mmap`, or the default when all selected devices support mmap). Do not use tensor validation or mlock when trying to avoid weight reads.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
#include "align_eltwise_ranks.h"
#include "align-eltwise-ranks.h"

#include <numeric>
#include <openvino/op/add.hpp>
#include <openvino/op/constant.hpp>
#include <openvino/op/divide.hpp>
#include <openvino/op/multiply.hpp>
#include <openvino/op/power.hpp>
#include <openvino/op/sqrt.hpp>
#include <openvino/op/subtract.hpp>
#include <openvino/op/unsqueeze.hpp>
#include <openvino/pass/pattern/op/wrap_type.hpp>

namespace ov {
namespace frontend {
namespace ggml {
namespace pass {
namespace ggml_openvino {

namespace {

// True for an RMS-norm output, x * (1 / sqrt(mean(x^2) + eps)) as translate_rms_norm builds it, optionally
// scaled by the norm weight.
// True for an RMS-norm output, x * (1 / sqrt(mean(x^2) + eps)) or x * pow(mean(x^2) + eps, -0.5), optionally scaled
// by the norm weight.
bool is_rms_norm_output(const ov::Output<ov::Node> & value, int depth = 1) {
const auto * node = value.get_node();
if (!ov::is_type<ov::op::v1::Multiply>(node)) {
Expand All @@ -29,6 +27,9 @@ bool is_rms_norm_output(const ov::Output<ov::Node> & value, int depth = 1) {
if (ov::is_type<ov::op::v1::Divide>(src) && ov::is_type<ov::op::v0::Sqrt>(src->get_input_node_ptr(1))) {
return true;
}
if (ov::is_type<ov::op::v1::Power>(src) && ov::is_type<ov::op::v0::Constant>(src->get_input_node_ptr(1))) {
return true;
}
if (depth > 0 && is_rms_norm_output(input, depth - 1)) {
return true;
}
Expand All @@ -50,11 +51,9 @@ AlignEltwiseOperandRanks::AlignEltwiseOperandRanks() {
auto lhs = node->input_value(0);
auto rhs = node->input_value(1);

// A tensor-vs-Constant mismatch is the norm's own eps / 1-over-sqrt arithmetic. That
// folds into the `rms` primitive itself instead of becoming a fused eltwise post-op,
// so it is not affected and is left alone.
if (ov::is_type<ov::op::v0::Constant>(lhs.get_node()) ||
ov::is_type<ov::op::v0::Constant>(rhs.get_node())) {
// A tensor-vs-Constant mismatch is the norm's own eps / 1-over-sqrt arithmetic, which folds into the `rms`
// primitive itself instead of becoming a fused eltwise post-op, so it is not affected.
if (ov::is_type<ov::op::v0::Constant>(lhs.get_node()) || ov::is_type<ov::op::v0::Constant>(rhs.get_node())) {
return false;
}

Expand All @@ -67,9 +66,9 @@ AlignEltwiseOperandRanks::AlignEltwiseOperandRanks() {
const size_t shorter_idx = lhs_rank.get_length() < rhs_rank.get_length() ? 0 : 1;
const auto & shorter = shorter_idx == 0 ? lhs : rhs;

// The defect is with the norm output as the higher-rank operand. When the norm output is the
// lower-rank one (gemma-3 adds it to a rank-4 residual), unsqueezing it puts the Unsqueeze between
// `rms` and its post-op, and the GPU plugin then computes the layer wrongly.
// The defect is with the norm output as the higher-rank operand. When the norm output is the lower-rank
// one, unsqueezing it puts the Unsqueeze between `rms` and its post-op, and the plugin then computes the
// layer wrongly.
if (is_rms_norm_output(shorter)) {
return false;
}
Expand All @@ -85,12 +84,8 @@ AlignEltwiseOperandRanks::AlignEltwiseOperandRanks() {
return true;
};

register_matcher(
std::make_shared<ov::pass::pattern::Matcher>(eltwise_m, "ov::frontend::ggml::pass::AlignEltwiseOperandRanks"),
callback);
register_matcher(std::make_shared<ov::pass::pattern::Matcher>(eltwise_m, "ggml_openvino::AlignEltwiseOperandRanks"),
callback);
}

} // namespace pass
} // namespace ggml
} // namespace frontend
} // namespace ov
} // namespace ggml_openvino
25 changes: 25 additions & 0 deletions ggml/src/ggml-openvino/align-eltwise-ranks.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#pragma once

#include "openvino/pass/matcher_pass.hpp"

namespace ggml_openvino {

// Gives a binary eltwise op's two operands the same rank, by unsqueezing leading axes onto the shorter one.
//
// This is semantically a no-op (NUMPY broadcasting already left-pads the lower-rank operand with 1s, and the result
// rank is max(rank_a, rank_b) either way). It exists purely to work around an OpenVINO GPU-plugin defect: an eltwise
// op whose operands differ in rank is computed incorrectly once the plugin fuses it as a post-op into an `rms`
// primitive (e.g. a rank-3 residual added to a rank-4 RMS-norm output; the model degenerates into repeated tokens on
// GPU while CPU is correct). Equalising the ranks keeps the fusion and makes it compute the right answer.
//
// Only applies when both operands are real tensors: a tensor-vs-Constant mismatch is the RMS norm's own eps/rsqrt
// arithmetic, which folds into the `rms` primitive and is not affected. The norm output itself is never unsqueezed:
// when it is the lower-rank operand, that breaks the fused path instead. Registered for GPU only, disabled by
// GGML_OPENVINO_DISABLE_ELTWISE_RANK_ALIGN. Remove once the plugin guards that fusion.
class AlignEltwiseOperandRanks : public ov::pass::MatcherPass {
public:
OPENVINO_MATCHER_PASS_RTTI("ggml_openvino::AlignEltwiseOperandRanks")
AlignEltwiseOperandRanks();
};

} // namespace ggml_openvino
45 changes: 45 additions & 0 deletions ggml/src/ggml-openvino/dev_doc/MTP-SAMPLING-GRAPH.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Stable multislot MTP graph

The captured UD draft graph contains 107 nodes regardless of which of four slots are active. It is the single MTP attention/MoE layer, not the recurrent trunk. Two speculative tokens require two consecutive draft calls, batched over active sequences.

```text
MTP token IDs + input hidden state
|
0-84: MTP layer and normalization, N active sequences
|
85: logits [248320, N]
86: PAD adds one safe row
|
+-- 87-91: slot 0 sampling
+-- 92-96: slot 1 sampling
+-- 97-101: slot 2 sampling
+-- 102-106: slot 3 sampling
```

Each branch contains VIEW, two Reshapes, TopK (ten candidate IDs), and GET_ROWS (their scores). Ten is the candidate count, not the speculative-token count.

| Active slots | Sampling COMPUTE flags, slots 0-3 | Raw/current nodes | Old filtered nodes | Packed sampling_rows |
|---|---|---:|---:|---|
| 3 | `[0,0,0,1]` | 107 | 92 | `[0,0,0,0]` |
| 0,2 | `[1,0,1,0]` | 107 | 97 | `[0,0,1,0]` |
| All four | `[1,1,1,1]` | 107 | 107 | `[0,1,2,3]` |

Old counts apply the old COMPUTE filter to the captures. Unselected nodes remain in the raw cgraph. Previously, removing them changed translated topology, slot-specific row Parameter names and output ports; even equal-sized subsets such as `{0,1}` and `{0,2}` differed. This could trigger up to 15 draft variants, with compilation/import on first use or a missing-cache error in cache-only mode.

Now all pure top-k branches remain. Their names include stable graph ordinals even when inactive. One int64 `sampling_rows` Parameter supplies row indices at runtime. For `{0,2}`, the two logits rows belong to slots 0 and 2:

```text
sampling_rows = [0, 0, 1, 0]
slot 0 -> row 0 -> normal candidate buffers
slot 1 -> row 0 -> private scratch, ignored
slot 2 -> row 1 -> normal candidate buffers
slot 3 -> row 0 -> private scratch, ignored
```

The vector is not an active mask. Host-side COMPUTE flags select normal versus scratch output destinations. PAD provides a valid row when there are no logits. Inactive outputs use device USM on GPU and do not affect sampler state or acceptance. Other sampler chains retain their selected-branch semantics.

Only small sampling work executes for inactive slots. The MTP layer and output projection still process N active rows. Top-k is separate per branch, not yet one batched TopK. The observed draft interface has 10 inputs and 12 outputs: eight candidate ID/score outputs, hidden state, full logits and two KV Results.

Dump shapes use GGML order `[width, rows, dim2, dim3]`; OV reverses it. `view_offs` is in bytes: one logits row occupies `248320 * 4 = 993280` bytes. Buffer labels describe GGML storage, not the device executing imported GPU operations.

The captures used cache-only mode, four slots, context 8192 and the default two-token MTP settings.
Loading