Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
43d7da0
kernels: IQ1_S (GGML type 19) on the GPU expert and mmvq paths
yudhanjaya Nov 21, 2026
b6c6448
poly: an engine for Inkling 2 Mini (inkling2, inkling2_loop)
okada-shogo Nov 21, 2026
10375de
serve: Inkling 2 Mini's chat format, tool calls and tokenizer
okada-shogo Nov 21, 2026
d784ec4
setup: Inkling 2 Mini as an experimental family (one NVIDIA card, Linux)
okada-shogo Nov 21, 2026
939dc4a
poly: Inkling 2 Mini reads pictures (rows not normed)
okada-shogo Nov 21, 2026
073da6d
serve: Inkling 2 Mini's picture marks
okada-shogo Nov 21, 2026
129d539
setup: images for Inkling 2 Mini, opt-in, with an encoder of its own
okada-shogo Nov 21, 2026
c808b53
serve: test_responses waits for its own sampler thread
okada-shogo Nov 21, 2026
7df0399
poly: cpu_lowbit builds with MSVC
okada-shogo Nov 21, 2026
9fcfbc3
kernels: Inkling's per-sequence steps for a token of each of several …
okada-shogo Nov 21, 2026
d525c9a
poly: Inkling 2 Mini takes batch slots (--batch, "parallel")
okada-shogo Nov 21, 2026
bca58d5
setup: "parallel" for Inkling 2 Mini, as for the other families
okada-shogo Nov 21, 2026
791be9e
docs: Inkling 2 Mini's batch slots, measured
okada-shogo Nov 21, 2026
7f3f457
poly: Inkling 2 Mini's prompt attention on the tensor cores
okada-shogo Nov 21, 2026
712030b
kernels: Inkling's convolution state after tokens of a window
okada-shogo Nov 21, 2026
68d4c86
poly: Inkling 2 Mini takes guessed windows (--window, opt-in)
okada-shogo Nov 21, 2026
7d45afd
docs: Inkling 2 Mini's guesses from the conversation, measured
okada-shogo Nov 21, 2026
59a89d9
kernels: several matrices of one input in one mmvq launch
okada-shogo Nov 21, 2026
c5cdb45
poly: Inkling 2 Mini's projections of a visit in one launch per format
okada-shogo Nov 21, 2026
a4fa510
kernels: the cached experts' slots launches a warp a row, opt-in
okada-shogo Nov 21, 2026
2b5363d
poly: Inkling 2 Mini's cached experts a warp a row
okada-shogo Nov 21, 2026
249b2de
docs: Inkling 2 Mini's writing speed after a 302-token prompt, measur…
okada-shogo Nov 21, 2026
c5f26c6
poly: Inkling 2 Mini's restored rows written on the engine's stream
okada-shogo Nov 21, 2026
fcffba2
poly: time Inkling 2 Mini's decode attention at long contexts
okada-shogo Nov 21, 2026
f5e5a7e
poly: Inkling 2 Mini's decode attention in fewer instructions, same bits
okada-shogo Nov 21, 2026
55ba8c9
poly: STRATA_KV_INT8 for Inkling 2 Mini: decode attention by __dp4a
okada-shogo Nov 21, 2026
99e993f
poly_logits_dump: --vram-reserve-mib, as strata-poly's
okada-shogo Nov 21, 2026
4d7ca06
docs: Inkling 2 Mini's STRATA_KV_INT8, measured
okada-shogo Nov 21, 2026
802b20d
poly: Inkling 2 Mini's prompt reads do not wait for the copies to the…
okada-shogo Nov 21, 2026
2424377
docs: Inkling 2 Mini's prompt speed with the copies to the card out o…
okada-shogo Nov 21, 2026
aaa0aff
kernels: Inkling 2 Mini's position-taking launches can read it on the…
okada-shogo Nov 21, 2026
bd1e781
poly: an architecture can have its layers recorded only as a whole call
okada-shogo Nov 21, 2026
c2d0d46
poly: Inkling 2 Mini's decode token as one CUDA graph when its expert…
okada-shogo Nov 21, 2026
03d7531
docs: Inkling 2 Mini's writing as one CUDA graph a token, measured
okada-shogo Nov 21, 2026
9e87dd0
kernels: several rows' RMS norm and Q8_1 copy in one launch, each its…
okada-shogo Nov 21, 2026
99fa53a
poly: Inkling 2 Mini's kernels for a token in fewer launches, same bits
okada-shogo Nov 21, 2026
afeb0d1
poly: an architecture can take the card's expert sum into its layer tail
okada-shogo Nov 21, 2026
a2c2cec
poly: Inkling 2 Mini's decode token in fewer launches, same bits
okada-shogo Nov 21, 2026
ea27cab
poly: Inkling 2 Mini's Q8_1 copies made by the launches that make the…
okada-shogo Nov 21, 2026
3547647
poly: an architecture can activate its experts straight into Q8_1
okada-shogo Nov 21, 2026
452f9a9
poly: Inkling 2 Mini's Q8_1 copies in the launches before them
okada-shogo Nov 21, 2026
999ad05
kernels: a token's matrices of several formats and one input in one m…
okada-shogo Nov 21, 2026
0e0eab8
poly: a token's projections of several formats in one launch (lin_jobs)
okada-shogo Nov 21, 2026
9fe4fee
poly: Inkling 2 Mini splits its layers across cards (--layer-split)
okada-shogo Nov 21, 2026
55eecc1
setup: Inkling 2 Mini on several cards, as the other strata-poly fami…
okada-shogo Nov 21, 2026
bbbd736
docs: Inkling 2 Mini on several cards
okada-shogo Nov 21, 2026
39b0dc1
poly: a card with several parts of a split fills its expert caches last
okada-shogo Nov 21, 2026
6e61054
poly: Inkling 2 Mini's fast-math copies of native_mmvq.cu's operation…
okada-shogo Nov 21, 2026
cde2d1b
poly: STRATA_GPU_EXPERTS=N, a test knob that caches exactly N experts
okada-shogo Nov 22, 2026
ec63e7f
poly: a frozen or capped expert cache logs which experts it holds
okada-shogo Nov 22, 2026
1dcd568
poly: Inkling 2 Mini's one-token mixes spread over many blocks
okada-shogo Nov 22, 2026
1b6dca2
poly: Mmq::mul_tiles, llama.cpp's MMQ tiles over a table of tiles of …
okada-shogo Nov 22, 2026
576681c
poly: Inkling 2's prompt experts through Mmq::mul_tiles(), opt-in (ST…
okada-shogo Nov 22, 2026
454c45a
kernels: Inkling 2 Mini's position on the card, tested for a window's…
okada-shogo Nov 22, 2026
f5a2916
poly: an architecture can route a window's tokens on the card
okada-shogo Nov 22, 2026
e0b37b9
poly: Inkling 2 Mini's window of guesses as one CUDA graph when its e…
okada-shogo Nov 22, 2026
f4741cc
docs: Inkling 2 Mini's window of guesses is recorded as one CUDA grap…
okada-shogo Nov 22, 2026
0720b38
kernels: Inkling 2 Mini's DSpark drafter: the model's rows fused, blo…
okada-shogo Nov 21, 2026
3b2189e
poly: Inkling 2 Mini guesses with its DSpark drafter (--draft-model, …
okada-shogo Nov 22, 2026
a6511c2
setup: Inkling 2 Mini's DSpark drafter, opt-in, offered where the car…
okada-shogo Nov 21, 2026
6fa5fa9
docs: Inkling 2 Mini's DSpark drafter, measured
okada-shogo Nov 22, 2026
18ed540
docs: Inkling 2 Mini's DSpark drafter's windows are recorded as one C…
okada-shogo Nov 22, 2026
e6c285e
poly: run Inkling 2 Mini on AMD (HIP)
Nov 21, 2026
1d91dab
poly: NVFP4's int8 prompt tiles on HIP, on request
Nov 21, 2026
16f3585
kernels: Inkling's prompt attention, fewer shared reads and RDNA4's m…
Nov 21, 2026
07e6249
kernels: Inkling's WMMA prompt attention builds on CUDA again
okada-shogo Nov 22, 2026
63ec88f
poly: VRAM pieces of one size in each reservation on HIP
okada-shogo Nov 22, 2026
a92763c
poly: the soft limit of open files up to the hard one on HIP
okada-shogo Nov 22, 2026
032794d
kernels: Inkling's WMMA prompt attention applies the gate and the Q8_…
okada-shogo Nov 22, 2026
e61c27c
hip_compat: the runtime names poly_inkling_kernels_test uses
okada-shogo Nov 22, 2026
cee948e
poly: NVFP4's int8 prompt tiles by default for Inkling 2 Mini on HIP
okada-shogo Nov 22, 2026
aabcf2d
docs: Inkling 2 Mini's page as of this round
okada-shogo Nov 22, 2026
e85c7aa
hip_compat: map cudaOccupancyMaxActiveBlocksPerMultiprocessor for ker…
okada-shogo Nov 22, 2026
dbd4227
kernels: Inkling's unsplit prompt attention reads TQ 2's weights one …
okada-shogo Nov 22, 2026
f0fc2a2
poly: Inkling 2 Mini's prompt attention in 32 rows a warp on the A100
okada-shogo Nov 21, 2026
c69df6a
poly: Inkling 2 Mini's window layers and short prompts back on attn_m…
okada-shogo Nov 21, 2026
d4eba79
kernels: Inkling 2 Mini's one-token mixes in one block a mix on HIP
okada-shogo Nov 22, 2026
3cb428d
docs, setup: Inkling 2 Mini on AMD, the A100's prompt attention and t…
okada-shogo Nov 22, 2026
2689572
metal: Mmq::fits() of the Allow signature and the tables of tiles unp…
okada-shogo Nov 22, 2026
22c5782
hip_compat: map cudaLaunchCooperativeKernel and cudaDevAttrCooperativ…
okada-shogo Nov 22, 2026
5aa64e3
serve: strata_prefix renders an Inkling prompt's head with its effort…
okada-shogo Nov 22, 2026
48a8e95
serve: an Inkling call whose JSON is followed by the next block's hea…
okada-shogo Nov 22, 2026
610aa70
kernels: Inkling 2 Mini's spread one-token mixes as a cooperative launch
okada-shogo Nov 22, 2026
b3abda4
kernels: Inkling's opt-in WMMA prompt attention checks the card and R…
okada-shogo Nov 22, 2026
89b13b7
kernels: Inkling's host checks: empty calls, mma_attention() once a d…
okada-shogo Nov 22, 2026
3f995f2
kernels: Inkling's clip reads x without __restrict__, x may be y
okada-shogo Nov 22, 2026
cca1975
poly: the open-file limit on HIP goes up, never down
okada-shogo Nov 22, 2026
fa06aaf
poly: an attention cache's reservation is whole pieces of its growth …
okada-shogo Nov 22, 2026
a8aaf13
poly: what the HIP line of Engine::open()'s Inkling 2 says
okada-shogo Nov 22, 2026
95b4fe7
poly: the DSpark drafter's rows in chunks s_ctx_ holds
okada-shogo Nov 22, 2026
0994a85
poly: --window past the DSpark drafter's block is refused
okada-shogo Nov 22, 2026
4533c3f
poly: --check-stagger with 23 or more sequences shifts in range
okada-shogo Nov 22, 2026
b0471e9
poly: plan_tiles() checks the width it looks up; poly_mmq_tiles_test'…
okada-shogo Nov 22, 2026
ec12c39
setup: --dspark's help and the Inkling tests say every expert
okada-shogo Nov 22, 2026
d625cda
setup: says so when the DSpark drafter sets "parallel" to 1
okada-shogo Nov 22, 2026
fd33976
setup: the reason a family is NVIDIA-only is the family's
okada-shogo Nov 22, 2026
79a8d99
setup: the drafter's prompt says when answers stay the same; --dspark…
okada-shogo Nov 22, 2026
3e8284f
kernels: inkling_attend()'s A100 path is past 2,048 keys
okada-shogo Nov 22, 2026
dcef070
docs: NVFP4's RX 9060 XT line without its ROCm version
okada-shogo Nov 22, 2026
10cc170
docs, mcp: Inkling 2 Mini takes several cards and pictures where it s…
okada-shogo Nov 22, 2026
a9ffc2b
docs: Inkling 2 Mini's page, one current table a topic
okada-shogo Nov 22, 2026
a34789a
poly: prompt batches' F32 products of 33 to 256 outputs in larger til…
okada-shogo Nov 22, 2026
6834c2c
poly: Inkling 2 Mini's shared expert launched as it is where its head…
okada-shogo Nov 22, 2026
70375a2
poly: Inkling 2 Mini's CPU threads, one a physical core
okada-shogo Nov 22, 2026
fc96949
docs, setup: Inkling 2 Mini on Windows and the RX 9060 XT's ROCm as t…
okada-shogo Nov 22, 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
122 changes: 93 additions & 29 deletions CMakeLists.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ with an 8 GB card as well.
own, made to read pictures: a file of 16 to 29 GB.
- **[Kolibri 1](docs/models/kolibri.md)** by Aleph Alpha, which writes German as well as English: a file of 29 to 48 GB,
most of which stays in RAM beside a small card.
- **[Inkling 2 Mini](docs/models/inkling.md)** by Thinking Machines, experimental: a file of 9 to 28 GB, on one or
more NVIDIA cards under Linux.

The server can change between installed models while it runs ([how](docs/BACKENDS.md#changing-the-model)).

Expand Down
7 changes: 7 additions & 0 deletions docs/AI_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ one 32 GB V100 wrote 91 tokens/s and read a 32K prompt at 1,017 tokens/s (first
layers split wrote 93 and read it at 2,179 (first token 15.3 s); three runs, the medians above. `--model`
takes Q4_K_M, Q2_K on a PC with little RAM, or Q3_K_M by name. The support is new, the GGUF independent: ask first.

`--family inkling` (Inkling 2 Mini, by Thinking Machines, in ggml-org's GGUF files) is the newest model on the same
engine, and experimental: Linux, NVIDIA cards (one, or several that split its layers), pictures opt-in, a 17.6 GB
(IQ4_NL), 9.1 GB (`--model UD-Q2_K_XL`, Unsloth's, the fastest) or 27.8 GB (`--model Q8_0`) download, about 22, 14 or
32 GB of RAM beside an 8 GB card by setup's estimate. On an 8 GB RTX 2070 Super it wrote 38.8 to 40.0 tokens/s with
IQ4_NL and 51.1 to 52.3 with UD-Q2_K_XL after a 302-token prompt ([its page](models/inkling.md)). Take it only when
the user asks for it.

## 4. Run setup without questions

From the PolyStrata folder (Windows: in `cmd`, or `cmd /c START-HERE.bat ...` from PowerShell):
Expand Down
8 changes: 7 additions & 1 deletion docs/BACKENDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ straight to it. The larger models have pages of their own,
| `clover` | Clover-35B-A3B-Preview | maternion Q3_K_M | 16.8 GB | about 20 GB |
| | | IsValorum APEX-I-NanoPlus | 12.6 GB | about 16 GB |
| | | maternion Q4_K_M | 21.2 GB | about 25 GB |
| `inkling` | Inkling 2 Mini (experimental) | ggml-org IQ4_NL | 17.6 GB | about 22 GB |
| | | Unsloth UD-Q2_K_XL | 9.1 GB | about 14 GB |
| | | ggml-org Q8_0 | 27.8 GB | about 32 GB |

Kolibri 1's file is 29 to 48 GB, so its three numbers are the RAM beside an 8 GB card: an 8 GB card holds
about a tenth of its 19,200 experts, reads the rest through the OS cache; a 32 GB card fits about two thirds
Expand Down Expand Up @@ -250,9 +253,12 @@ and, by the tokenizer's `pre` name, how the model writes its reasoning and its t
| LFM2.5 | the prompt opens it, `</think>` ends it | `<\|tool_call_start\|>[NAME(K='V', ...), NAME2()]<\|tool_call_end\|>` |
| Flint | `<think>` to `</think>`, opened by the model | as GLM's |
| Kolibri 1 | the prompt opens it, `</think>` ends it | a JSON object in the wrapper: `{"name": NAME, "arguments": {...}}` |
| Inkling 2 Mini | a `<\|message_model\|><\|content_thinking\|>` block, opened by the model, to `<\|end_message\|>` | `<\|message_model\|>NAME<\|content_invoke_tool_json\|>{"name":NAME,"args":{...}}<\|end_message\|>` |

Gemma 4's template thinks only when it is told to, reads a tool in OpenAI's shape and starts with the tokenizer's
`<bos>`; the server gives it all three. A tool's answers are put in the order of their calls for every model,
`<bos>`; the server gives it all three. Inkling 2 Mini's template reads only `reasoning_effort` (thinking off is its
`none`) and has no generation prompt: the model writes its reply's first header itself
([its page](models/inkling.md#how-it-talks)). A tool's answers are put in the order of their calls for every model,
because a model reads them by position.

## The registry
Expand Down
24 changes: 20 additions & 4 deletions docs/BATCHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ same server): its numbers, what a slot costs and where setup recommends it are i
## The strata-poly models

`"parallel": N` in the model's config (`strata-<model>.json`), or `--parallel N` when you run setup, works for
GLM 5.3 Flash, DeepSeek V4 Flash, LFM2.5, Flint, Qwen3.6, Ornith 1.5, Gemma 4, Tiel Coder and MiniCPM-V too, up to
8. The server drives it the way it drives the Strata project's engine (below), with the same lines:
GLM 5.3 Flash, DeepSeek V4 Flash, LFM2.5, Flint, Qwen3.6, Ornith 1.5, Gemma 4, Tiel Coder, MiniCPM-V and Inkling 2
Mini too, up to 8. The server drives it the way it drives the Strata project's engine (below), with the same lines:

- A request alone writes on its own and guesses ahead as always, so one user sees no change.
- When a second one comes, the first goes on in a batch slot from where it was, nothing read again, and the two
Expand All @@ -44,6 +44,19 @@ gains more. On an RTX 5090 with Qwen3.6 UD-Q4_K_M, chats of 300 tokens through t
| 3 | 381-389 |
| 4 | 428-430 |

Inkling 2 Mini on an RTX 2070 Super 8 GB (Ryzen 5 3600XT, 62 GB DDR4), where most of its experts run on the CPU: chats
of 300 tokens through the server (128K context, q8_0 caches, the expert profile), tokens/s of all chats together, two
runs each, the server started again for each row ([models/inkling.md](models/inkling.md#several-requests-at-once) has
each chat's speed):

| Chats at once | `"parallel"` | IQ4_NL | UD-Q2_K_XL |
| ---: | ---: | ---: | ---: |
| 1 | 1 | 37.1-37.7 | 46.2-47.8 |
| 1 | 4 | 34.5-35.0 | 44.3-44.9 |
| 2 | 2 | 44.6-45.5 | 57.7-59.7 |
| 3 | 3 | 48.9-49.0 | 63.2-64.5 |
| 4 | 4 | 51.2-51.9 | 64.1-66.5 |

Each slot's attention rows take VRAM from the expert cache as its conversation grows, as the first conversation's
do. A model split across cards (`"layer_split"`) runs its slots card after card.

Expand All @@ -57,8 +70,11 @@ reason alone ([issue 55](https://github.com/VecSzn/PolyStrata/issues/55)). On th
laptop every token matched for Qwen3.6, Gemma 4 and LFM2.5 with 2 to 4 sequences and prompts of 19 to 3,000 tokens,
and on the RTX 5090 for Qwen3.6, MiniCPM-V, LFM2.5, DeepSeek V4 Flash and GLM 5.3 Flash with 3 sequences after
prompts of 64 and 3,000 tokens, and for Flint after prompts of 15 and 3,000 tokens, with every expert on the card
and with the card held to 8 GB. Through the server on the laptop, with the same four options in the run config,
three chats at once gave the text each gave alone, to the character.
and with the card held to 8 GB. On an RTX 2070 Super 8 GB every token matched for Inkling 2 Mini (IQ4_NL and
UD-Q2_K_XL, fp16 and q8_0 caches) with 2, 3 and 4 sequences after a prompt of 302 tokens, 4 after 3,000, and 4 with
`--check-stagger` (prompts of 16 to 3,000 tokens read while the others write, answers of 64 to 16 tokens).
Through the server on the laptop, with the same four options in the run config, three chats at once gave the text
each gave alone, to the character.

Without those options the text of a chat answered together can part from the one it gets alone after a few dozen
words, and so can two runs of the same chat alone. On the laptop that happened with the run config as setup writes
Expand Down
3 changes: 2 additions & 1 deletion docs/GLM.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ goes on from where it stopped, and an edit goes back to the nearest checkpoint.
| `--any-node` | | on a PC with several NUMA nodes, let the CPU threads run on any of them |
| `--no-graphs` | | launch a token's kernels one by one, not as the CUDA graph a layer that is recorded at the first token |
| `--expert-swaps N` | 64 | while an answer is written, experts on their way into VRAM at a time, each in place of a cached one the answer uses less; 0 = the cache stays as it was loaded |
| `--window N` | 4; 8 for the other models | the most tokens that go through the model together while an answer is written: the known one and guesses after it: the draft block's three at most, and more than three only from a repeat of eight tokens or more; 1 = no guesses |
| `--window N` | 4; for Inkling 2 Mini 1, or 4 with its drafter (`--draft-model`); 8 for the other models | the most tokens that go through the model together while an answer is written: the known one and guesses after it: the draft block's three at most, and more than three only from a repeat of eight tokens or more; 1 = no guesses |
| `--lookup N` | 3 | guess what followed an earlier repeat of the last N or more tokens; 0 = never |
| `--no-draft` | | do not run the block that guesses ahead |
| `--draft-model FILE.gguf` | | a file of the same model to take that block from, when `--model` has none; setup passes the one it downloaded |
Expand All @@ -281,6 +281,7 @@ goes on from where it stopped, and an edit goes back to the nearest checkpoint.
| `--eos-ids ID,ID,...` | from the GGUF | tokens that end a reply |
| `--tail-skip N` | 0; setup gives Qwen3.6 6 | an expert outside VRAM that every token of a window ranks at place N+1 or later among its experts is left out: faster, and the answers move a little |
| `STRATA_FREEZE_EXPERTS` | not set | hold the split of the routed experts between the card and the CPU still for the engine's whole run, so a greedy answer is a function of the request alone: same request, same answer, bit for bit. With guesses on (`--window` above 1 and a block or `--lookup`) the block's guesses and their windows still take their sizes from the machine's pace, which the freeze does not hold: on the cards measured so far it repeated with them on (RX 9060 XT, several thread counts and loads) and on one RTX 4070 laptop it did not — add `--window 1` for a repeat wherever the guesses are on. Measured cost: nothing measurable on the default path, 4-7% at a short prompt with the freeze set |
| `STRATA_GPU_EXPERTS=N` | not set | a test knob: the card's expert cache holds exactly the first N experts of the order it fills in (the expert profile's), for the engine's whole run, with the split frozen as `STRATA_FREEZE_EXPERTS` does, no uploads into the cache (`--expert-swaps 0`) and no VRAM resize. Two builds leave different VRAM free at load and so cache different numbers of experts, and their sums differ wherever the split does; with the same N and the same profile they hold the same experts, so their logits can be compared byte for byte without `--no-gpu-experts`. An N the VRAM cannot hold stops the load with an error. One card only (not with `STRATA_POLY_CARDS`). With this or `STRATA_FREEZE_EXPERTS` set, the load logs `cache set N experts fnv <hash>`: which experts the cache holds, to compare between runs (the same count can be a different set) |
| `STRATA_NO_SPILL=1` | not set | keep parked conversations' blobs in heap instead of writing them to temporary files; parking still works but RAM use grows accordingly |

`strata-poly` with no arguments prints the list, with the options for running it without the server.
Expand Down
12 changes: 8 additions & 4 deletions docs/MULTI_GPU.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,10 @@ pipelines them through the cards: see [BATCHING.md](BATCHING.md).

## The strata-poly models

Qwen3.6, Gemma 4, Ornith, Tiel Coder and GLM 5.3 Flash run on the strata-poly engine, which splits a model's layers
across cards too. Each card runs a range of layers and keeps the routed experts of those layers in its VRAM, as many
as fit. The last card also runs the output and the draft block, or Gemma 4's draft model. After its layers a card
copies the rows of the tokens it read into pinned RAM, and the next card reads them from there: one row of the
Qwen3.6, Gemma 4, Ornith, Tiel Coder, GLM 5.3 Flash and Inkling 2 Mini run on the strata-poly engine, which splits a
model's layers across cards too. Each card runs a range of layers and keeps the routed experts of those layers in its
VRAM, as many as fit. The last card also runs the output and the draft block, or Gemma 4's draft model. After its layers
a card copies the rows of the tokens it read into pinned RAM, and the next card reads them from there: one row of the
model's width a token, 8 KB for Qwen3.6. No NVLink or peer-to-peer access is needed.

A prompt read in several calls keeps the cards busy together when every routed expert is in VRAM, or when the
Expand Down Expand Up @@ -546,6 +546,10 @@ same container's cache; the engine now asks four times, a quarter of a second ap
says at load when the container has less than the model's files and 8 GiB. This pod has less than setup asks
for REAP50 beside 6.7 GiB of experts in VRAM, about 82 GB.

Inkling 2 Mini runs its layers 6 to 17 three times, and those stay on one card, so its cards start at layer 1 to 6 or
18 to 22, physical layers as the file numbers them; `"auto"` takes 6 or 18, whichever is nearer its share
([docs/models/inkling.md](models/inkling.md#two-or-more-cards)).

Not done yet:

- Only two cards under Linux have run it. Three cards and Windows were not tried.
Expand Down
20 changes: 15 additions & 5 deletions docs/NVFP4.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ FP16's range.

| mode | kernel | activations | one product vs FP64 (`mmq_nvfp4_parity`) |
|---|---|---|---|
| `w4a8` (default) | llama.cpp MMQ, int8 tensor cores | q8_1, float block scales | 0.53% |
| `w4a8` (CUDA's default; HIP's for Inkling 2, else on request) | llama.cpp MMQ, int8 tensor cores | q8_1, float block scales | 0.53% |
| `w4a4` | llama.cpp MMQ, Blackwell FP4 MMA (sm_120a only) | NVFP4 | 8.6% |
| `fp16` | dequantize + cuBLAS FP16 GEMM | FP16 | reference |

Expand Down Expand Up @@ -208,8 +208,9 @@ engine's own q8_1 kernels, which decode UE4M3/E2M1 in software. The engine was b
on the RTX 5090 with the host answering as that generation. On those builds `mmq_nvfp4_parity` and
`nvfp4_expert_gpu_parity` gave results identical to sm_120.

HIP: the decode kernels use no CUDA-only intrinsics. The NVFP4 MMQ instance and the W4A8 unit are CUDA-only and
guarded (`GGML_USE_HIP`). Neither was built for HIP here.
HIP: the decode kernels use no CUDA-only intrinsics. The NVFP4 MMQ instance (the FP4 MMA) is CUDA-only and guarded
(`GGML_USE_HIP`); the W4A8 unit (`src/poly/mmq_nvfp4.cu`) is device-generic and built for HIP as well
(`STRATA_POLY_NVFP4_INT8`).

## strata-poly: NVFP4 GGUFs

Expand All @@ -229,8 +230,17 @@ too small for the blocks' E4M3 scales, and llama.cpp multiplies the product by t
products before the activation (`ExpertScales`, in each path's SwiGLU), and its down scale on its weight in the
token's sum. Down's scale on the hidden instead would leave it near 1e-5 before its 8-bit quantization (see "Where
the global scales go"). Only an NVFP4 tensor's `.scale` is read: Gemma 4's `ffn_down_exps.scale` is its own.
- Not built: Metal (no NVFP4 kernels); HIP (no NVFP4 prompt product, the batch goes through the decode kernels; not
run here).
- HIP: the same W4A8 tiles, built for the HIP architectures (`src/poly/mmq_nvfp4.cu` is device-generic; the FP4
MMA is CUDA's alone). Inkling 2 takes them by default, as on CUDA (`Engine::nvfp4_int8_`, `Mmq::nvfp4_int8`);
another family takes them with `STRATA_PREFILL_NVFP4=w4a8`, read by `nvfp4_int8_on()` in `src/poly/mmq.cu`, and
keeps the decode kernels for its batch, and its previous bits, without it. w4a4 and w4a4x2 leave that choice as it
is, and any other value of the switch keeps the tiles out (Inkling 2's too). Measured on an RX 9060 XT (gfx1200,
ROCm 10.1):
Inkling 2 Mini UD-Q2_K_XL, a 2,048-token prompt 177.3 -> 402.3 tok/s when the nine of its eighteen MoE
layers whose down matrix is NVFP4 stopped going through the decode kernels a token at a time; 286 tokens 174.7 ->
390.7. Greedy ids identical over 32 tokens at both sizes. On an RX 9070 XT (gfx1201, ROCm 7.2.4), 3,072 of 3,072
experts in VRAM: 2,048 tokens 372.8 -> 997.7 tok/s, 8,192 tokens 343.9 -> 848.3, writing 85.9 -> 86.8.
- Not built: Metal (no NVFP4 kernels).

Measured on lab-pro6000 (RTX PRO 6000 Blackwell Server Edition, sm_120, other users' jobs on the same card), with
`WhiskyAKM/LFM2.5-24B-A2B-NVFP4-GGUF` (every matrix NVFP4, no global scales).
Expand Down
3 changes: 3 additions & 0 deletions docs/Q8_KV.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Gemma 4 has its own two, in the same Q8_0 rule but its own layout: `--kv int8` a
On `kolibri1`, `STRATA_KV_INT8=1` makes both the decode and the prompt read the q8_0 cache with the int8
reader below (`attend_int8`) instead of the float q8 readers. It is experimental: the queries are quantized
too, so the answers change slightly, and it is opt-in.
On `inkling2`, `STRATA_KV_INT8=1` takes a decoded token's attention of a full layer with a room of 32K or more by
`__dp4a` on the q8_0 cache, the queries quantized too; window layers, shorter rooms and the prompt keep the float
readers ([Inkling 2 Mini: long contexts](models/inkling.md#long-contexts)). Opt-in as well.

## What the format is

Expand Down
Loading