49 Commits
Author SHA1 Message Date
Niko1221 87a1d06792 docs(batching): two long Inkling conversations keep their slots with --parallel 2 (#7226)
What the routing now does, the switches (STRATA_INKLING_KEEP_CHATS, STRATA_INKLING_KEEP_IDLE_S), the price (the chat in slot 1 decodes without drafts)
and the measured A/B on an RTX A4000 with SQ-15 (cached tokens, first-token time, decode of the chat in slot 1, drafter on and off).
2026-11-26 23:04:56 +01:00
Niko1221 0d840927dd serve(inkling): say once that a side request replaced the cached chat; docs say it plainly at the top
At --parallel 1 a short request between two turns (a title, a summary) replaces
the cached conversation and the next turn reads its history again. The server
now prints one line per run when that happens ("a side request (N tokens)
replaced the cached chat (M tokens); --parallel 2 keeps it"). Serve layer only:
the planner and the default (one slot) are unchanged. docs/BATCHING.md states
the advice and its cost (about 164 MiB of video memory) near the top.

Tests: serve/test_inkling_slot_routing.py (one slot: exactly one line after
three side requests; two slots: none).
2026-11-23 11:01:00 +01:00
Niko1221 697321dff0 docs(batching): Inkling-2-Mini keeps one conversation per slot; what --parallel 2 buys an agent
Where the server sends an Inkling request (the follow-up to the slot that holds
its start, a short helper request to another slot while slot 0 holds a long
conversation), what --parallel 1 cannot do, and what the second slot costs.
2026-11-23 10:49:31 +01:00
Niko1221 f653fe9489 engine log: which batch-row switches are on at start-up, and when attention keeps its per-row launches (#3245, #2234)
From PR #3245 (yi-sudo; its commit 0f31ba6ea), author kept; hand port. STRATA_BATCH_ATTN_ROWS and
STRATA_BATCH_GDN_GROUPS (opt-in) were silent: nothing said whether they were picked up, and attention quietly kept
its per-row launches when a slot's KV streams. With either on, the verifier prints one line after its "batch windows
of up to N sequences" line (once per stage of a layer split): which are on, and "the KV streams (--kv-resident), so
attention keeps one launch per row" when that applies. Off (the default) nothing is printed and the launches are the
same. The two switches are read once at their first use through small accessor functions, as the neighbouring switches
now are (the PR made them namespace-scope constants, which would read them before main() sets the platform defaults).
docs/BATCHING.md shows the line. The new line is in the results file's text list.
2026-11-19 16:19:25 +01:00
Niko1221 ba971b3ab0 docs: every command and path in the user-facing pages names the moved place (terminal/tools, terminal/serve, tools/packaging, app/, engine/sycl, docs/bench-results ...)
The pages a user follows still told them to run `python tools/iq_pack.py`, `.venv/bin/python -m serve.server`, `packaging/monitor_bundle.py`,
`docker/build.sh`, `tools\hip\build_windows.bat`, `bench.sh`, `Strata\tools\strata_mcp.py` and to read `src/...`, `sycl/...`, `apps/...`: places that no longer
exist. Found with tools/layout/checks/docs_paths.py (each old path existed before the move and has a new place on this tree) and fixed there, plus the
Windows-style and example paths its tokenizer does not read:
- scripts and tools: `tools/<python tool>` -> `terminal/tools/...`, `serve/...`, `strata_cli/...`, `strata_control/...`, `data/...`, `requirements*.txt`, `setup.py` and
  `strata.py` in a command -> `terminal/...`; `.venv/bin/...` -> `terminal/.venv/bin/...`; `python -m serve.server` -> `python terminal/serve/server.py`;
- repository tooling: `packaging/` -> `tools/packaging/`, `docker/` -> `tools/docker/`, `bench.sh` and `BENCH.bat` -> `tools/...`;
- engine and app sources named in the text: `src/`, `include/`, `metal/`, `sycl/`, `third_party/` -> `engine/...`, `apps/` -> `app/`;
- benchmark results: `bench/results` -> `docs/bench-results` (strata_bench.py writes there);
- the MCP server examples: `Strata\tools\strata_mcp.py` -> `Strata\terminal\tools\strata_mcp.py`.
Only commands and the paths in them changed. A file name in a sentence (`setup.py`, `strata.py`) and the sentences that describe an INSTALLED Strata's
layout (`strata_control/update_keys.json` inside every installed Strata) are left as they are, as are docs/ORCA_Q4_K_S.md (it tells the reader to build the
v0.2.15 tag), the benchmark reports and the history pages. No line was dropped: every command still exists.
2026-11-17 17:19:50 +01:00
Niko1221 4011ad2ebe Merge f-1116-tui (ee7033605): Control / Terminal fixes of 11-16 (One-address serving, run-defaults.json, Qwen3.6 in the model list and import, DFlash2 fallbacks and HF_ENDPOINT, Settings view values kept, readiness telemetry probe, native helper contract, menu colours, --draft-vocab) 2026-11-16 16:55:52 +01:00
Niko1221 3e26b4e157 [Engine] remove llama.cpp's MMQ build path and the vendored ggml-cuda (own-stack step 10)
No release build compiled MMQ any more (x86 since 0.2.14, the DGX Spark since f-spark-nommq), so the path goes:
- CMake: the options STRATA_MMQ, STRATA_PREFILL_MMQ, STRATA_MMQ_TAB, STRATA_MMQ_TQ_OVERLAY, STRATA_ORCA_Q4KS_MMQ and STRATA_MMQ_KQUANTS, the
  macros strata_cuda_mmq / strata_hip_mmq / strata_pf_own_mirror / strata_ggml_mmq_types and the MMQ tests. Every CUDA and HIP build takes
  strata_cuda_pf_own / strata_hip_pf_own (Strata's own prompt kernels, mmq_absent.cpp for the MMQ half of moe_mmq.hpp), as the release builds did.
- Sources: moe_mmq.cu, moe_mmq_tab.*, mmq_tab_instance.cu.in, mmq_kq_lib.cu / mmq_kq_loader.cpp (libstrata_kq), mmq_nvfp4_w4a4/w4a8.cu,
  moe_iq4_w4a8.cu (called only from moe_mmq.cu), moe_ws*.cu, ggml_cuda_host.cu, mmq_expert_bench.cpp, mmq_nvfp4_parity.cpp, two headers,
  nine MMQ tests, the split engine's qdot_test.cu (its ggml-cuda oracle; qdot_golden stays), cmake/strata_ggml_tq_overlay.cmake and its test.
- third_party/strata-ggml/ggml/src/ggml-cuda and ggml-cuda-tq (64 manifest rows; check_vendored: 62 files, ok).
- The flags out of packaging/build_cuda_linux.sh, build_cuda_windows.py, build_hip_linux.sh, build_hip_gfx1103.sh, build_split_hip.sh,
  tools/hip/build_windows.bat, spark/build_engine.sh, setup.py, CMakePresets.json (cuda-compile builds strata only) and the Dockerfile.
  The strata_kq probes of the package scripts and setup's clean-up of an old libstrata_kq stay (no-ops now).
- Settings read only in the deleted files are retired in data/settings-register.json (STRATA_IQ4_W4A8, STRATA_MMQ_DIRECT, STRATA_MMQ_WS,
  STRATA_QUANT_GATHER, STRATA_W4A8_CFG, STRATA_WS_FAST; retired_in 0.2.16); docs/SETTINGS.md regenerated. Docs: lines naming the removed
  build options or settings deleted or shortened (AMD_HIP, BATCHING, DETAILS, DGX_SPARK_LINUX, GYRO, OLDER_GPUS, RADEON_780M, STRIX_HALO,
  UNSLOTH_Q4, packaging/ENGINE-COMPONENT.md). Tests that read the options follow (test_linux_aarch64, test_setup_stale_stamp,
  test_build_cuda_windows, test_gfx906_build_files).
MMQ comparison builds come from the v0.2.15 tag from now on.

Gates (A = f-0216-int f6de3a6c6 with its package flags, B = this tree, same folder):
- CUDA 13 (z440, sm_86 + sm_120 + PTX; and strata-split-2): host code identical; strata 155 of 156 device files identical, the one differing
  file only in native_mmvq_il_pf_kernel, which differs between two builds of A too (A/A2); the split's differing files (the same family and two
  PTX files) differ in A/A2 as well. CUDA 12.9 with SM60 (sm_60 + sm_86): host identical; the 4 differing device files are the same in A/A2,
  functions native_mmvq_il_pf_kernel and fused_gr.cu gr_down_v3_kernel (nvcc build-to-build: three compiles of fused_gr.cu.o give three PTX).
- HIP (p620, gfx1200;gfx1201, the rx9070 flags): f-0216-int with and without -DSTRATA_PREFILL_MMQ=ON -DSTRATA_MMQ=OFF gives the same
  build.ninja and byte-identical strata and strata-split-2, so the flag compiled nothing; this tree's strata is byte-identical to A; the split
  has identical disassembly (2,808 functions) and host code, raw bytes differing only in __hip_cuid / gpubin hashes (step 5's include path).
- tools/check_no_mmq.py on the CUDA strata and split (bytes, nm, cuobjdump: 5,524 / 3,225 / 5,632 device functions) and the HIP strata and
  split (bytes, nm): clean.
- SYCL (p1004, icpx 2026.1.1): builds, 117 steps, no ggml. Metal (m1002, packaging/mac/build_engine.sh --stages engine): builds, 2 ggml names
  (ours). The aarch64 (Spark) compile is not run here: it runs with the Spark engine release check when the Spark is restarted.
- pytest tools/test_*.py + test_linux_aarch64 / test_loader_diag / test_tuning_availability_0213 (boston): 1,694 passed, 15 skipped, 2
  failed in test_gfx906_build_files (asserted the deleted macro's gfx906 lines; rewritten, 3/3). settings_register --check and
  test_settings_register, check_vendored, check_links: ok.
2026-11-16 15:04:34 +01:00
Guillaume PUTIER a9f2de40f3 setup: parallel counts pinned RAM and per-cell VRAM at long contexts (#6046)
With KV streaming, each slot pins its whole K/V in RAM (12.38 GiB at
1M int8) and keeps about 1.8 KB of VRAM per context cell beyond 32K.
parallel_slot_gb counted 0.59 GB per slot whatever the context, so
setup recommended 2 slots for IQ3_S at 1M on a 32 GB card. Measured on
an RTX 5090 with 125.6 GiB of RAM: 4 slots ran every request 3-4x
slower, 8 slots stopped the engine at start.

The recommendation now also keeps the expert arena plus every
session's pinned K/V within 75% of the RAM (Windows refused to pin
past 99 of 125.6 GiB), takes the K/V bytes per cell from KV_CELL_BYTES
(k8v4 816), and the note says how much RAM each request would pin when
RAM is what rules it out.

Doc: docs/BATCHING.md, what a slot costs at long contexts

Cherry-picked from PR #6046 (c9a879750). The wording of the setup lines
follows in the next commit. tools/test_setup_parallel.py: 3 fail on
756242554, pass here (p2003; the snapshot step there fails on base and
head alike: no node on that box).
2026-11-16 14:23:18 +01:00
Niko1221 3e28250e84 Docs: the dense-weight trim is the default with a layer split
STRATA_STAGE_TRIM moves from the opt-in table of docs/MULTI_GPU.md to a new "Turning a default off"
table (STRATA_STAGE_TRIM=0 or --no-trim-stage-weights keeps every card's full copy). docs/BATCHING.md
and the --trim-stage-weights usage line say the trim applies to explicit and auto splits and is the
default. The settings register marks STRATA_STAGE_TRIM as a rollback setting.
2026-11-13 00:29:52 +01:00
Niko1221 00807c9b30 [Engine] Strix Halo: the RAM cap with several requests at once has a way back and speaks only when it cuts
The cap on the pinned RAM copy of experts (--batch 2 or more, Windows HIP, integrated GPU) printed
its line at 2 and 3 slots too, where the whole copy (12.47 and 16.40 GiB) is under the cap and
nothing is cut: "18.1 GiB of experts are kept in RAM" was wrong there. Now the line comes after
the pin and only when the RAM copy reached the cap (4 slots at 131,072 tokens: 15.0 GiB).

STRATA_UMA_PIN_CAP=0 keeps the RAM budget as set (any other value, or unset, leaves the cap on);
the line names it: "(STRATA_UMA_PIN_CAP=0 keeps the RAM budget as set)". The register entry is
now status rollback with the measured points in its note, and docs/BATCHING.md has one sentence
where the memory per slot is described.
2026-11-12 20:00:01 +01:00
Niko1221 541a2fac2d Slot penalties and logit bias in batch windows: shared slot_row_draw for CUDA/HIP/Metal, server accepts logit_bias with --batch, docs updated 2026-11-02 07:15:58 +01:00
Niko1221 5c8bcf4307 docs: windows of 16 rows and the four-card AMD profile (BATCHING.md)
Which builds take 16 rows and why, how the 8-row build stays main's code, what was tested (real 16-row windows,
identity on seven boxes), the four-card profile with its measured effect per setting, and the opt-out.
2026-10-29 15:06:10 +01:00
Niko1221 ec8e405909 batch groups: two NVIDIA cards pipeline by default; the serial group is opt-in (STRATA_BATCH_GROUPS_NV_SERIAL=1, STRATA_DEFAULTS=026)
0.2.1 made a layer split over exactly two NVIDIA cards with --batch and no --batch-groups run one serial group (measured
then on 2x RTX A4000, IQ3_XXS: +12..16%). With the 0.2.7 code the pipelined groups are faster at 2 and 4 streams on
every box and quant measured, so the default goes back to the pipeline.

Measured (tools/serve_load.py, --batch 4, 256 tokens per request, interleaved pairs, total tok/s, pipelined / serial):
- 2x RTX A6000, IQ3_S, all experts in VRAM: 1 stream 101.7 / 101.7; 2 streams 125.7 / 107.4 (+17%); 4 streams 171.4 / 141.0
  (+22%). The v0.2.6 binary on the same box: serial default 104.9 and 137.2, --batch-groups auto 124.6 and 169.6.
- 2x RTX A4000, Q2_0 pack (17037 of 24576 pairs cached, 4 clean pairs): 2 streams 80.2-82.5 / 75.0-75.5 (+7..9%, 4 of 4);
  4 streams 110.8-111.5 / 94.8-95.3 (+17%, 4 of 4); 1 stream 63.6-68.7 / 68.2-70.3.
- 2x RTX A4000, IQ3_XXS (13056 of 24576 pairs cached, 3 pairs): 2 streams 73.2-73.7 / 65.8-66.5 (+12%, 3 of 3); 4 streams
  100.5-100.7 / 82.9-83.6 (+20%, 3 of 3); 1 stream 58.4-60.5 / 60.7-62.6 (serial about 4% faster, 3 of 3).
The single stream runs on the solo path in both; only the A4000s show the 4%.

What changed: batch_groups.hpp has a pure rule nv_serial_wanted(env value, STRATA_DEFAULTS=026). STRATA_BATCH_GROUPS_NV_SERIAL
set to anything but 0 asks for the serial group, an explicit 0 wins over STRATA_DEFAULTS=026, and with the variable unset or
empty STRATA_DEFAULTS=026 gives v0.2.6's serial group. An explicit --batch-groups (a number or auto) still wins. Three or more
cards, AMD builds and --batch-mtp/--adapt-async handling are unchanged. The serial message names the opt-in.

Tests: batch_groups_test (the rule over the env values and 026, two cards pipeline, the existing serial cases). Real engine on
2x A6000 (IQ3_S), no --batch-groups: the engine says "2 groups of 2 slots" / "2 groups of 1 slot"; with 4 and 2 slots, greedy,
greedy+seeded sampled, slots finishing at different lengths and a cancel in the middle of a draft, every slot's tokens equal its
solo decode and the pipelined build's. A long-prompt slot differs from the pre-merge base build in the same way with the flag
and without it (it is the parent's prompt path, not this change).

Not covered: no run on AMD or on three cards; the 4% single-stream cost on the A4000s is measured on one box.
2026-10-27 04:17:17 +01:00
Niko1221 f656a721a6 docs: STRATA_PIPED_MTP on 2x RTX A4000 (Q2_0): =1 is the setting to use; =2 is slower than no drafts at 4 streams there (#4121) 2026-10-27 04:02:38 +01:00
Niko1221 bd8a254453 Merge f-027-gh-eng into f-027-gh-eng-pm (#4121 on top of the #4010 pipelined adaptive rounds) 2026-10-27 01:12:47 +01:00
Niko1221 2651c4a96b Merge f-027-int2 (2a2264c21) into f-027-gh-eng
# Conflicts:
#	tools/calibrate.py
2026-10-27 01:11:52 +01:00
wannagoxuf 17878ac579 batch slots: MTP drafts in the pipelined groups, STRATA_PIPED_MTP=N opt-in with --batch-mtp (#4121, #3794)
Problem: a layer split with --batch pipelines the slots in groups, and the pipelined groups run no MTP drafts.
--batch-mtp with serial windows leaves all but one card waiting. A multi-stream deployment wants both.

What changed: STRATA_PIPED_MTP=N (with --batch-mtp) keeps the pipeline and drafts in it. A group's window carries
each of its slots' rows: the slot's token and up to N MTP proposals (at most --spec - 1; the first always, each
further one while the draft layer was at least --spec-min-p sure of the one before). The last stage judges each
slot's proposals on their own. The number of rows to keep is known only then, and by then the earlier stages run
other groups' windows, which reuse the scratch the commit replays from. So a small save graph copies those rows
right behind each window (Verifier::batch_launch_rows), and every stage queues the commit of the kept rows after
the verdict (Verifier::batch_commit_rows). The slot drafter catches up on its own rows and drafts the next
proposals as an asynchronous chain (MtpDrafter::chain_launch). Unset, nothing changes.

Changes on top of the PR as sent (review):
- The verifier window size is worked out where the verifiers are built, from the slots that fit and the final
  groups, not earlier from --batch as asked. Unset it is the old expression.
- STRATA_PIPED_MTP is decided again once the slots that fit are known. It says it is off, and why, when fewer than
  2 groups are left, when STRATA_BATCH_SELF_COMMIT is on, or when a group's window would hold more than
  kVerifyMaxT rows. The start line names groups and slots correctly.
- batch_groups::resolve keeps its old mtp_dropped rule; only mtp_piped is new, and it also applies with
  --batch-groups given (the PR's fix 1). The "--batch-groups 1" test case now expects "not dropped".
- --remote-expert-opt alone no longer blocks --batch-mtp on a layer split: the object it guards is only made with
  a helper expert cache (the PR's fix 2).
- docs/BATCHING.md rewritten with the numbers measured here.

Tests: batch_groups_test (the PR's cases, four "unset is as before" cases); builds on CUDA sm_86 (Linux), SYCL
(the sycl tree has its own verify.cpp and generate.cpp and does not include this code) and MSVC. Model runs:
see docs/BATCHING.md and the gate scripts 4121-*.sh.

Not covered: AMD (HIP) was not built or run; the draft layer on the first stage; helper expert caches.
2026-10-27 00:21:07 +01:00
SuperDistance a3bb38ec45 batch-groups: opt-in adaptive-tier rounds in the pipelined loop, STRATA_PIPE_ADAPT_EVERY (#4010)
With --batch-groups above 1 on a layer split the pipelined batch loop never starts a round of the adaptive VRAM tier (the
serial batch windows start one every --adapt-every windows). While the slots are busy the tier only moves when they go back
to the solo path, so a fresh engine keeps its start-up profile for minutes.

STRATA_PIPE_ADAPT_EVERY=N (opt-in; unset, 0 or not a number is off): after N group windows pump starts no new group on the
first stage, lets the groups in flight finish, then runs one round as batch_step does between serial windows, adapt() and
apply_pending(true), so nothing in flight reads a cache slot while experts swap and the new experts have landed before the
next launch. Not while a prompt is read beside the slots (in_prompt_read, its loan of cache slots), not with --adapt-async,
not while the last round's copies are in flight, not with the tier off. The rule is two pure functions in
include/strata/program/batch_groups.hpp (pipe_adapt_every, pipe_adapt_due) with 12 new cases in batch_groups_test. With the
switch set the engine says so once at start and the "strata batch (pipelined ...)" line adds the rounds, the experts
swapped in and the time spent. docs/BATCHING.md documents the switch with the author's table (2x RTX 5090, six streams,
309 to 410 rows/s over eight bursts after a fresh start, two engines per setting).

Reviewed: unset costs one counter increment per group window and one false check where a group starts, and prints no new
line. A due round cannot wait forever: no new group starts, the groups in flight finish, then the round runs. A prompt read
sets in_prompt_read before the reader thread starts (including STRATA_PIPED_CONCURRENT) and clears it after the reader
joined; the drain after the read runs the round if it is due.

Tests: batch_groups_test (the new cases). Not covered and still the author's to show (the PR is a draft): a soak with
prompts read beside the slots, a Linux run, another GPU pair, more than two stages, and exactness settings with the switch
set. The model gate is written down.
2026-10-26 19:03:48 +01:00
oscarlius e21a1872f7 docs/BATCHING.md: the cache settings that let a long solo request move into a batch slot without reading its prompt again (#3334)
Adds a minimal handoff configuration (--prompt-cache 1, --prompt-cache-every 0, --prompt-cache-root 0, --conversation-cache-mib 0), what each
option does, that it costs RAM, that it does not make cold prompts prefill in parallel, and how to look for the handoff in the engine log, /metrics
and /v1/status. Ported from PR #3334 by oscarlius (continuing #3035). The four options exist in src/program/generate.cpp and the o.prompt_cache > 0
gate matches the text; the log evidence was not reproduced here (no model run).
2026-10-26 18:57:53 +01:00
Niko1221 f680a80d88 Batch groups: PROPOSED NVIDIA two-card default is one serial group (measured +12..16% on 2x A4000); owner decides 2026-10-20 00:03:09 +02:00
Niko1221 80a10f31c3 docs: details, batching and tester readmes for 0.2.0
DETAILS: pictures on by default with the 24 GB reader rule, the engine label of the prompt-chunk planner (before 0.1.45.3, not 0.1.46), the per-architecture sets measured on 3060, A4000 and P100, the N7 and ROUTE_PRIOR decisions, a pointer to the app and Terminal troubleshooting. Links to private phaseA-tests notes removed from DETAILS and BATCHING. Tester readmes: AMD pictures are on (CPU under 24 GB, GPU on a 24 GB 7900 XTX), the RX 7900 text reconciled with the community runs, Mac needs macOS 15 and has no picture reader yet.
2026-10-19 07:16:00 +02:00
Niko1221 e8b1edbcb7 Merge perf-PR group batch (f-145-pp-batch) 2026-10-16 10:49:15 +02:00
Niko1221 df44bcb712 Merge f-145-havok (#2364 multi-user series, opt-in) 2026-10-15 01:11:37 +02:00
Niko1221 79e5cd1827 docs/BATCHING.md: more than 8 slots on a layer split, the opt-in admission and decode switches, and the 4x R9700 numbers (PR #2364 port) 2026-10-14 21:40:11 +02:00
Niko1221andSuperDistance 5d6bf8d414 batch-groups: decode and give way between the pieces of a prompt read (#2050, opt-in STRATA_PIPED_READ_PIECE), on top of #2326's concurrent read
Squash of SuperDistance's three commits of PR #2050 (decode between the pieces of a read on the pipelined groups, the
piece lines counting the rows the slots decoded meanwhile, the stall watchdog staying on for a read in pieces),
applied after #2326 here: the BYIELD give-way is #2326's give_way lambda, the concurrent block runs first and the
piece path serves a read that STRATA_PIPED_CONCURRENT leaves to it (pictures, configurations where it is off).

Co-authored-by: SuperDistance <43229543+SuperDistance@users.noreply.github.com>
2026-10-14 12:26:10 +02:00
SuperDistance 6c5c382b94 docs/BATCHING.md: reading beside the decoding slots, and what it measured
The opt-in's section: how the read and the windows share the GPUs, the doorbell thread, the give-way at a chunk, where
the mode is off. Measured against main (a0116b27) on 2x RTX 5090 in one window (main, this, this, main): the stops,
the streams' rate during the reads with the same answers every run, the joining prompts' TTFT, a question during a
read, the same randomised load on both, the doorbell thread's first wait as an A/B; 16 GB cards on each side; a weaker
host as well in #1906's shape; the default path's check; text equality.

tools/piped_read_join_bench.py, the client that measured it, is #2050's, unchanged (the same file as there).
2026-10-14 11:58:16 +02:00
yi-sudo f629fb0417 Batch decode: one launch for all rows in QSA attention and GDN recurrence (opt-in)
With --batch N the verify window ran QSA block scoring, top-k and decode
attention as one launch per row, and the GDN recurrence (window and 1-row
commit) as one launch per slot.  At 4-8 live slots these serial launches are
most of the window's cost beyond the expert reads.

Two env switches, both off by default (off = the same launches as before):

  STRATA_BATCH_ATTN_ROWS=1   block scores, top-k and decode attention for all
                             rows of the window in one launch each; every row
                             reads its own slot's indexer keys and K/V pools
                             (passed by value as kernel params, so the graph
                             captured per row layout stays valid).  A slot that
                             streams KV (kv_mode 1) keeps the per-row path.
  STRATA_BATCH_GDN_GROUPS=1  GDN recurrence in the window and the 1-row commit
                             for all slots in one launch (grid.y = slot group).
                             Conv commits stay per slot.

Same arithmetic per row: 4 concurrent temperature-0 prompts give the same
bytes with and without the switches (--batch 4 and --batch 8).

RTX PRO 6000 Blackwell, IQ3_S, all experts in VRAM, a0116b2, same day,
total tok/s (docs/BATCHING.md has the table):
  --batch 4, 4 clients: 268.4 -> 311.7
  --batch 8, 8 clients: 308.4 -> 374.8 (reserve 6144 MiB)
Window: 4 rows 14.3 -> 12.2 ms, 8 rows 24.6 -> 19.9 ms.

Built and run with CUDA 13.0 (sm_120) only.  The .cu files are also in the
HIP build, which was not built here (no ROCm).  The SYCL port has its own
copies of these files and is untouched.
2026-10-14 07:07:10 +02:00
Niko1221 a9adfa5dad Qwen3.6-35B-A3B: setup asks for pictures and recommends parallel requests; docs
Setup: the images question for qwen36 (GPU encoder on an NVIDIA card of 16 GB or more, the CPU encoder otherwise, AMD under Linux on the
CPU; --vision gpu kept as asked with a note), the pinned mmproj (size and SHA-256) beside the GGUF, the vision section and --vision in
the config; --parallel N is written as asked with what a slot costs, and the recommendation is said where every expert still fits.
docs/QWEN36.md: pictures and several requests at once with the measurements.
2026-10-14 01:11:11 +02:00
Niko1221 a0116b2782 Layer split + --batch: the default pipeline wins over --batch-mtp (STRATA_BATCH_MTP_SERIAL=1 or --batch-groups 1 keeps the serial MTP windows) (#2038)
0.1.42 let --batch-mtp run on a layer split and made the --batch-groups auto default give way to it: one serial group. On
2x RTX A4000 (IQ3_XXS, 3 pairs) four streams aggregated 62.2 tok/s against 92.7 on 0.1.41's pipelined groups (-33%, 0/3 pairs
faster), two streams 55.7 against 71.4 (-22%). With --batch-groups 2 (which turns --batch-mtp off) 88.3 and 71.1. The start-up
line says why --batch-mtp is off and how to keep it. --adapt-async 1 still gives one group. Solo decode and the answers are
untouched.
2026-10-12 16:00:57 +02:00
Niko1221 3ff62ec140 docs: batch-MTP on a layer split with all experts in VRAM lost 21.9% (2x R9700); it pays only when the experts do not fit 2026-10-09 18:58:08 +02:00
noon-at-cgn 2eafe7f90d docs: the adaptive tier in batch windows - measured on 2x RTX 3080 20 GB, tier on, blocking, frozen and off 2026-10-09 15:16:22 +02:00
noon-at-cgn b5d520313a batch-groups: --adapt-async 1 also keeps the 0.1.41 auto default at one group (said once)
The pipelined slot groups never run the adaptive tier, so --adapt-async 1 with --batch on a layer split and no
--batch-groups resolves auto to one group, like --batch-mtp (batch_groups.hpp, batch_groups_test); --batch-groups G
or auto given on the command line is honoured and turns --adapt-async off through the existing gate.
2026-10-09 15:16:22 +02:00
noon-at-cgn 495dc43690 batch: tick the asynchronous adaptive tier (--adapt-async 1) between batch windows; --adapt-min-gain
batch_step advances the async round one step per window (never between a prompt's chunks), commands drain the round in
flight before they run, a round with nothing to swap ends at its first step, and --adapt-min-gain sets the bar a swap
must clear (default 1.5, as before) for both tiers. --adapt-async is no longer refused with --batch slots (still with
--batch-groups).
2026-10-09 15:16:22 +02:00
noon-at-cgn e989c67194 batch: the adaptive VRAM expert tier keeps adapting in batch windows; per-stage timing in the strata batch line
batch_step now runs adapt() every --adapt-every windows on a thread beside the commit and the drafts, lands the swaps
(apply_pending) before the window ends, and pauses while a prompt holds a loan of cache slots. The timing line adds the
adaptive tier's rounds/swaps and wait, each stage's GPU-reach wait and pool time, and the VRAM/PCIe/CPU entry split.
2026-10-09 15:16:22 +02:00
noon-at-cgn de71d7bef4 docs: batch MTP on a layer split - measured on 2x RTX 3080 20 GB (0.1.41 build and the earlier 0.1.40.3 runs), with what was not measured 2026-10-09 15:16:16 +02:00
noon-at-cgn f90bec6f44 batch-mtp: not with helper expert caches on a layer split (not run); docs say how it meets --batch-groups
The 0.1.41 default --batch-groups auto, the pipelined path's lack of slot drafts and the helper-cache refusal are
written down in docs/BATCHING.md (the limits list and the --batch-mtp paragraph).
2026-10-09 15:16:16 +02:00
noon-at-cgn cb6c549c8a batch-groups: the 0.1.41 auto default gives way to --batch-mtp (one group, said once)
--batch-groups auto became the default for a layer split with --batch >= 2, but the --batch-mtp gate ran before
the groups were resolved: it saw 1 group, kept batch-MTP on, and the groups were then raised to 2 - pipelined groups
do not run the slots' MTP drafts (#1413). The resolution is now a pure helper (include/strata/program/batch_groups.hpp,
CPU test src/program/batch_groups_test.cpp): with --batch-mtp and no --batch-groups the default is one group and
the log says why; --batch-groups N (N > 1) or --batch-groups auto given on the command line pipelines the groups and
turns --batch-mtp off, as before.
2026-10-09 15:16:16 +02:00
noon-at-cgn 48f2c47d54 batch-mtp: work with a layer split (slot drafters on the last stage's GPU, grouped slot rows through every stage)
- generate.cpp: --batch-mtp accepted with a layer split on separate GPUs (refused with --batch-groups); slot drafters
  load from the last stage's slot sessions under the last stage's device guard and bind to its weights/head; their
  residual buffers, row copy (async on the drafter's stream) and draft-KV copies run on the drafter's device; every
  stage verifier gets the 8-row window size and the batch graph limit; slot-drafter logits are not charged to CUDA0.
- verify.cpp: stage_batch's layout rules move to include/strata/core/batch_rows.hpp (CPU test batch_rows_test); grouped
  rows are allowed on a stage that hands rows on, the hand-off bound is kVerifyMaxT rows.
- docs/BATCHING.md, --batch-mtp help text.
2026-10-09 15:16:16 +02:00
Niko1221 b0bc4a70f4 Merge f-141-conc: --batch-groups auto for layer-split batches, #857 fix, listen backlog
# Conflicts:
#	src/program/generate.cpp
2026-10-08 09:56:56 +02:00
Niko1221 ca001df571 batch: a layer split with --batch pipelines one group per stage by default (--batch-groups 1 opts out); server listen backlog 256 (30-40 simultaneous clients got connection resets) 2026-10-08 07:10:59 +02:00
zetlaw e0f6da57f5 Fix shared MTP draft head type for batch slots 2026-10-08 02:36:23 +02:00
Niko1221 886bc47742 docs: --batch-groups auto in BATCHING.md 2026-10-07 22:23:40 +02:00
Niko1221andrkcth c8c79b17ea batch MTP (#846): opt-in --batch-mtp / STRATA_BATCH_MTP=1, warn instead of refusing, 1-row groups keep the 0.1.39 commit kernel, LRU graph cache only under the flag, the real draft geometry
Co-authored-by: rkcth <16263985+rkcth@users.noreply.github.com>
2026-10-05 13:19:38 +02:00
rkcth 8cfb3fd7cc Keep MTP drafting in concurrent batch slots 2026-10-05 13:19:38 +02:00
Niko1221 e0446f394c #465 setup: recommend "parallel" only where the experts mostly fit in VRAM
On a card whose experts mostly run on the CPU the slots cost speed per request (RTX 5070, Q2_0: 11-24 %), so setup
now recommends slots only when the expert cache (every card of a split counted) still holds half of the model's
experts beside them (Q2_0: 24 GB and up, or a split); elsewhere it stays at one at a time and says "parallel N
reduces waiting for several users but costs about 10-25% speed per request on this card". --parallel N is
honoured as asked, as before. BATCHING.md: the table with the change against one at a time.
2026-10-04 03:36:22 +02:00
Niko1221 1c219eb984 #465 docs: the final build's RTX 5070 numbers; the turn-checkpoint exactness check 2026-10-04 03:14:23 +02:00
Niko1221 038430ff20 #465 a request left alone in a slot goes back to the solo path; docs: BATCHING.md for one GPU, measured on the RTX 5070
server: a request decoding in a slot whose neighbours finished (no other slot busy, nobody waiting, at least 32
tokens allowed) is BSTOPped and continued on the solo path with its MTP drafts - the engine copies the slot's
sessions back (INFO slot_cache=1; at most twice per request; STRATA_PARALLEL_SOLO=0 keeps it in the slot).
engine: INFO batch_slots=N slot_cache=0|1.
tools/batch_interleave_test.py: the back-to-solo path, and a next turn from a slot's turn checkpoint (a client
that drops the reply's thinking).
docs: "parallel": N, what a slot costs and what setup recommends, the server's handling (interleaved prompt reads,
BYIELD, slot conversation cache, back to solo), exactness and its settings, the RTX 5070 measurements (the slots
buy waiting time, not speed, on a 12 GB card), the protocol; DETAILS / README / AI_SETUP mention the option.
2026-10-04 02:38:16 +02:00
benoit lange 953203be43 Tests and docs: parking with a layer split, tools/parking_test.py, a Testing section
- tools/parking_test.py: a follow-up decodes the same tokens whether its conversation stayed live or came back
  from the parking cache (every stage's image with a layer split). 4-GPU split, IQ3_S: 3,786 and 9,276-token
  conversations restored in 42 / 51 ms, follow-ups identical; without parking the same follow-ups took 3.4 / 6.8 s.
- tools/batch_test.py: --keys to send sampling keys (sampled rows in batch windows).
- docs/BATCHING.md: parking together with batching, the Testing section; docs/DETAILS.md: parking now works with
  --layer-split.
2026-10-03 16:11:57 +02:00
benoit lange 9461f5e3a3 Several conversations at once: batch slots, pipelined layer split, per-stage dense weights
The engine's --serve can now keep up to N conversations open (--batch N) and decode them together, one token
each per verify window; with a layer split, --batch-groups G pipelines the slot groups through the GPUs, and
--trim-stage-weights makes every GPU load only its own layers' dense weights (VRAM back to the expert cache).
The server runs concurrent requests in the slots. See docs/BATCHING.md.
2026-10-03 08:04:53 +02:00