Volta / NVLink case it was measured on. They are now off unless a switch is set:
- STRATA_P2P_HANDOFF=1: the layer split's hand-off buffers in the next stage's VRAM, written over P2P (generate.cpp). In the PR
they were allocated whenever two cards could reach each other, on any layer split, and the host-side readers of a hand-off
buffer (pinned host memory until then) were not checked;
- STRATA_P2P_DECODE_SCATTER=1: the decode peer writes its expert outputs straight into the primary's hit_out buffer over P2P
(verify.cpp set_plan_slot; expert_source.cpp reads the sink's address). In the PR on whenever the peer has P2P and direct mode.
Not taken, as numbers and reasons in the results file: the PR's three tail-skip changes (expert_pool_dispatch_multi with a peer
card, the peer's experts counted as cached, and the default skip on a --peer-device run). They put the default tail skip on a
--peer-device run (its answers differ), and the PR's peer decode numbers were measured with it on; the owner's default for the
skip is off.
STRATA_PREFILL_GROUP_GATHER for the layer-major walk keeps the convention of the staged walk (on unless 0) and acts on MMQ
builds only.
From PR #6023 (midhatn; its engine commit 3440d4609), author kept. The engine, the unit test and the register entry are taken;
the PR's docs (docs/NVIDIA_V100.md rows, the bench report under docs/bench-results/) are not (they describe the mechanisms as
measured on 2x V100-SXM2 NVLink only). What the commit does:
- STRATA_MMQ_TIER_SORT=1 (opt-in): the experts of a prompt chunk go in readiness-tier order (VRAM, pinned RAM, file stager) and
row-count order within a tier (mmq_resident_sort.hpp, mmq_resident_sort_test), in the staged walk, the layer-major walk and the
peer's walk; under it an async P2P copy (cudaMemcpyPeerAsync + an event) hands a chunk's hidden state from one layer-split stage to
the next;
- pf_wmma() (STRATA_PF_WMMA=1, opt-in) is no longer compiled out of an MMQ-free build;
- Prefill::set_peer() works on an MMQ-free build: int8 (q8_1 over P2P) or WMMA expert kernels on the peer card, the peer's gathers
grouped (gather_native_group), the 35 % peer stream over every layer the peer can take;
- the decode peer's output goes straight into the primary's hit_out buffer over P2P (hit_out_dev), and the layer split's hand-off
buffers sit in VRAM when two cards can reach each other;
- the staged walk's stream-ahead window counts pending copies (max_pending), the layer-major walk groups its gathers
(STRATA_PREFILL_GROUP_GATHER, on unless 0).
This commit is the PR as it came; the next commit of this series turns the pieces that change a default (VRAM hand-off buffers,
decode scatter, tail-skip rules, layer-major group gather) into opt-in switches and says why.
From PR #3476 (pugolini; its commits 51d8370a8 and 70813d5b8), author kept; hand port, and the default is changed. The native router is
512 x 10 only, so a 256-expert model (Qwen3.8-Flash-Next Coder) took the per-token moe_route loop in the verify window,
a projection and top-k launch pair per token and layer. moe_route_window (one multi-column BF16 projection and one top-k per
layer, bitwise the per-token calls by route_window_parity) was reachable on gfx906 builds only; the PR made it the default on
every HIP card. Here the branch is compiled on every backend and route_window_on() keeps gfx906's default (on) and makes
every other backend opt-in (STRATA_ROUTE_WIN=1), because we have not repeated the PR's measurement (R9700, Coder IQ1_M,
--spec 4: routing 3.34 to 1.39 ms a window, decode +9%, same output hashes). Also taken from the PR: profile stamp slot 33
("router (proj+topk)", under STRATA_VERIFY_PROFILE=1) splits the routing from the plan / doorbell time, and
route_window_parity now covers T = 1..6. Unset, the launches on CUDA, HIP and Metal are the ones before. The name is in the
settings register (status research); the parity program on the R9700 is in the gate table.
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.
From PR #5748 (botBehavior; its commit 5d3f3cda6), author kept. STRATA_TAP_FILE (the residual-stream research dump)
was dropped without a message when the model ran on a layer split: Verifier::init cleared the path unless one verifier
held every layer. On a split each stage now parses STRATA_TAP_LAYERS (same rules as one card: sorted, unique, the last
layer excluded), keeps the layers inside its own range as the drafter's taps do, and the first stage opens the file,
writes the header with the whole layer list and, after the chain has run, gathers every stage's rows to the host
(gather_taps_host) and writes the window, on both the overlapped and the sequential return path. The file has the same
"STAP" v1 layout as one card. Two messages say so when the dump cannot be done (no layer in range; the drafter owns the
split's taps). With STRATA_TAP_FILE unset nothing new runs (tap_split_ stays false) and the one-card path is unchanged.
Author's check (2x RTX 5070 Ti, 2 stages): replies byte-identical with the dump on and off, rows against one card
at cosine 0.998 or more per layer in the median, no empty slots. Not run by us (it needs two cards and a model); the
CUDA build is checked on l620.
From PR #5305 (shoucandanghehe; its commit 487dc2cfb), author kept. Verifier::set_slot_logit_bias with an empty
bias set the slot's pointer to null without freeing the buffer, so every switch of a slot from a request with
logit_bias to one without leaked one vocabulary-sized float buffer on the card. The buffer is freed under the
device guard first, then both pointers are cleared. The destructor already frees what is left, so the buffer has one
owner.
On sm_70 / sm_75 the first verify-window capture ended the engine with "copy_i32_from_mapped launch: invalid argument" on a plain grid-stride copy,
deterministically on a 2080 Ti, and on a V100 only until STRATA_VERIFY_DEBUG=1 changed the calls in between. The launch wrappers read
cudaGetLastError(), which returns the first error since the last read from ANY call of the thread, so an earlier call that failed unchecked is
blamed on the next launch that is checked, and that check exits.
Verifier::capture (CUDA builds) now reads the slot before cudaStreamBeginCapture: a pending error is said once with its text and number ("a CUDA
error was already pending before the verify window's capture") and cleared when it is not sticky. A sticky error (illegal address, lost device)
stays and fails the calls after it as before. Nothing a launch inside the capture produces is cleared. HIP and Metal builds are untouched.
Test: pending_cuda_error_test (a failing cudaMemcpy leaves its error in the slot; take_pending_cuda_error returns it and the slot is empty after;
nothing pending changes nothing; needs a device, exit 77 without).
gr_upmix (prefill/kernels.cu) cached "this card has gfx11 matrix cores" in a function-level static, so on a layer split over an RX 7900 XTX (gfx1100)
and an RX 9070 XT (gfx1201) the card that reached it first decided for both: with the gfx1100 stage first, the gfx1201 stage launched the gfx11 kernel
and the first prompt died with "prefill gr_mix_r: no kernel image is available for execution on the device" (the error check after it names the next
kernel, not the bad launch). The same one-answer-for-all-cards form decided the fused hyper-connection read (STRATA_QFUSE_HC default, verify.cpp), the
DFlash2 Q4 kernel pick (dflash2.cu) and the MTP drafter's stream priority (mtp.cpp), all on "is this a gfx12 card". Each now asks once per device
ordinal through strata::core::PerDeviceFlag; the environment overrides still win for every card.
Test per_device_flag_test (host only, fake arch table: a gfx1100 first then a gfx1201, and the reverse); --legacy is the process-wide form, registered
WILL_FAIL. On a single card nothing changes: identity gate on the R9700 (gfx1201) in RESULTS-0217-FIXGPU.md. Not run on a mixed gfx11 + gfx12 pair: none here.
A kernel on the shared expert's low-priority side stream issues prefetch hints (cp.async.bulk.prefetch.L2 on
sm_90+, prefetch.global.L2 below) over the next layer's GGUF-form projections, hyper-connection and router
weights and the shared expert's, from the point the wait for the CPU rows starts, and joins through the shared
expert's event. The hints read and write nothing, so the window's values are the same bits. Default off;
STRATA_L2_PF_MIB=n keeps the first n MiB of a layer (in the order the layer reads them), STRATA_L2_PF_BLOCKS
sets the grid. Only the doorbell graph with CPU experts (not all-resident, not a split or batch window,
not the stage profiler). CUDA only (a no-op kernel on HIP is not launched). WeightRef gets native_bytes.
On Metal, Verifier::run_slot_rows returned from its STRATA_GPU_METAL branch without progress_at / progress_beat, so a --batch decode raised no
heartbeat. The only resets left were a new request's prompt read and the rare 1 s sample that falls between two batch windows (0.2-1% of wall time).
Two slots decoding long tool calls (53 tok/s, 3300-3950 of 4096 tokens) with no admission for 60 s ended the engine with "no progress for 60 s
during a request (idle -1)", exit -6 (SOAK-SERVE-1117, M5 Max, 0.1.62). v0.2.15 has the same branch.
The Metal branches of run_slot_rows and run now end like the CUDA / HIP path: progress_at("decode"); progress_beat(). A window that really hangs
in window_run_slots still beats nothing and ends the engine after the limit. CUDA, HIP and SYCL are untouched.
engine/src/program/generate.cpp has `const int64_t small = old_rule();` (and two more). Without WIN32_LEAN_AND_MEAN, <windows.h> pulls in <rpc.h> / <rpcndr.h>, which
define `small`. In 0.2.15 the first <windows.h> of that translation unit came through gguf_reader.hpp, which defines the lean macro; now conversation_spill.hpp (line 38)
and platform/commit.hpp (line 18) reach it first and define only NOMINMAX. Each include below now gets, next to NOMINMAX, the guarded
`#ifndef WIN32_LEAN_AND_MEAN / #define WIN32_LEAN_AND_MEAN / #endif` (inside the same `#if defined(_WIN32)` block, so a Linux build never sees it): include/strata/core/
conversation_spill.hpp, include/strata/platform/commit.hpp; src/core/{conversation_memory, conversation_memory_test, device_main, pinned.cu, pinned_alias_test,
pinned_shared_win_test, verify}; src/program/generate.cpp; sycl/include/{dpct/device, dpct/kernel, dpct/memory, strata/runtime_files}.hpp, sycl/src/core/{copy_queue, pinned.dp}.cpp,
sycl/src/program/generate.cpp; tests/platform/io_priority_test.cpp (18 includes; the other 25 sites already define it earlier in their file). None of these files uses an API the
lean macro leaves out (winsock, shell, RPC / OLE, multimedia): checked by grep. Not covered: the SYCL Windows build also takes dpct/bindless_images.hpp (d3d11.h, which
reaches rpcndr.h by itself), and sycl/src/program/generate.cpp has the same `small` name; no Windows SYCL package is built in 0.2.16 (the release assets are Linux SYCL).
Made by tools/layout/move_0216.py (the commit before this one) on db8e0be9c, the final code head of 0.2.16:
- 75 git mv (renames, so `git log --follow` and blame keep working; packaging/acceptance_matrix.md shows as delete + add because its links
changed too) and 3 removals: SETUP.bat, UPDATE.bat and update.sh (setup.py --update pulls the code now);
- 1,425 path edits in 307 files: root-relative paths in CI, Docker, .gitignore and the release scripts; Markdown links; Python and
Node joins from a root that moved with its folder; explicit edits for code that computes a root or names a moved path; tables of
repository paths inside tests.
engine/ holds what CMake builds (src, include, cmake, metal, sycl, spark, third_party, the C++ tests and benches). app/ is the desktop
app and its host (was apps/). terminal/ is the Terminal in the layout of the installed one (strata.py, setup.py, strata_cli,
strata_control, serve, bin, data, ref, crates, the Python tools and tests). docs/ has the documentation, docs/lang/ the translated
READMEs, docs/history and docs/bench-results. tools/ has the repository's own checks, packaging, docker, research and nix.
tests/core/test_tqp_ref.py is a pytest file and stays with the Python tests (terminal/tests/core/).
AGENTS.md, README.md, LICENSE, setup.sh and START-HERE.bat stay at the root.
No behaviour change: the same command lines, the same sources. For this head a replay of the script gave the same numbers and the path
scan (tools/layout/checks/path_scan.py) reports no hit; the suites and the builds run on this commit next.