- 'Container': the Dockerfile's sm_61 build, every engine beside the front end,
CUDA_ARCHS, the /health healthcheck with its 30-minute start period, and a
docker run line with the '--' separator the parser requires
(frontend/main.cpp:91-120). examples/compose/p40.yml is named with its
defect: engine options without '--' (t0578).
- The two clone commands pointed at upstream (robertkarl/UnbiasedStrata); this
fork is what the rest of the README describes, so they name
git.kropa.tech/hiddenbox/UnbiasedStrata.
- Code line: kropa is home, upstream/origin are the other two remotes.
The expert cache was sized from the VRAM free at load, but the attention
caches map their rows later, as the conversation grows (cover()). A card
filled with experts then cut the cache on every prompt, and once it was at
zero a long prompt died with "no VRAM for the attention cache (2 MiB more)"
(GTX 1060 6 GB, Qwen3.6-35B-A3B, --max-context 131072, --kv q8_0).
kv_unmapped() is what the chunked caches will still map to reach
--max-context; fill_expert_cache(), mind_card_vram() and held_is_budget()
leave it to the rows. If it does not fit, every expert runs on the CPU and
the message says what makes room. docs/VRAM_BUDGET.md has the analysis.
Not yet verified: docs/VRAM_BUDGET.md says "compile verification running"
-- build and run it before relying on it.
- New compose commands for p40-0 and p40-1
- Engine mapping (strata-poly vs strata)
- VRAM estimates per card
- Rollback procedures
- Open questions (build failure, no timing data, etc.)
- Remove multi-stage build (strata_kq fails to compile in container)
- COPY unbiased-strata, strata, strata-poly, libstrata_kq.so from build/bin/
- Reduces build time from ~90s to ~5s
- Runtime image only has ca-certificates + curl (healthcheck)
Compiles CMAKE_CUDA_ARCHITECTURES=61 and passes -DSTRATA_EXPERIMENTAL_SM60=ON,
with an early error when nvcc is 13+ (which dropped sm_60/sm_70). Default
build is unchanged.
(cherry picked from commit 6afd3ff4d8)
Multi-stage Dockerfile: build (nvidia/cuda 12.8.1 devel, PASCAL=1) then a
runtime stage (nvidia/cuda 12.8.1 runtime), one binary (build/unbiased-strata),
a /health check. examples/compose/p40.yml shows a one-card Tesla P40 service
with the model, pack and MTP mounted read-only.
(cherry picked from commit 570b5eb6c4)
The engine reports progress (PP) and tokens (T) over its stdout, but the
front end logged only the start and end of a request. A 154k-token prompt
is minutes of silence that reads as a hung request. Now a line every
STRATA_PROGRESS seconds (default 5, 0 = off): prompt processing from the
engine's own PP lines, and decoding from the token count.
cudaGraphInstantiate allocates device memory for each window size's exec and the
exec is never freed (measured ~22-26 MiB per size on a GTX 1070 Ti, 2026-10-15).
serve captured each size lazily, on the first request that used it, so that
memory came out of - and could outrun - the reserve the auto-cache had been sized
against. A serve planned down to its last ~150 MiB therefore captured the sizes
its first requests asked for and then failed the next
strata serve: verify: instantiate: out of memory
mid-request, which took the engine and the front end down with it (the container
restarted). This is not the sampler or the Qwen3.6 port: the DRY work adds ~4 KB
of device arrays and a 128 KB history row, and the lazy capture predates both.
Every size 1..max_t the serve path can ask for is now captured right after the
verifier is bound (after set_split / set_pcie_mode, which the recorded graph
depends on). That makes the cost part of what the serve free-VRAM check sees and
bounds it before any request runs: a size that does not fit is reported at
startup, naming the knobs that make room, instead of killing a request.
Seen on kontron.local: a GTX 1070 Ti (sm_61) serving Flash-Next Coder IQ1_M with
--ctx 131072 --vram-cap 7680. There the window graphs need ~135 MiB and the plan
left 135 MiB free; --vram-reserve-mib 700 (which skips #496's lowering to 300)
leaves ~630 MiB and all six fit. The cap itself is honoured: the blocker held
back the 424 MiB it should.
The sampler chain gains llama.cpp's dry stage (penalties -> DRY -> top_k -> ...): a token that would extend a
repeat longer than dry_allowed_length over the last dry_penalty_last_n history tokens loses
dry_multiplier * dry_base^(repeat - allowed_length), with tokenized restart sequences capping the scan.
- kernels/cuda/sampler.cu: dry_window/dry_build/apply_dry in the greedy, old, one-block, split and coupled
penalize kernels; the DRY window is the same history row the penalties count, clamped to kDryWindowCap=512;
the membership bitmap spans the wider of the two windows and gates both. Off (the default) the neutral path
is unchanged: shmem 0, the cluster argmax still runs, the parity fixtures pin every path against a host
reference (sampler_parity, 19 fixtures).
- include/strata/kernels/sampler.hpp: the dry_* fields, DryBreakers (device flat/off), dry_enabled.
- verify / mtp: Verifier::set_breakers and MtpDrafter::set_draft_breakers thread the tokenized breakers to the
head sampling and the captured coupled-draft graph (stable device arrays).
- generate.cpp (engine): dry_multiplier / dry_base / dry_allowed_length / dry_penalty_last_n / dry_breakers GEN
keys; the breaker arrays are allocated once at the cap on the head device, the request refills them; a
DRY-only request still stages history (the wider of the two windows).
- front end: --dry-multiplier / --dry-base / --dry-allowed-length / --dry-penalty-last-n / --dry-breakers
defaults and dry_* / dry_sequence_breakers request fields; the front end tokenizes the restart sequences
(the engine has no tokenizer) and sends them as ids. The defaults are llama.cpp's: multiplier 0.8, base
1.75, allowed length 2, window 256, breakers newline, colon, quote, asterisk when unset.
Port upstream Strata's reasoning_budget_tokens to this fork's front end: when the thinking reaches the budget it is closed with a configurable message and the template's end-of-thinking tag, and the engine is asked again with prompt + generated + wrap-up, continuing from the prefix it already holds. Off unless thinking is on and a budget is set (a request's own value wins over the command line). The wrap-up tokens are charged to the response so the context fit is unchanged; usage reports completion_tokens_details.reasoning_tokens. --reasoning-budget-message sets the wrap-up wording (default: upstream's own line).
Brings in 139 upstream commits: the Qwen3.6-35B-A3B model (ModelGeometry from the file's own metadata, native experts IQ3_XXS/Q5_K/Q6_K, dense split-K attention, the GDN gate per model, the MTP drafter, native packs through the verify window), the VRAM/RAM planner with --vram-cap/--ram-cap, the fat-binary CUDA build, and the front-end fixes (content streaming, preserve_thinking, the engine's actual context, /health tiers).
Conflicts resolved:
- Makefile: kept upstream's CUDA_ARCHS default and the drop-unsupported-arch logic (fixes the compute_120 build on this toolkit) and kept the local PASCAL=1 override.
- README.md: kept both the local --fit-max-tokens row and upstream's engine-flag row.
- frontend/main.cpp: kept the local --fit-max-tokens option beside upstream's --vram-cap/--ram-cap.
Multi-stage Dockerfile: build (nvidia/cuda 12.8.1 devel, PASCAL=1) then a
runtime stage (nvidia/cuda 12.8.1 runtime), one binary (build/unbiased-strata),
a /health check. examples/compose/p40.yml shows a one-card Tesla P40 service
with the model, pack and MTP mounted read-only.
The engine keeps 8 cells of the context for itself, so the earlier check
(prompt + 1 <= ctx) promised more room than the engine would accept. A request
whose max_tokens would run past the room left is now shortened to fit, or
refused with --no-fit-max-tokens (default: fit).
Compiles CMAKE_CUDA_ARCHITECTURES=61 and passes -DSTRATA_EXPERIMENTAL_SM60=ON,
with an early error when nvcc is 13+ (which dropped sm_60/sm_70). Default
build is unchanged.