The CUDA drafter reads dspark.*norm*.weight, the biases and dspark.fuse_weight as F32 (the Q8_0 GGUF path widens them while loading).
The safetensors paths (an external mtp.safetensors beside a GGUF, and the official Inkling-2-Mini folder) copied them as the file stores
them, BF16, so the drafter read the BF16 bytes as floats. Measured on an RTX 3090, UD-Q4_K_XL with the BF16 mtp.safetensors:
0 of 1592 drafted tokens accepted on code, 45 tok/s against 85 with the drafter off; with the Unsloth Q8_0 drafter 44 percent accepted.
Both loaders now widen BF16 / F16 vectors (rank 1, "norm", "bias", "fuse_weight") to F32 as they are placed in the trunk section;
2-D weights stay BF16. Header strata/core/ink_widen.hpp, test ink_widen_test (no GPU).
The GGUF is mmapped read-only (strata::GgufFile) and every tensor is copied out of the mapping: the trunk into the arena, each expert into a
VRAM upload buffer or the host expert arena. The mapped pages stayed in the resident set after the copy, so the file (15.7 GB UD-IQ4_XS,
17.6 GB UD-Q4_K_XL) sat next to the copies. Peak RSS was 28-36 GiB with 7-13 GiB of experts in RAM, which does not fit a 32 GB machine.
- strata/core/mapped_pages.hpp: release_mapped_pages(p, n) drops the whole pages inside [p, p + n) from the process (madvise MADV_DONTNEED on
Linux, VirtualUnlock to trim the working set on Windows; rounded inward so a neighbour's page is never dropped). The pages stay in the OS
page cache, reclaimable, and fault back in on a later read, so only the double count goes. STRATA_INK_KEEP_MAPPED_PAGES=1 turns it off.
- ink_gguf_loader.h: read_expert_body releases the gate/up/down source ranges after copying them (both the NVFP4 -> SF4 repack and the GGUF_RAW
copy); the trunk, drafter and vision tensors (every tensor without _exps) are released once sec1_arena holds them.
- tests/core/mapped_pages_test.cpp: a 64 MB mapping touched in full drops from 67 MB to 3.5 MB resident, unaligned ends round inward, and the
data reads back unchanged (Linux, -O0 and -O2).
- The .strata and safetensors loaders read with fread / ifstream and never map the file: SQ-10 / SQ-20 peaked at 3.3 / 13.5 GiB on the 12 GB
card, which is the plan's RAM share plus the trunk and the CUDA runtime.
Measured on an RTX 3060 12 GB (planner-sized plans, ctx 32768, drafter off, same plan before and after): UD-IQ4_XS peak RSS 28.4 -> 13.8 GiB,
UD-Q4_K_XL 31.8 -> 15.5 GiB; first-prompt, 128-token, 8000-token tokens identical on every step; decode 11.5 / 7.7 -> 11.4 / 7.9 tok/s and
8.2 / 6.2 -> 8.3 / 6.2 tok/s (unchanged), prefill 217 -> 216 and 195 -> 195 tok/s.
On a layer or expert split ink_has_int8_tc(), ink_has_wmma_f16() and sm120::available() cached their answer in one process-wide static, filled
on the first call, which happens on stage 0. A later stage on a different architecture then ran stage 0's kernel path: an sm_86 stage ran the
sm_120 FP4 MoE kernels (corrupted prompt states, malformed tool calls, #6808), an sm_60 stage the INT8 tensor-core kernels (wrong logits, #6796).
Decode (M < 24) uses other kernels, which is why short answers still looked right.
- strata/core/ink_caps.hpp: PerDeviceFlag (one cached answer per device index) and the pure capability rules, so a test can feed two capability sets.
- ink_moe_cuda.cuh / ink_moe_fp4_sm120.cu: the three checks index their cache by cudaGetDevice(); the WMMA shared-memory carveout is set per device.
- ink_runner.cuh: the loop-controller GEMM took TF32 / the FP16 tensor-core path from the FIRST card's compute capability (m.sm_cc); it now uses the
capability of the stage that runs it (the static analysis in #6796 pointed at exactly this).
- tests/core/ink_caps_test.cpp: sm_120 then sm_86, sm_86 then sm_60 and the reverse, Volta/Turing/Ampere; each device is asked once.
The cache-per-device approach and the three call sites come from the report and tested patch in #6808 by markie1006; #6796 by Darkstarrd-dev
found the loop-controller use of m.sm_cc. Single-card behaviour is unchanged: same greedy tokens as before on an RTX 3060 Ti (sm_86) and on an
RTX PRO 5000 (sm_120, sm120_tc=1 in the load line).
A CUDA engine binary is built for a list of architectures (the CUDA 13 packages: sm_75 and newer; the CUDA 12 ones also
sm_60/61/70). On a card it holds no code for, the weights load and the first kernel fails; strata-inkling then ended with a
misleading "CUDA error 2 (out of memory)" in the loader, and a binary that gets past that (lazy module loading, as under
volta-forever) leaves the logits at 0 and answers token id 0 forever, with no error.
strata/core/arch_probe.hpp builds the message; strata-inkling (ink_cuda_backend.cu) and strata-hy4 (hy4_main.hip.cpp, CUDA
builds, serve and CLI, every GPU named) ask CUDA for the attributes of a probe kernel (cudaFuncGetAttributes), which answers
for the whole binary, and end with: "this strata-inkling has no GPU code for <card> (compute capability X.Y): <cuda error>.
<way out>" (a Pascal / Volta card: the CUDA 12 engine package or a CUDA 12.x build with -DSTRATA_EXPERIMENTAL_SM60=ON; else
the package made for the card or a rebuild for that architecture). strata (generate.cpp, the Qwen engine) already did this
(device_code_error()).
Test arch_probe_test (no GPU): the message names engine, card, compute capability, CUDA error and the way out; the Volta
text appears only below 7.5.
Measured on an RTX 4090 (sm_89) with binaries built for sm_120 only (no SASS for the card, PTX compute_120 cannot run on it):
- strata-inkling, origin/main: "strata-inkling CUDA error 2 at ink_runner.cuh:322: out of memory", exit 1.
- strata-inkling, this change: "init: this strata-inkling has no GPU code for NVIDIA GeForce RTX 4090 (compute capability 8.9):
invalid resource handle. Use the engine package made for this card ... -DCMAKE_CUDA_ARCHITECTURES=89", exit 1, nothing loaded.
- strata-hy4, origin/main: no mention of the card (it goes on to read the model); this change: the same message, as an
"ERR ..." line in --serve and on stderr in the CLI, exit 1.
ensure_global_kv_cap() compared the free memory with the WHOLE new K/V (global visits x slots x new capacity), as if
the old K/V were not already in the card. When the plan leaves room for the full context, that check refuses at about
half of it; the request then fails (and on a fatal path the engine ends) with gigabytes still free.
The 8 global visits grow one at a time (allocate the new buffer, copy, free the old one), so the card needs the net
growth of every visit plus the one old visit that is still held: strata/core/ink_kv_grow.hpp
(ink_kv_next_cap / ink_kv_grow_peak_bytes / ink_kv_grow_fits / ink_kv_grow_target), used by the runner.
Test ink_kv_grow_test (no GPU) models the growth loop with room planned for 131072 tokens: the old rule stops at
73728, the new one reaches 131072; also a card with room for 3/4 of the context, and the full / tight / none targets.
Checked on an RTX 4090 with 9.8 GB held back (SQ-10, --kv fp16 --kv-offload off --max-context 131072, planned context
51584, prompts of 20000, 30000, 45000 tokens):
- origin/main: the K/V stops growing at 32768 tokens (63% of the plan): "VRAM exhausted growing elastic global KV cache
to 33071 tokens", the engine ends, the 45000-token request is lost.
- this change: the K/V grows 8192 > 16384 > ... > 49152, the 45000-token request is answered; prompts above the planned
51584 get "prompt length out of range" and the engine stays up.
A drafter that comes from Unsloth's dspark-Inkling-2-Mini-*.gguf or from mtp.safetensors
carried plain tensor names ("layers.0.self_attn.o_proj.weight", "fuse_weight", ...), while the
CUDA, SYCL and Metal runners ask for "dspark.<name>" (the .strata spelling). The engine
stopped at load with: missing tensor 'dspark.layers.0.self_attn.o_proj.weight'.
The two loaders now name every drafter tensor "dspark.<name>"; the GGUF name map moved to
strata/core/ink_names.hpp (ink_dspark_name / ink_dspark_plain_from_gguf), so a test can
check all 54 tensors of the real dspark GGUF against what the runners look up
(ink_names_test, no GPU). CPU, HIP and the dual-GPU backend already strip the prefix.
Checked on an RTX 3060 12 GB (sm_86), Unsloth UD-Q2_K_XL + dspark Q8_0: origin/main stops with the
error above, this build loads, answers, and gives the same tokens as with --draft off.
detail::host_available_memory read a cgroup v1 limit as memory.limit_in_bytes - memory.usage_in_bytes. v1's usage_in_bytes charges the whole page cache, and the kernel
evicts that cache before it fails an allocation at the limit, so a container that had read its model through the file cache sat at its limit with its RAM to spare.
The v2 branch credits the group's clean file pages (and the conversation memory guard and the setup's Python probe credit them on v1 too); this branch did not.
Every figure built on it was short: the default CPU prompt share was "not armed by default: only 0.1 GiB of RAM is free" (the share needs 3.3 GiB), and the arena
verdicts, the resident-budget clamp and the file tier's room read the same number.
Measured on the rented RTX 5090 box (Vast 61335444: Docker, cgroup v1 hybrid, 171 GiB limit, 104 GB model, EPYC 9B14): limit - usage = 2.57 GiB with 99.9 GB of clean file
pages (total_inactive_file + total_active_file) in the group.
arena_cgroup_room_v1 (conversation_memory.cpp): room = limit - (usage - credit), credit = total_inactive_file + total_active_file - total_dirty - total_writeback, never more
than the usage, less min(credit / 2, limit / 64): the rule of the v2 container branch (arena_cgroup_room). shmem (in total_cache, on the anon lists) and mlocked pages are
not on the file lists, so they stay charged. A memory.stat without total_inactive_file or no memory.stat: no credit (limit - usage, as before). STRATA_MEM_CREDIT_INACTIVE=1
credits total_inactive_file alone. The v2 branches are unchanged.
Test: file_expert_source_test (test_host_memory) has the box's memory.stat / usage / limit (2026-11-19 19:01:37 UTC) in the hybrid fixture: the room was 2.57 GiB before and is
92.9 GiB now; memory_guard_test has the pure arena_cgroup_room_v1 cases (shmem, dirty, writeback, bound by the usage, no stat, inactive only).
0.1.62 and before warned "only N MiB of VRAM free at the start of this request" at the first request of every start below 1 GiB (512 MiB off
Windows), also on a card the expert cache fills on purpose. The rule is now strata/core/vram_request_notice.hpp: say it below the safe figure
when the free memory is at least 64 MiB lower than the start-up line reported (generate.cpp keeps that figure in g_startup_vram_free_mib; the
request compares the same figure the start-up line prints) or is under 512 MiB; with no start-up figure the old rule stays. The text is the
owner-approved wording of TEXT-BATCH-0217 item 4 (Windows says "Windows", other systems "the driver"). Once per 128 MiB lower, as before.
Test: vram_request_notice_test (header-only, CPU). docs/DETAILS.md describes the new rule.
On an RX 7900 XTX (Windows, HIP) --adapt-async 1 ended long generations with a verify timeout and a display-driver reset every 1 to 3 long answers;
without it the same engine and config ran clean at the same speed (#5672). STRATA_ADAPT_OVERLAP=1 on a gfx1030 card (Windows, HIP) ended the first
request with a GPU fault and a display-driver timeout; it was confirmed on CUDA only (#5738). Both are opt-in. On a Windows HIP engine the engine now
starts with each of them off and prints one line saying why. STRATA_WIN_HIP_RISKY=1 takes both as asked and prints one warning line. Linux HIP, CUDA,
SYCL and Metal are unchanged.
Decision and the lines: include/strata/core/win_hip_risky.hpp; test win_hip_risky_test (both platforms, with and without the override, the lines).
The setting is registered with status research. STRATA_NUMA_BALANCING (the earlier HIP NUMA commit) was missing from the register and is added with
status default: tools/test_settings_register.py failed on it. Windows cannot be run here: the Windows branch is two constants and was compiled on
the HIP build only as the Linux side.
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).
--mtp-q4 head|all rewrites the gathered draft-head subset in place as Q4_0 rows (n_embd / 32 * 18 bytes). bind() sized the buffer for the
head's own row, and an IQ4_XS head has the narrower row (1,360 bytes against 1,440 at n_embd 2560), so the host-to-device write went 8.1 MiB
past the buffer on a 106,299-token subset: "mtp: writing the draft head", engine exit 1 at load (GB10 defaults select --mtp-q4 all).
The buffer and the vram_ account now use mtp_draft_head_row_cap (strata/core/mtp_head_rule.hpp): the wider of the two rows. Formats at least
as wide as Q4_0 (Q6_K, Q8_0) and --mtp-q4 off are unchanged.
Test: mtp_head_rule_test (IQ4_XS 1,360 -> 1,440, wider formats and q4 off unchanged, n_embd not a multiple of 32).
host_available_memory (the probe behind --resident-experts, --resident-budget-gib and the arena's RAM check) returned false on two cgroup v2 shapes
that carry no problem for the memory itself, and the engine then read every expert from the files (--mmap-experts) with RAM free:
- a group in the process's chain that has no memory.max (the memory controller is not switched on for it, as for many desktop session scopes): it
counts as no limit of its own now, and the groups above it are still read;
- a container whose /proc/self/cgroup names the host's path while /sys/fs/cgroup is its own group (no cgroup namespace): the path is not in the
mount, so the mount's root is read as the process's own group (on a real v2 host the root has no limit, MemAvailable alone).
An unreadable or malformed limit still fails, and the failure now names what could not be read (HostMemory::why), appended in brackets to the three
"cannot determine available memory for ..." messages (the texts keep their start).
Test: file_expert_source_test (test_host_memory): a controllerless child, the parent's limit above it, a path outside the mount with and without a
limit on the mount's root, an unreadable memory.max. The cases that expected a failure for the first two shapes are replaced.
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.
Under WDDM every page-locked, mapped host buffer counts against the GPU's shared (non-local) segment on each CUDA device it is mapped into, and Windows caps that segment at about half the RAM. The complement was sized from the commit capacity alone, so on a 31 GB PC with two cards the auto size (14.81 GiB) filled the segment and the next 26 KB allocation ("prefill: the token id buffer") failed with out of memory before READY. pin_cache_complement now asks DXGI (platform::gpu_shared_memory_budget, already used for the sliced arena pin) for the room the tightest CUDA device has left, keeps 2 GiB for the buffers mapped after the complement (STRATA_WDDM_SHARED_RESERVE_MIB changes it) and cuts the budget to the rest; where DXGI cannot tell, nothing changes. detail::clamp_budget_to_shared_segment is the arithmetic, with a unit test in file_expert_source_test (the reporter's 14.81 -> 10.97 GiB case at 12.97 GiB left). Not taken from the report: its second clamp (10 GiB of RAM kept for the later working set), which is tuned to one 31 GB machine.
Owner decision 2026-11-19: the route tail skip is off by default; users reported lower quality. From 0.1.42 to 0.1.62 the serve start-up set
rank 7 when the variable was unset (CUDA, HIP gfx1200/gfx1201, where not all experts are on the card and fewer than 90% are cached). Now an unset
value is rank 0 on every backend, and STRATA_ROUTE_TAIL_SKIP=7 (or 1 to 9) turns it on as before.
- include/strata/core/tail_skip_default.hpp: the rule as a header-only function (unset -> 0; 1 to 9 -> itself; anything else -> 0).
- src/core/expert_source.cpp reads the variable through it.
- src/program/generate.cpp: the default-on block of the serve start-up (the cached-share, NVFP4, arch and peer conditions and their two
"off by default" lines) is gone; the line "STRATA_ROUTE_TAIL_SKIP=N is ON" stays for an explicit value; the run manifest says the skip is on only
when the rank is above 0.
- STRATA_TAIL_SKIP_MAX_CACHED moved the default rule's line and is no longer read: marked retired in the settings register (0.1.63).
- tests/core/tail_skip_default_test.cpp (cmake-cpu): unset is 0, 1 to 9 are themselves, everything else is 0.
On a host with cgroup v1 controllers and a "0::/..." line in /proc/self/cgroup but no
cgroup.controllers at the cgroup root (Docker on a v1 host, e.g. Vast's containers), the
v2 branch of detail::host_available_memory looked for the "0::" path under the v1 tree,
did not find a directory and returned false before the cgroup v1 branch (#633) could run.
Every --resident-budget-gib was then ignored with "cannot determine available memory" and the
experts were read through the file cache (1.9-2.4x slower prompts, 12-35% slower decode with
RAM free on the rented RTX 5090 box).
A "0::" line is now only a v2 limit when the root has cgroup.controllers; otherwise it is
skipped and the memory controller's v1 group is read. Pure v2 hosts behave as before.
Test: fake /proc and cgroup trees for v1, v2 and the hybrid shape (0:: line last, first, "0::/",
unlimited, no v1 line, v2 root with a v1 line beside it, v2 root with a missing path).
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.