26 Commits
Author SHA1 Message Date
lotherk a4c4871514 README: container section, the fork's own clone URL, the repository home
- '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.
2026-11-19 10:12:58 +00:00
lotherk 5cd37fa703 poly: hold the attention caches' growth back from the expert cache (kv_unmapped)
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.
2026-11-19 09:56:23 +00:00
lotherk cb1861e0a5 Merge remote-tracking branch 'upstream/main' 2026-11-17 09:03:29 +00:00
lotherk a0c6750245 submodule: update llama.cpp to latest upstream 2026-11-17 08:50:37 +00:00
lotherk f05c3e29fe Merge upstream/main: DeepSeek-V4.1, Metal/SYCL backends, Qwen3.6-35B-A3B, DRY penalty, and 296 upstream commits
All conflicts resolved as upstream (theirs) per user request.
Everything upstream is now in.
2026-11-16 19:13:48 +00:00
lotherk db1cf9ef40 docs: add Frontend-CLI migration deliverable document
- 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.)
2026-11-05 17:19:33 +00:00
lotherk c9a49cd0b8 Dockerfile: switch from source-build to COPY pre-built binaries
- 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)
2026-11-05 17:08:41 +00:00
lotherk 56b6a73054 Dockerfile: copy strata + strata-poly engines for --engine support
- Add strata binary (GSQ-RCO pack/MTP models like Qwen3.8)
- Add strata-poly binary (standard GGUF models like Qwen3.6)
- Add libstrata_kq.so shared library
- ldconfig after library install
2026-11-05 16:47:44 +00:00
lotherk e965472b7c docs: update report with build results — gate GREEN 2026-11-05 13:44:41 +00:00
lotherk 847aa7da5f build: pick the oldest tensor-core arch (sm_70) for strata-dsv41; configure green at CUDA_ARCHS=61 2026-11-05 05:59:03 +00:00
lotherk 910648f2bf build: fix the sm_70 pick (no CMake IN operator) for the tensor-core engine 2026-11-05 05:02:04 +00:00
lotherk 827b5cbf0b build: strata-dsv41 needs tensor cores (sm_70+); keep Pascal archs for strata/strata-poly 2026-11-05 04:06:54 +00:00
lotherk 5c83c832a0 docs: update report — rebase onto upstream 22abfdb, sm_61 build state, dropped features 2026-11-05 01:35:09 +00:00
lotherk 4c64d1e33a Build: PASCAL=1 for the experimental sm_61/sm_60 (GTX 10-series, P40) build
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)
2026-11-04 22:02:22 +00:00
lotherk 6ae71dce2a Container: build the unittest image in a Dockerfile; add a P40 compose example
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)
2026-11-04 21:58:25 +00:00
lotherk 430af49f84 frontend: print the engine's prompt and decode progress as it happens
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.
2026-10-15 11:55:32 +01:00
lotherk 4ad0206b1f serve: capture the verify windows up front, not on the first request
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.
2026-10-15 09:29:23 +01:00
lotherk c8c3ca492c Sampler: DRY anti-repetition penalty, exposed end to end
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.
2026-10-14 22:44:58 +01:00
lotherk 7505a9d102 Front end: a hard thinking cap (--reasoning-budget-tokens / reasoning_budget_tokens)
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).
2026-10-14 07:31:17 +01:00
lotherk 81b2ad128d Merge upstream/main: the Qwen3.6-35B-A3B port (steps 2-5)
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.
2026-10-14 07:14:48 +01:00
lotherk 89f653e249 Merge container (Docker + P40 compose) 2026-10-13 13:40:52 +01:00
lotherk 13b8eeb64e Merge fit-max-tokens (fit-max-tokens option) 2026-10-13 13:40:52 +01:00
lotherk 9fb9968abd Merge pascal-sm61-build (sm_61/P40 support) 2026-10-13 13:40:52 +01:00
lotherk 570b5eb6c4 Container: build the unittest image in a Dockerfile; add a P40 compose example
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.
2026-10-13 13:27:34 +01:00
lotherk d9dc03abdb Front end: shorten a request's max_tokens instead of refusing it (--fit-max-tokens)
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).
2026-10-13 13:19:31 +01:00
lotherk 6afd3ff4d8 Build: PASCAL=1 for the experimental sm_61/sm_60 (GTX 10-series, P40) build
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.
2026-10-13 13:19:00 +01:00