Merge branch 'claude/upstream-sync' into claude/port-gpu-bringup
This commit is contained in:
@@ -0,0 +1,375 @@
|
||||
# Upstream digest: Strata 0.1.35 (`d9ab8435`) to 0.1.50 (`41cf05a0`), 2026-10-25
|
||||
|
||||
For the owner. Short, ranked, with SHAs and paths. Provenance and what the merge did to our tree: [upstream.md](upstream.md).
|
||||
All speed and quality numbers below are **upstream's claims on upstream's hardware, not measured by us**. Commit SHAs are 8 characters of
|
||||
upstream `origin/main`. Upstream rewrote its history: the old pin `d9ab8435` is tree-identical to `5b734e42`, and the real distance is
|
||||
3630 commits (not 4175). Of these, 996 touch the engine outside the DeepSeek, Gemma and Qwen3.6 trees.
|
||||
|
||||
What was read: commit subjects and diffstats of the whole range, the diffs of the commits quoted here, `src/dsv41` headers and selected
|
||||
kernels, `docs/DEEPSEEK41.md`, `CMakeLists.txt`, the packaging scripts, the serve protocol in `src/program/generate.cpp`. What was not
|
||||
read is listed at the end.
|
||||
|
||||
## Top five
|
||||
|
||||
1. **Route tail skip** (`65268d99`, default on since `b4e3407b`): the only upstream change that attacks our actual bottleneck (the CPU
|
||||
expert pool is about 25 of 36 ms of a verify window on the 5090, `docs/original-serve.md`). Claimed decode +10..20 percent on 12-16 GB
|
||||
cards, +11.5 percent on an RTX 5090 (NVFP4 pack). It is lossy: it must be a flagged experiment for us until a quality gate passes.
|
||||
2. **The sm_120 bitwise decode set** (`ba2c2d5f`, `94104176`, `75afe3f4`, `44997124`, `ffac97f7`, `731528be`): claimed bit-identical,
|
||||
claimed -14 percent round time with all experts resident. Needs re-sealing PTX.
|
||||
3. **Non-finite fixes** (`2b726ba6`, `f6601bf8`, `7a0e3023`, `e372d4ff`): q8_1 scale overflow turns into NaN and "!!!!" output. Our sealed
|
||||
copies of the quantizers almost certainly carry the old formula. Cheap correctness work.
|
||||
4. **DeepSeek-V4.1-Flash runs on CUDA sm_120** (`src/dsv41`, `docs/DEEPSEEK41.md`) and its line protocol is a compatible subset of the
|
||||
Qwen engine's. The cheapest second model is `strata-dsv41` as a second supervised worker behind our gateway (about 7-10 days), not a Rust
|
||||
port (8-14 weeks).
|
||||
5. **"KAR for any MoE model" is true for the archive format and false for our runtime**: expert geometry is a compile-time constant in 17
|
||||
files (and in sealed kernels), and for the official 2-bit DeepSeek sets KAR level 2 (2.5 bits per weight) is larger than the source.
|
||||
Details in part 2.
|
||||
|
||||
---
|
||||
|
||||
# Part 1. Qwen-path changes worth taking into the Rust runtime (owner priority 1)
|
||||
|
||||
Scope: `src/core`, `src/prefill`, `src/kernels`, `src/spec`, `src/ngram`, `src/program`, `include/strata`, `serve/`, `strata_control/`.
|
||||
Target: RTX 5090 (sm_120, CPU pool bound) first, the sm_86 laptop second. "Numerics" is the question that matters for our quality gate:
|
||||
does greedy output or any tensor differ from the pinned `stra169-ladder` Original (old pin, which stays the reference).
|
||||
|
||||
## 1.1 Ranked shortlist
|
||||
|
||||
| # | Change | Upstream SHAs and files | Upstream's claimed gain | Value for us | Effort | Numerics vs the Original |
|
||||
|---|---|---|---|---|---|---|
|
||||
| 1 | **Route tail skip**: a missed expert that every token of a window routes at rank 7 or lower is neither copied nor computed. Off at 90 percent or more of experts cached, with `--batch`, with NVFP4 experts | `65268d99`, `b4e3407b`, `6ab541f6`, `55e2072c`; `src/core/expert_source.cpp` (~4763-5083), `src/program/generate.cpp` (~10110) | decode +10..20 percent on 12-16 GB cards (3060 x1.156, A4000 x1.129, P100 x1.146); +11.5 percent RTX 5090 with an NVFP4 pack; KL 0.003-0.006, perplexity x1.005-1.011 against skip off | High: cuts the CPU-pool share of the window. Expected effect on our IQ3_S pack is unknown; the claims are on other packs | S, 1-2 d (`original_serve_pool.rs` group split) | **Changes output.** Experimental flag only; own quality gate first |
|
||||
| 2 | **sm_120 bitwise decode set**: `SIDE_MIXER=2`, `ATTN_DAILY`, `GR_UP75`, `GR_DOWN_TG=1`, `GU_SWIGLU`; interleaved MMVQ for 2-4 columns (default on CUDA), 5-8 columns with sm_120 tables | `ba2c2d5f`, `94104176`, `75afe3f4`, `75fabbd9`, `44997124`, `b1e0fdaa`, `ffac97f7` (+`668072aa`), `731528be`, `ffc30b8d`; `include/strata/core/sm120_series.hpp`, `fused_gr.cu`, `qsa_decode_attn.cu`, `native_mmvq.cu`, `iq_kernels.cu`, `verify.cpp` | RTX PRO 5000 (110 SMs, all experts in VRAM): 4-token round 13.70 to 11.80 ms, decode +13.6..15.8 percent; head at 5 columns 899 to 491 us | High for the GPU share; our windows reach T=5-6 where the old code falls back to `native_mmvq_multi` | M, 4-6 d plus re-sealing PTX | No (commits say bitwise; parity tests `mmvq_il_parity`, `qsa_merge_daily_parity`, gr parity) |
|
||||
| 3 | **Non-finite fixes**: q8_1 scale/sum clamps, NaN guard with self-healing, prompt retry after a non-finite window | `2b726ba6`, `f6601bf8`, `7a0e3023`, `e372d4ff`, `f332a855`, `894f133b` | fixes "!!!!" degeneration (#606, #879) | High as correctness; our sealed `q8_1_store`, `native_quantize_q8_1`, SwiGLU quantizer, `gr_q8_tail`, `gdn_q8_1_store` copies probably have the old formula | S, 1-2 d | Finite blocks claimed bit-identical; only overflowing blocks change (they were garbage) |
|
||||
| 4 | **QSA top-k at long context**: 1024-thread "wide" kernel past ~135K cells; on sm_90+ thread-block-cluster top-k and cluster greedy argmax | `586367cb`, `d05d26e9`, `6ef23b89`; `qsa_select.cu`, `sampler.cu` | 9-12x at 262K-524K cells; per call 200 to 22 us at 262K (5070); argmax 39.6 to 5.9 us; 243K prompt +26 percent (3060) | High at our 262K and 512K contexts | S-M, 2-3 d | No ("same ids"; `qsa_topk_parity`, `decode_cluster_parity`) |
|
||||
| 5 | **Bitwise prefill kernels**: GDN recurrence with 3 value heads per thread, no dead FP32 store in the output norm; quantize each token's MoE input once and scatter it; `DEQUANT_WIDE` (default on sm_86) | `4e69f974`, `c675f5b7`, `5f843a92`; `src/prefill/kernels.cu`, `prefill.cpp` | 18.8 to 13.0 and 4.65 to 3.05 ms per layer at 32K; 5090 32K quantization 77.5 to 58.1 ms; 3060 TTFT -12..20 percent | Medium (TTFT) | S-M, 2-4 d | No ("same bits"; `gdn_rec_parity`, `prefill_mmq_scatter_test`) |
|
||||
| 6 | **Callback-thread affinity**: one no-op host callback before the host thread pins itself | `0e20d9ae`, `c08fd902` | 5090 + 9950X: 142.82 to 207.75 tok/s with the adaptive overlap; one callback 985 to 4 us | Check first: our DMA staging uses host functions | S, 0.5 d | No |
|
||||
| 7 | **#783 decode series and F7 ports**: multi-token router, float4 combine, multi-token GR read/write, fused per-head RMSNorm+RoPE, batched K/V and indexer append, exact-T GDN, 16-lane sub-warp expert kernels, MTP catch-up skipping rejected rows, late shared-expert fork, multi-block argmax, one-token window commits itself, `COMMIT_BATCH` | `1690a4a3`, `ae3b249f`, `822251be`, `44ffa86c`, `fe4de5de`, `088e8a82`, `104a8485`, `2715a752`, `3fd0460b`, `8b5dd7ad`, `868f2ef0`; fixes `0c86bbec`, `9d9c9ca2`, `023dd015`; F7 `3e4aa1d6`, `ca833116`, `352cad8f`, `4a5713fb`, `edc592b1`, `6f3e3810` | graph build on R9700 2.35 to 0.65 ms; otherwise no numbers | Medium-high, but **overlaps our chain kernels** (`docs/chain-kernels.md`): compare item by item before porting | L, 8-12 d | Claimed no (memcmp tests `gdn_parity`, `kv_steps_parity`, `native_multi_parity`, `gr_multi_parity`, `rope_parity` check 6). First versions were not bitwise (`0c86bbec`, `9d9c9ca2`): port the fixed forms |
|
||||
| 8 | **Expert-tier policy**: `pcie_frac` refined from measured CPU speed (PcieAuto); async tier chosen by measurement; `ADAPT_LAG`, `ADAPT_NOWAIT` (default on sm_86) and its eviction fix | `aa7b0cb1`, `ab97f174`, `b18700c8`, `b437b8ea`, `d69424c9`, `3f2db5e2`; `generate.cpp`, `adapt_async_default.hpp`, `nv_defaults.cpp` | 3060 x1.300 from PcieAuto; sm_86 set +9.6 / +14.6 percent | Medium for the laptop; on the 5090 our own measurement already put the PCIe share at 0.55 | M, 3-4 d | Changes placement, so changes rounding. Their "identity gate" runs `--adapt-every 100000` and never exercises it |
|
||||
| 9 | **Fused int8 prompt experts** (default on sm_120 with 80+ SMs) | `959e6c34`, `b1e0fdaa`; `src/prefill/moe_fused_iq.cu` | prompt +7.0 / +5.2 / +3.4 percent at 4K / 20K / 98K; KL vs MMQ 0.0002 | Medium | M, 3-5 d | **Changes output** (rounds differently) |
|
||||
| 10 | **WSL KV host copy** pinned with `cudaHostRegister` (the driver caps `cudaHostAlloc(Mapped)` at about 1 GiB under WSL2) | `c41c0ebb`; `src/core/layer.cpp` `kv_host_alloc` | lifts the cap | Medium for laptop WSL runs | S | No |
|
||||
| 11 | **CPU expert rows**: router dot accumulators in registers; Q5_1/Q8_0 down-row dots; 512-bit gathers (Intel); default worker count | `2a669f3c`, `79376a27`, `16c4da94`, `5ece068f` | router 2.1x (Zen 3), down rows 1.24-1.30x (Zen 5) | Medium: `crates/native-cpu-expert` vendors these files, so it is a copy job | S | No (bit-identical to ggml, FNV-hash tested) |
|
||||
| 12 | **Chunked GDN prompt recurrence** (opt-in) | `0f78032f` | 1.81x on the recurrence (5090); 32K prompt -3.7 percent | Low-medium | M | Changes output |
|
||||
| 13 | **Speculation extras** (cost-aware MTP window, probabilistic acceptance, DFlash2 drafter, `--lookup-chain`, `--mtp-q4`), all opt-in | `68781055`, `5f49ec45`, `d232721d`, `b1ebc3d7`; `33356f72`; `7f97c35a`, `5bc7f8ca`, `89799596`, `ff9ca03f`; `2312c83b`, `e35a061f` | spec-prob: none on a 3060; the rest unpublished | Low; compare ideas against our adaptive window only | L for DFlash2 | Probabilistic acceptance and `mtp-q4` change output |
|
||||
|
||||
Not worth taking: Qwen3.6-35B-A3B path (`src/qwen35`, a different model family), Metal/SYCL/HIP-only changes, the K8V4 streaming and elastic KV
|
||||
(`--kv-grow`; our serve path excludes K8V4).
|
||||
|
||||
## 1.2 What we already have under another name
|
||||
|
||||
| Upstream feature | Our equivalent | Remaining delta worth looking at |
|
||||
|---|---|---|
|
||||
| Conversation cache, parking, `pin=N` prefix, message-boundary checkpoints (`f0010a60`, `d9cb22d2`, `940011da`, `c9e571e0`, `13d14a49`, `9c139846`, `b5de344b`) | cross-session prefix cache with request-end checkpoints (`docs/prefix-cache.md`) | park-gain (claimed 1418 parks to 1), evict-to-pass-the-RAM-gate, `pin=N` for the shared system prompt and tools block. More cut points change greedy tokens, so each is a numerics decision |
|
||||
| Cost-aware MTP window, `spec_min_p` | MTP depth-4 adaptive window (`spec_min_p 0`, +5.1 percent measured) | none to port; compare the cost model on paper |
|
||||
| KV host copy streaming, KV upload overlapped with prefill, `STRATA_RING_BYTES` | INT8 KV streaming; expert-stream prefill overlap | the `RING_BYTES` default changes bits on native packs for long prompts (see 1.3) |
|
||||
| 4096-byte direct reads (`direct_file`, PLE/expert stores) | 4 KiB aligned expert copies | none |
|
||||
| Adaptive expert tier, residency table, lookahead, VRAM/PCIe/CPU tiers | expert tiers (VRAM slots / PCIe stream / CPU pool), seed residency, lookahead | PcieAuto, async-by-measurement, ADAPT_LAG (row 8) |
|
||||
| Fused norm+RoPE, batched appends, multi-token GR (#783) | chain kernels | row 7: compare list against `docs/chain-kernels.md` |
|
||||
| PLE table with row cache (table-driven formats Q8_0/Q5_1/Q4_0/BF16/NVFP4) | KAR level-2 PLE rows (50-byte rows) with a bounded GPU row cache | their formats are other quantizations of the same table; nothing to port |
|
||||
|
||||
## 1.3 Defaults flipped upstream (relative to 0.1.35)
|
||||
|
||||
An upstream build now behaves differently from the old pin with no flags. For any A/B against the Original set these explicitly:
|
||||
|
||||
| Default now on | Changes output? | Old behaviour |
|
||||
|---|---|---|
|
||||
| `STRATA_ROUTE_TAIL_SKIP=7` (CUDA serve, under 90 percent cached; `b4e3407b`) | yes | `STRATA_ROUTE_TAIL_SKIP=0` |
|
||||
| PcieAuto (CUDA, one GPU, no `--pcie-frac`) | yes (placement) | `STRATA_PCIE_FRAC_DEFAULT=old` |
|
||||
| `STRATA_PREFILL_CPU_SHARE=auto` for chunks under 1024 tokens | yes (mean KL 0.004) | `=0` |
|
||||
| `STRATA_RING_BYTES` (#583) on native packs | yes for long prompts | `=0` |
|
||||
| sm_120 set (bitwise) and `PF_FUSED` on 80+ SM cards | `PF_FUSED` yes, the rest no | `STRATA_SM120_PERF=0`, `STRATA_PF_FUSED=0` |
|
||||
| sm_86 set: `ADAPT_NOWAIT`, `ADAPT_LAG=2`, `CPU_IQ_ALL_EXACT1`, `SIDE_MIXER=2`, `ATTN_DAILY`, `GR_UP75`, `GU_SWIGLU`, `QSA_ROWS`, `B6_MMVQ_ROWS`, `DEQUANT_WIDE` | adapt flags yes | `STRATA_SM86_PERF=0` |
|
||||
| async adaptive tier chosen by measurement | yes (placement) | `--adapt-async 0` |
|
||||
| bitwise switches: `COMMIT_BATCH`, `ONE_TOKEN_COMMIT`, `HEAD_MIX_MULTI`, multi-block argmax, fused norm+rope, `MMVQ_IL`, cluster top-k/argmax (sm_90+), MTP catch-up skip, `SH_FORK_LATE` | no | n/a |
|
||||
| `STRATA_NAN_GUARD=1` | no | n/a |
|
||||
| `--conversation-cache-mib` 0 to auto (parking on); `--ple-inflight` 64 to 256; `--ple-io direct` no longer switches itself to mmap | cache sizing only | `--conversation-cache-mib 0` |
|
||||
| Server: a request with no sampling gets the model card's sampling instead of greedy (`a8091f4d`); `max_tokens` keeps a quarter for the answer (`d0e990ba`); empty assistant turns dropped (`ffbc39f4`) | yes (server side) | send explicit sampling |
|
||||
|
||||
## 1.4 Upstream fixes that may be bugs in our port (check these first, they are cheap)
|
||||
|
||||
1. q8_1 overflow becoming NaN (`2b726ba6`, `f6601bf8`, `7a0e3023`, `e372d4ff`): see shortlist row 3.
|
||||
2. `--dump-logits` on a native pack wrote a header claiming 64-66 rows and wrote none (`504579da`); a reader that trusts the header reports
|
||||
"0 differing positions". **Check whether any of our parity harnesses compared against the Original this way.**
|
||||
3. Spec window and MTP drafts near the context end ran past `max_cells` and killed the request with "ran out of context" (`e85567b6`).
|
||||
4. PLE `gather_batch` matched prefetched rows by position, so reordered or duplicated keys were read twice (`36381540`). Check our async PLE reader.
|
||||
5. Control-token text (`<|im_end|>`, `</think>`) inside message content was encoded as real special tokens (`c16f31f8`, `98b7ea94`,
|
||||
`0d613031`). `crates/tokenizer` parses specials across the whole rendered prompt: probably the same prompt-injection bug.
|
||||
6. Residency table uploads must wait for their own copy (`53ab5f71`); non-waiting swaps made greedy decode non-reproducible (`63b4bf0c`)
|
||||
(our port already waits, `3eb7405`).
|
||||
7. Conversation cache: a request cancelled between two prompt windows lost the conversation it had restored (`8824e217`); a full cache dropped
|
||||
the snapshot instead of evicting (`940011da`); 1-token prompt with `--spec` (`aece46db`).
|
||||
8. Callback-thread affinity (`0e20d9ae`), shortlist row 6.
|
||||
|
||||
---
|
||||
|
||||
# Part 2. Can KAR host a second MoE model? DeepSeek-V4.1-Flash against our KAR runtime (owner priority 2)
|
||||
|
||||
The owner's statement: "KAR can be applied to any MoE model". Checked against upstream's DeepSeek engine (`src/dsv41`) and against our KAR
|
||||
code (`docs/compressed-runtime.md`, `crates/model-format/src/kar*.rs`, `crates/leleka-runtime/src/model_binding/kar_expert_source.rs`,
|
||||
`crates/leleka-runtime/src/qwen_forward/original_serve_*.rs`). Short answer: **the KAR container and codec are model-agnostic; the expert
|
||||
source, the tier machinery and every kernel are Qwen3.8 geometry compiled in; and for the official DeepSeek 2-bit sets KAR level 2 does not
|
||||
save memory, it costs more.**
|
||||
|
||||
## 2.1 How DeepSeek-V4.1-Flash stores and streams its experts and Engram
|
||||
|
||||
All from `src/dsv41` and `docs/DEEPSEEK41.md` at `41cf05a0`; sizes are upstream's.
|
||||
|
||||
- **Model files stay as they are.** `tools/dsv41/pack_gguf.py` writes a small "pack" beside the GGUF shards (`ds4.txt` geometry,
|
||||
`tensors.txt` with `t <name> <dtype> <file> <offset> <bytes> <dims>`, `engram.bin` hash header, tokenizer, template); no weights are
|
||||
copied. The routed experts are one tensor per layer and role (`[n_exp][out][in]`); every expert is three matrices at three file offsets.
|
||||
- **Expert formats.** Official ISTA-DASLab sets (GSQ-RCO): IQ1_M 1.75 bpw (121 GB), IQ2_XXS 2.00 bpw (138 GB), IQ2_XS 2.25 bpw (155 GB);
|
||||
Unsloth UD-Q8_K_XL: MXFP4 experts (288.8 GB for 15,360 experts of about 18.8 MB). 40 layers, 384 experts, 6 used. Dense weights Q8_0/Q5_K/BF16
|
||||
(16.8 GB). Kernels: dp4a token path, nvcuda::wmma F16 tensor-core prompt path on CUDA, matrix-core tiles on HIP gfx11/gfx12 only, AVX2/AVX-512
|
||||
rows on the CPU.
|
||||
- **Three tiers, the same shape as Strata's and ours:**
|
||||
1. VRAM: "as many experts as fit" (`--vram-experts` fraction, ranked by the shipped hot-expert profile `data/dsv41/profile-2.00.bin`),
|
||||
in slots in the engine's blob layout (gate | up | down).
|
||||
2. RAM: `ExpertStore` (`src/dsv41/ds4_store.hpp`): a fixed arena of slots in the same blob layout, filled by unbuffered 4096-aligned
|
||||
reads (8192-byte gaps between matrices for the aligned spans), LRU or LFU replacement (`--ssd-policy`), pinned while a window computes
|
||||
them, filled on demand and by the lookahead's guesses, registered with the GPU so kernels read hits over PCIe zero-copy through the same
|
||||
plan pointers as VRAM experts. Auto-sized to free RAM minus 12 GB.
|
||||
3. SSD: the GGUF in place (`--mmap-experts`), with the CPU lane computing whatever is not in VRAM (`ds4_gguf_cpu.cpp`, `ds4_iq_cpu.cpp`,
|
||||
computing store hits while misses are read, `6fcde7e3`).
|
||||
- **Engram (the 111 GB IQ4_NL table, or 203 GB Q8):** read on demand from the SSD with `pread`, never loaded whole. A token's rows depend
|
||||
only on its id (compressed-vocab map, per-layer multipliers, XOR roll, `rolling % prime + off`), so the reads for a window are issued as
|
||||
soon as the tokens are known and collected just before layers 1 and 14 (`src/dsv41/ds4_engram_io.hpp`): 24 rows per layer per token, on
|
||||
their own reader threads, with a bounded clock-eviction row cache. Row formats: MXFP8, Q6_K or IQ4_NL.
|
||||
- **Structural reading:** upstream's expert RAM store is a sibling of the Strata expert pool (same 4096 alignment, blob layout, lookahead,
|
||||
LRU/LFU, pinned during the window, CPU lane on misses); the Engram reader is a sibling of the Qwen3.8 PLE n-gram table reader (rows
|
||||
addressed only by token ids, prefetched before the layer that adds them, row cache). Both are the two things we already built for Qwen.
|
||||
|
||||
## 2.2 What KAR is in our tree
|
||||
|
||||
- **Container and codec** (`crates/model-format/src/kar.rs`, `kar_levels.rs`, `kar_nested.rs`, `kar_kernel_model.rs`; spec: koference
|
||||
`format-kar-v2.md`): one KAR-2 archive per model with source digest and directory digest; per tensor, nested MSB-first bit planes with
|
||||
group-of-32 f16 scales and f16 codebooks; runtime levels 2..5 read the first N planes. Sources are F32/F16/BF16; GGUF quantized types are
|
||||
handled through a "virtual F32 identity" (the quantized block values expanded to F32, `model derive-*-identity`), so any tensor that can
|
||||
be dequantized to F32 can be put into KAR. In that sense "any MoE model" is true at the container level.
|
||||
- **Expert source** (`kar_expert_source.rs`): decodes `ffn_{gate,up,down}_exps` of every layer on demand through a closed CUDA program
|
||||
(`kar_decode_levels_gpu`) into bounded F32 scratch, then multiplies and applies SwiGLU. Its own header says it is **not verified on a GPU**
|
||||
(`docs/experiments/2026-10-14-kar-levels-gpu-port.md`). Used in the engine as the `STRATA_NEXT_EXPERIMENTAL_KAR_EXPERTS` cache-miss arm
|
||||
(a local patch, unqualified) and as level-2 PLE rows (50 bytes for 160 values: 5 words of 2 planes plus a scale) with a GPU row cache.
|
||||
- **Size arithmetic (ours, from block sizes; an estimate):** KAR level 2 is 10 bytes per 32 weights = **2.5 bpw**. Per DeepSeek expert
|
||||
(about 35.4 M weights): KAR L2 about 11.1 MB, against IQ2_XS 10.2 MB, IQ2_XXS 9.1 MB, IQ1_M 7.7 MB, MXFP4 18.8 MB. So for the official
|
||||
2-bit sets KAR L2 is larger than the source and lossy on top (it transcodes an already quantized tensor); it only compresses the MXFP4/Q8
|
||||
source (4.25 bpw, 508 GB set) and it is the same story for Qwen3.8's IQ3_S (3.44 bpw), where it is a lossy experiment. KAR's real
|
||||
property is **selectable precision per level**, not a smaller size than a good 2-bit codec.
|
||||
|
||||
## 2.3 What would have to be generalised
|
||||
|
||||
**In KAR / the expert source**
|
||||
|
||||
| Item | Today | Needed for DeepSeek | Effort |
|
||||
|---|---|---|---|
|
||||
| Geometry | `LAYERS=48, EXPERTS=512, HIDDEN=2560, FF=640` in `kar_expert_source.rs`; names `ffn_{gate,up,down}_exps` | a `MoeGeometry { layers, experts, top_k, hidden, ff, per-layer overrides, shared expert, tensor names }` read from the pack (`ds4.txt` / GGUF `deepseek41.*`) | S-M, 2 d |
|
||||
| Source types | `IQ3_S` and mixed Qwen types via virtual identity | IQ1_M, IQ2_XXS, IQ2_XS, MXFP4, MXFP8, trellis TQK: new dequantizers in `quant-core` / `model-format` (we have IQ2_S, IQ3_S, IQ3_XXS, IQ4_NL, IQ4_XS reference parity, not these) | M, 4-6 d for the 3 IST-DAS types plus MXFP4 |
|
||||
| Expert layout | three 2-D matrices; blob = gate, up, down | DeepSeek's `[n_exp][out][in]` with 3 separate file offsets: fits the same "three ranges per expert" model | S |
|
||||
| Expert FFN math | SwiGLU, 512 x top 10 sigmoid/softmax router | sqrt-softplus biased top-6 of 384, renormalised, `--experts N`; check activation clamp in `ds4_kernels.cu` (not read) | model-specific, see below |
|
||||
| Value of doing it | n/a | only for the MXFP4/Q8 source set (508 GB); no benefit over the official 2-bit sets (2.2) | decide before building |
|
||||
| Engram | n/a | a tensor class of row-gathered n-gram tables: our PLE reader (`model-format/ple_reader*`, 90-byte IQ4_NL rows, KAR 50-byte rows, row cache) generalised to a row size, a format and a row-address function; Engram lookups are 24 rows x 2 layers per token | M, 4-5 d |
|
||||
|
||||
**In the runtime.** Geometry is compiled in. The named constants (`EXPERTS = 512`, `TOP_K = 10`, `LAYERS = 48`, `HIDDEN = 2560`, `FF = 640`,
|
||||
`VOCABULARY = 248_320`) are defined in 17+ files, and the literals 512, 2560, 640, 248320 appear in 94-189 files each (tests and docs
|
||||
included). Concretely:
|
||||
|
||||
- `crates/leleka-runtime/src/qwen_forward/original_serve_pool.rs:26-28` (`HIDDEN`, `TOP_K`, `EXPERTS` as i32; `index = [usize::MAX; EXPERTS]`
|
||||
stack arrays, `layer >= 48`, a 10-wide selection `[u32; TOP_K]`, the window of at most 8 rows, `PCIE_EXPERTS = 12`);
|
||||
`original_serve_residency.rs`, `original_serve_lookahead.rs`, `original_serve_seed.rs`, `cache_profile.rs`, `cache_strata_adaptive.rs`,
|
||||
`moe_route.rs`, `moe_prefill_batch.rs` (runtime and `cuda-driver`), `mtp_original_physical_layout.rs`, `original_file_expert_source.rs`,
|
||||
`model_binding/qwen4exp_moe_expert.rs`, `native-cpu-expert/src/lib.rs` (`FF = 640`);
|
||||
- `crates/cuda-driver`: 98 `.cu` files and sealed PTX with pinned shapes (head dim 256, `N_EMBD` 2560 in `gdn_fused_t1.rs`, 12 QSA layers in
|
||||
`qsa_selected_kv.rs`); a different geometry means new kernels or re-sealing, not a constant change;
|
||||
- the tokenizer is pinned to the `qwen35` pre-tokenizer (`crates/tokenizer/src/lib.rs`), the chat template and reasoning wrap-up text are
|
||||
Qwen's, `<|im_end|>` is hard-coded as the stop token in places.
|
||||
|
||||
Turning those 17 constants into a `ModelGeometry` value threaded through the pool, residency, lookahead and seed code is mechanical but wide
|
||||
(M, 5-8 d) and must keep the Qwen path bit-identical (rerun the quality gate). It is only worth doing if we host DeepSeek in our own runtime;
|
||||
hosting `strata-dsv41` as an external worker (part 3) needs none of it.
|
||||
|
||||
## 2.4 Model-agnostic and model-specific parts
|
||||
|
||||
| Model-agnostic (reusable for a second MoE) | Model-specific (Qwen3.8-Flash-Next only) |
|
||||
|---|---|
|
||||
| Expert archive and file formats: KAR-2 container and codec, GGUF index/digests/sharding, `gguf_expert_file_source`, pack index | Attention: QSA indexer + sparse selection + KV layout (INT8 KV streaming) vs DeepSeek's 128-row sliding ring plus compressed FP4 KV and a lightning-style indexer (both have a top-k indexer, but the kernels differ) |
|
||||
| Tier machinery: VRAM slots, PCIe stream, CPU pool, residency table, lookahead, seed residency, ledger, adaptive tier policy, 4 KiB aligned copies, pinned arena plan (all take (layer, expert) ids and byte ranges; only the constants are Qwen's) | GDN (gated delta net, Qwen only); DeepSeek instead has hyper-connections (mHC, Sinkhorn) |
|
||||
| Streaming/prefill overlap scheduler | Router (512 experts, top 10) vs DeepSeek's sqrt-softplus biased top-6 of 384; shared expert |
|
||||
| Prefix cache and request-end checkpoints (policy, keys, eviction); the state **codec** is model-specific (Qwen: GDN states + KV; DeepSeek: window rings, compressor partials, compressed KV, about 17 MB per 6.5K tokens) | Head, embedding, vocabulary (248,320), sampler ABI |
|
||||
| Memory governor (`leleka-memory`), serving-policy, deploy, preflight, gateway (`control-plane`: HTTP surface, queue, supervisor, switching, MCP hub, auth) | Drafter: MTP depth-4 vs DeepSeek's DSpark; PLE table vs Engram (same reader pattern, different rows) |
|
||||
| Row-addressed n-gram table reader and row cache (PLE today, Engram tomorrow) | Tokenizer pre-tokenizer, chat template, tool-call format (Qwen `<tool_call>` vs DeepSeek DSML), reasoning budget, stop tokens |
|
||||
| Quality-gate machinery (`docs/quality-gate.md` harness, paired A/B scripts) | All fused kernels, PTX seals, MMQ/MMVQ tables, GDN chain kernels |
|
||||
|
||||
## 2.5 Recommendation
|
||||
|
||||
1. Do **not** make KAR the path to a second model. For DeepSeek the official 2-bit sets are smaller than KAR level 2 and already tiered by the
|
||||
upstream engine.
|
||||
2. Host DeepSeek as a second supervised worker (`strata-dsv41`) behind our gateway (part 3). The model-agnostic parts we own (gateway, memory
|
||||
governor, switching) are exactly what that needs; the tier machinery, Engram reader and kernels come with upstream's engine.
|
||||
3. If we later want a second MoE **in our runtime**, the first step is the `ModelGeometry` refactor above, validated by a bit-identical Qwen
|
||||
run, not KAR work. Keep KAR for what it is good at: level-selectable precision of Qwen3.8's PLE and (after a GPU check) experts.
|
||||
|
||||
---
|
||||
|
||||
# Part 3. The DeepSeek-V4.1-Flash engine (b)
|
||||
|
||||
## 3.1 Architecture as implemented (`src/dsv41/ds4_model.cu`, `ds4_kernels.cu`)
|
||||
|
||||
Imported from Project Maya `maya-ds4` v1.1.17 (MIT, `third_party/project-maya`) at `bbd0a2c6`, first built inside Strata at `453cc0d5`; 136
|
||||
commits in 5 days since; `src/dsv41` is 23.8 K lines (18.3 K in CUDA files), `tools/dsv41` 6.2 K lines of Python. Geometry comes from the
|
||||
pack's `ds4.txt`, nothing is hard-coded.
|
||||
|
||||
- 40 layers, 384 routed experts plus a shared expert; router sqrt-softplus with bias, top 6; `--experts N` takes the top N and renormalises
|
||||
(`3dd11c6d`). Default `auto`: 5 on 16 GiB of cards or less, or on a GPU that shares system RAM (`c4ce40bf`); 6 elsewhere (`ds4_experts_rule.hpp`).
|
||||
On a 32 GB 5090: 6.
|
||||
- Attention is not V3-style MLA (no kv_lora). Low-rank Q (`wq_a`/`wq_b`); one shared K=V row per token in a 128-slot sliding ring; learned
|
||||
sinks; layers with `compress_ratio > 0` also attend to up to 512 compressed rows chosen by an indexer over FP4 index keys. Layers 20-39 own
|
||||
no compressed KV and read the sharing layers' copies; the chunked prompt path exploits this by default (`8a7102ec`,
|
||||
`STRATA_DS4_PROMPT_SKIP=1`: layers 20-39 run only on the last 2,668 rows; the comment says exact up to summing order, mode 2 is lossy). Run
|
||||
our own parity check of mode 1 against 0 before trusting it.
|
||||
- Hyper-connections: `hc_mult` residual streams, `hc_mix`, Sinkhorn `hc_split`, `hc_post`; fused into one launch for decode (`60d856a1`).
|
||||
- Engram at layers 1 and 14 (see 2.1). KV: window ring FP8 E4M3 (UE8M0 scales per 32), compressed KV and index keys FP4 E2M1, about
|
||||
2.6 KB per token for saved slots. Default `--max-context` 32768 in the engine, 8192 written by setup (the size upstream checked). YaRN RoPE.
|
||||
- DSpark drafter: the checkpoint's `mtp.*` blocks (8 GB Q8_0), block drafts verified by min(1, p/q); `--dspark auto` loads it only where the
|
||||
experts nearly fit VRAM, so on a 5090 with a 121-155 GB set it will not load. `--dspark off` still loads it and costs about 7 GB VRAM.
|
||||
- Thinking on by default (effort low 50 / medium 62 / high 75 / max 100); tool calls are DSML (`serve/dsml.py`, 256 lines, rewritten into the
|
||||
Qwen `<tool_call>` text form for the shared parser). Vision tower exists, unused by the server in this version.
|
||||
|
||||
## 3.2 How it is served
|
||||
|
||||
- Binary `strata-dsv41` (a separate executable; upstream says a family switch inside `strata` comes later). Flags (`ds4_main.cpp`):
|
||||
`--pack`, `--gpus`, `--max-context`, `--reserve-mib`, `--vram-experts`, `--cpu-threads`, `--expert-profile`, `--ssd-cache GB`,
|
||||
`--ssd-policy lru|lfu|lfulru`, `--mmap-experts on|off|auto`, `--dspark`, `--dspark-conf`, `--dspark-block`, `--experts N|auto`, `--tp N`,
|
||||
`--prefill-chunk`, `--eos`, `--serve`, `--pack-info`, `--version`; offline `--score`, `--ids`, `--spec-eval`.
|
||||
- **Protocol: a compatible subset of the Qwen engine's stdin/stdout loop.** Requests `GEN <max_new> [k=v ...] ids`, `GENI`, `STOP`, `QUIT`;
|
||||
keys honoured: `temperature top_p top_k min_p seed spec dspark_conf pin dspark_cum` (penalties, `pcie_frac`, `cvec` silently ignored).
|
||||
Output: `READY <ctx> stop`, `T <id>`, `PP`, `STAT` every 8 tokens, `NOTE`, `ERR`, and a 10-field `DONE`. Upstream's Python `serve/server.py`
|
||||
drives it with only a family switch; `setup.py` writes `--pack --max-context 8192 --eos 1 --dspark auto [--dspark-conf 0.65]` and
|
||||
`"engine_ready_s": 3600`. One request at a time; displaced conversations are saved to RAM then disk (`ds4-slots`, 2 GB cap, one week).
|
||||
|
||||
## 3.3 Resource needs and speed (upstream's numbers)
|
||||
|
||||
| Item | Size |
|
||||
|---|---|
|
||||
| Sets 1.75 / 2.00 / 2.25 bpw | 121 / 138 / 155 GB |
|
||||
| Engram IQ4_NL (shared) / DSpark drafter | 111 GB / 8 GB |
|
||||
| Disk, three sets | 239 / 257 / 274 GB; pack about 6 GB; slots up to 2 GB |
|
||||
| UD-Q8_K_XL | 508 GB (experts 288.8, dense 16.8, Engram 202.8) |
|
||||
|
||||
Dense weights about 16 GB of VRAM on one card (UD set); RAM should hold the CPU-lane experts (under 40 GB "untested and slow"); Engram wants
|
||||
NVMe. Speeds: RTX 5070 12 GB + 64 GB RAM + 3.6 GB/s NVMe about 4.7 tok/s decode, 121-231 tok/s prefill; RTX 3060 12 GB + 46 GB about 8-10 tok/s;
|
||||
4x R9700 about 48 tok/s (2.00) and 80 (2.25). **No upstream measurement on a 5090.** Quality vs the original (4,995 positions): IQ1_M KL 0.217 /
|
||||
perplexity +21 percent, 2.00 KL 0.170 / +15.5 percent, 2.25 KL 0.107 / +7.3 percent.
|
||||
|
||||
## 3.4 GPU support
|
||||
|
||||
CUDA sm_120 is supported: default `CMAKE_CUDA_ARCHITECTURES 120`, packaging scripts build `86-real;120` (SASS for sm_86 and sm_120), CUDA 13
|
||||
needed for sm_120 (CMake warns below 13.0; feed minimum driver 580.65). The Windows build ran on an RTX 5070 and the Linux sm_86 build on an
|
||||
RTX 3060. On CUDA the IQ and MXFP4 prompt sets use nvcuda::wmma F16 tensor cores, token GEMVs use dp4a, dense prefill uses cuBLAS. The
|
||||
gfx11/gfx12 WMMA paths and the trellis WMMA are HIP-only (trellis falls back to FMA tiles on CUDA). No dsv41 path in `sycl/` or `metal/`,
|
||||
none for gfx906. The 16 GB laptop sm_86 card defaults to 5 experts; our memory notes say avoid long laptop GPU jobs.
|
||||
|
||||
## 3.5 Hosting it behind our gateway (cheapest first)
|
||||
|
||||
Our gateway supervises one stdio engine child (`control-plane/src/worker.rs`, `wire.rs`); model switching is an exclusive transaction
|
||||
(`service_switch.rs`, `scripts/strata-model-switch.py`), which suits a 32 GB card that cannot hold both models.
|
||||
|
||||
| Option | Work | Effort | Verdict |
|
||||
|---|---|---|---|
|
||||
| (i) `strata-dsv41` as a second switchable worker profile | ignore `STAT`/`NOTE` lines (`wire::parse_line` errors on unknown tags, 0.5 d); `deepseek3` pre-tokenizer in `crates/tokenizer` with parity vs HF tokenizers (2 d); load the GGUF Jinja template and port goldens (1-2 d); port `dsml.py` and its 60 tests, `tool_choice`, calls inside thinking (2 d); family plumbing: stop id 1, effort map, defaults, refuse penalties/images/cvec (1-1.5 d); live bring-up on the 5090 (1-2 d). `startup_timeout_s` already allows 3600 | **M, 7-10 d** | recommended; production stays Python-free |
|
||||
| (ii) upstream Python `serve/` as a DeepSeek sidecar | 0.5-1 d | S | violates "production serving independent of Python"; use only offline as an oracle for goldens |
|
||||
| (iii) Rust port of the engine | 23.8 K lines + 5.1 K vendor + ggml-cpu dependence; reusable from `cuda-driver`: driver, arenas, PTX pipeline, IQ2_S/IQ3_S/IQ3_XXS/IQ4_NL/IQ4_XS kernels; missing: IQ1_M/IQ2_XXS/IQ2_XS, MXFP4, FP8/FP4 KV, compressor, indexer, sparse attention, mHC, Engram I/O, RAM store, DSpark, TP, CPU lane | **L, 8-14 weeks**, chasing about 27 commits a day | not now |
|
||||
|
||||
Risks: lossy defaults to pin in any quality gate (`--experts`, `STRATA_DS4_PROMPT_SKIP`, DSpark acceptance, the 2-bit quants themselves);
|
||||
slot files are model state on disk (retention and privacy); 3600 s cold loads; one request at a time; unmeasured on a 5090.
|
||||
|
||||
---
|
||||
|
||||
# Part 4. New tools and features worth knowing (c)
|
||||
|
||||
Ranked by likely use to us:
|
||||
|
||||
1. `tools/quant_quality.py` + `data/quant_quality/v1` (committed `set.ids.json`): fixed code/docs/English/multilingual/agent set, teacher-forced
|
||||
top-64 log-probs, top-1 agreement, mean/p99 KL, perplexity. Directly usable as a quality-gate set; `strata-dsv41 --score` writes the same TSV.
|
||||
2. `tools/agent_turns_bench.py`: deterministic paired A/B over 23 coding-agent turns (2.5K-100K tokens, shared prefixes, mirrored arm order,
|
||||
fresh server per arm). Matches our "paired A/B on the same workload" rule.
|
||||
3. `tools/dsv41/smoke.py` (16-token "Paris" check) and `strata-dsv41 --pack-info`: cheap readiness gates.
|
||||
4. Signed update feed (`packaging/UPDATES.md`, `strata_control/update_keys.json`, `strata_control/dsv41_engine.py`): Ed25519 feed key signs
|
||||
`strata-feed.json` and every package manifest; client checks pinned key id, channel, expiry, sequence (anti-replay and anti-downgrade),
|
||||
archive SHA-256, manifest signature, every file hash, then a test start. Weak spot: the one-line installers (`install.sh`, `install.ps1`)
|
||||
check the Terminal archive only against a manifest from the same GitHub release folder, so the first install's root of trust is GitHub
|
||||
HTTPS plus the release account. Nothing was run.
|
||||
5. `strata_cli`: `launch [--plan --yes --no-tui]`, `tune`, `bench run|compare|report`, `timeskip`, `components verify`, `doctor`, `update`;
|
||||
`tests/tuning` has a stub engine and session worth copying for testing our supervisor; `tests/time_skip` has negative tests that insist a
|
||||
missing check never becomes a pass (a model for our gate state machine).
|
||||
6. **Windows** (relevant to the laptop): `START-HERE.bat` / `SETUP.bat` bootstrap Python and run setup. A source build needs Visual Studio 2022
|
||||
(C++20; nvcc silently drops `-std=c++20` under VS 2019, #3566; CUDA 13.0-13.2 rejects VS 2026). `packaging/build_dsv41_windows.bat` uses
|
||||
CUDA 13.0, `86-real;120`, static cudart, needs `STRATA_GGML_DIR` (pinned llama.cpp `3cf03257`), produces a 66 MB exe. No Windows CUDA build
|
||||
script exists for the Qwen engine except through `setup.py`; `packaging/build_cuda_linux.sh` is the Linux reference.
|
||||
7. `apps/host` (Node server + TypeScript/Vite UI on 127.0.0.1:8791 driving Python Control on 8080: model catalog, downloads, monitor, agents,
|
||||
tunnels) and `apps/desktop` (Tauri shell): not relevant to our gateway. SYCL (`sycl/`, Intel Arc) and Metal (`metal/`, Apple Silicon): Qwen
|
||||
only, no DeepSeek. `tools/trellis`, `tools/dflash2`: research.
|
||||
|
||||
---
|
||||
|
||||
# Part 5. Compatibility with our artifacts and deploy flow (d)
|
||||
|
||||
| Area | Status |
|
||||
|---|---|
|
||||
| `serve/chat_template.jinja`, `serve/chat_golden.json`, `tests/data/native_experts/*.txt`, `LICENSE`, `serve/mcp_fake_server.py` (all `include_str!`'d or used as goldens by `control-plane`) | unchanged upstream; our Rust tests are unaffected |
|
||||
| Native pack (`native_experts.txt` v3/v4), `tools/mtp_rt.py`, `mtp_pack.py`, `pack_index.py`, `src/core/mtp.cpp` | unchanged layout; `mtp.cpp` adds opt-in flags only. v5 plus `hadamard.txt` is only for Hadamard-folded packs. `iq_pack` now keeps IQ3_XXS/IQ4_XS PLE keys native instead of BF16 (`035da7f8`): our `native_pack.rs` would diverge on such models; resumable `experts.bin` writes (`970c75c8`) |
|
||||
| `tools/mtp_fetch.py` | rewritten for multi-connection SHA-pinned downloads (`e193161d`, `96a9107a`); output layout not checked, our `mtp_fetch.rs` mirrors the old script |
|
||||
| Expert profiles (`data/expert-profile*.bin`) | the engine now refuses a header version other than 1 (`536db01a`); the layout is the same, so ours are fine |
|
||||
| KAR archives | upstream has no KAR; the local patches are re-applied (docs/upstream.md); GPU behaviour of the KAR arms is unverified on the merged tree |
|
||||
| GGUF shards | no format change; the engine now identifies the family by name and reads geometry from metadata (`f812e9a1`, `51329cff`); all-zero `compress_ratios` treated as absent (`94d189fc`); `tools/gguf_reader.py` +4 lines, not read |
|
||||
| Tokenizer | ids for ordinary text unchanged; `plain=` spans change ids only for messages containing control-token or think-tag text (`f346dc6b`, `f13a870d`; the bug in 1.4 item 5) |
|
||||
| Engine serve protocol | backward compatible: new optional `GEN` keys (`logit_bias`, `ckpt`, `pin`, `pipe`, `aux_cpus`, `img_keys`) are skipped by the engine when unknown; `DONE` has trailing fields (our `parse_done` reads the first 10); `INFO` starts with `logit_bias=1` (we ignore it). **Risk:** `control-plane/src/wire.rs::parse_line` errors on any unknown tag. A new engine run with `--batch`, session files or `/v1/vram` emits `BT`, `BDONE`, `BADM`, `YIELDED`, `BSTAT`, `PSTAT`, `VRAM`, `SAVED`, `RESTORED`, `SERR`, `SWAIT`, `FATAL`, `SESSION`, and our worker would break. Do not enable those without extending `wire.rs` |
|
||||
| CLI flags | none of the 132 flags the old parser matched was removed; 48 added. Defaults changed as in 1.3 |
|
||||
| Engine config `"args"` | a single entry `"--flag value"` is now split into two (`8101a890`); `--reasoning-effort` in args is lifted into a top-level key (`a6ae2475`); new `user_args` and `pool_cores` keys; not compared against our `config.rs` |
|
||||
| `SamplerParams` ABI | `logit_bias` (pointer) and `gumbel` (bool) added (`dcc6f756`, `6381df34`); porting the new `sampler.cu` breaks our checked 64-byte ABI |
|
||||
| Deploy flow | `scripts/build-cpu.sh` had to list 11 more test targets (done). Upstream's new defaults (1.3) change behaviour of any upstream-built engine, so do not swap it into the deploy profile without the explicit old-behaviour switches. Upstream's `docker-entrypoint.sh` moved to `docker/entrypoint.sh` |
|
||||
|
||||
---
|
||||
|
||||
# Part 6. Build plan for the new Strata CUDA engine with `strata-dsv41` on the 5090 server (NOT RUN)
|
||||
|
||||
Assumptions: Linux, RTX 5090, CUDA 13.2.2 at `~/cuda-toolkits/13.2.2`, driver at least 580.65, 38 GB free of 260 GB disk. **Nothing below was
|
||||
executed, and nothing may be downloaded until disk exists.** Sizes and times are estimates.
|
||||
|
||||
1. NOT RUN. Pinned llama.cpp for ggml-cpu (about 100-300 MB): `git clone https://github.com/ggml-org/llama.cpp ~/src/llama.cpp && git -C ~/src/llama.cpp checkout 3cf03257f219afbe7334045ff7c6a06ac68c627d`
|
||||
2. NOT RUN. Export the merged tree with LF endings and a build id: `git -c core.autocrlf=false archive <our-commit> engine/strata | tar -x -C ~/work/strata-src --strip-components=2 && echo <9-hex> > ~/work/strata-src/BUILD_ID` (the dsv41 binary must carry a build id, `--version` prints "unknown" otherwise)
|
||||
3. NOT RUN. Configure out of tree (build dir about 2-4 GB for one arch and the dsv41 targets; ccache optional):
|
||||
```
|
||||
export PATH=~/cuda-toolkits/13.2.2/bin:$PATH
|
||||
cmake -G Ninja -S ~/work/strata-src -B ~/work/build-dsv41 -DCMAKE_BUILD_TYPE=Release \
|
||||
-DSTRATA_ENABLE_CUDA=ON -DSTRATA_BUILD_DSV41=ON -DSTRATA_NATIVE_EXPERTS=ON -DSTRATA_BUILD_TESTS=OFF \
|
||||
-DCMAKE_CUDA_ARCHITECTURES=120 -DCMAKE_CUDA_COMPILER=$HOME/cuda-toolkits/13.2.2/bin/nvcc \
|
||||
-DCUDAToolkit_ROOT=$HOME/cuda-toolkits/13.2.2 -DSTRATA_GGML_DIR=$HOME/src/llama.cpp
|
||||
```
|
||||
Do not add `STRATA_CUDA_STATIC=ON` for the first build (static cublasLt is several hundred MB and links slowly; the `-static-libstdc++` flag
|
||||
applies to `strata` only). `STRATA_PORTABLE=ON` is what upstream packages use; leave it off for a native build. The `ds4_*` test targets
|
||||
are gated on `STRATA_NATIVE_EXPERTS`, not on `STRATA_BUILD_TESTS`.
|
||||
4. NOT RUN. Build only what is needed (estimate 15-40 min at `-j8`: `ds4_model.cu` is a 9.4 K-line unit): `ninja -C ~/work/build-dsv41 -j 8 strata-dsv41 ds4_slot_test ds4_experts_rule_test ds4_pick_rule_test ds4_iq_test ds4_tq_test ds4_gg_bench`
|
||||
5. NOT RUN. No model, no GPU: `strata-dsv41 --version`, `ds4_slot_test`, `ds4_experts_rule_test`, `ds4_pick_rule_test`, `ds4_gg_bench`.
|
||||
6. NOT RUN. One GPU, no model: `ds4_iq_test`, `ds4_tq_test`.
|
||||
7. Blocked by disk: `--pack-info` needs a real pack (no tiny pack exists upstream). The 2.00 set needs 257 GB (138 + 111 + 8) plus about 6 GB
|
||||
for the pack; even 1.75 needs 239 GB. With 38 GB free nothing fits: a dedicated NVMe of at least 300 GB (512 GB preferred) is required,
|
||||
because Engram wants NVMe. RAM 121 GB holds the 1.75 set's CPU-lane experts; the 2.00 set is tight.
|
||||
8. Packing is offline Python: `python tools/dsv41/pack_gguf.py --model SET --shards ... --engram engram-IQ4_NL.gguf --engram-meta <UD shard 1> [--dspark-gguf ...]`;
|
||||
do not add `--skip-tensors` or `--dense-override` (upstream: they pack without error and give garbage text).
|
||||
|
||||
---
|
||||
|
||||
# What was not read
|
||||
|
||||
- Most of the ~11.7 K-line `generate.cpp` diff (only options, the `GEN` parser, protocol prints, tail-skip and PcieAuto blocks), most kernel
|
||||
bodies, `expert_source.cpp`/`prefill.cpp`/`verify.cpp` beyond sampled sections and the merge hunks; `serve/server.py` and `strata_control/`
|
||||
beyond subjects and one diff; `setup.py` policy changes against `setup_policy.rs`; `tools/gguf_reader.py`; the `mtp_fetch.py` rewrite; the
|
||||
DFlash2 and SPEC_COST code; `src/qwen35`; HIP, SYCL, Metal; `bench/results`.
|
||||
- DeepSeek: only focused ranges of `ds4_model.cu` (9.4 K lines); not the DSpark draft/verify bodies, TP all-reduce, store zero-copy paths,
|
||||
vision or the split-KV attention; per-layer `compress_ratios`, `hc_mult`, `index_topk` and the Engram n-gram values come from GGUF
|
||||
metadata and were not seen; the IST-DAS per-tensor types beyond "IQ1_M/IQ2/IQ3 experts, Q8_0/Q5_K dense"; the expert activation clamp;
|
||||
`apps/host` server modules (names only); `install.ps1` in full; `docs/AI_SETUP.md` and `AI_REFERENCE.md` (upstream's agent instructions,
|
||||
not followed).
|
||||
- Our side: `original_serve_*` and `kar_expert_source.rs` were read for constants and structure, not audited; the KAR GPU path was not run.
|
||||
- The size arithmetic in 2.2 is ours from block sizes (KAR level 2 = 10 bytes per 32 weights) and upstream's per-expert size; the DeepSeek
|
||||
expert weight count (about 35.4 M) is derived from "18.8 MB of MXFP4 at 17 bytes per 32".
|
||||
- Nothing upstream was executed: no script, installer, binary, or model. No model was downloaded and the 5090 server was not touched.
|
||||
- The merged subtree's CUDA objects were compiled for sm_86 only (see docs/upstream.md), never run.
|
||||
+136
-12
@@ -1,20 +1,135 @@
|
||||
# Strata upstream provenance
|
||||
|
||||
**Status:** source imported as a local Git subtree and preserved in a private hosted repository.
|
||||
**Status:** `engine/strata/` was brought to upstream `41cf05a0` (engine 0.1.50, app 0.2.5) on 2026-10-25 on branch
|
||||
`claude/upstream-sync`, with the local patches re-applied. The previous pin (`d9ab8435`, engine 0.1.35) is kept below and in Git
|
||||
history (`570201a:engine/strata`). Nothing was pushed. The quality-gate reference build (`stra169-ladder` Original) stays a build of the
|
||||
OLD pin plus the old local patches; the new subtree is not that reference (see "What this does to the quality reference").
|
||||
|
||||
## Current pin
|
||||
|
||||
| Field | Value |
|
||||
| --- | --- |
|
||||
| Upstream repository URL | https://github.com/Niko1221/Strata.git |
|
||||
| Upstream commit SHA | `d9ab8435f654c368c586340d490915f6addf56a3` |
|
||||
| Upstream commit SHA | `41cf05a06a25dd29103b7b27a2279a3f60c21876` |
|
||||
| Upstream commit date | 2026-10-25 11:35 +0100 ("README (all 7 languages): models in the order Qwen3.8-Flash-Next, Qwen3.6-35B-A3B, DeepSeek V4.1-Flash") |
|
||||
| Upstream version at the pin | engine and Control 0.1.50, Terminal and app 0.2.5 (`1aff6d14`, 2026-10-24) |
|
||||
| Upstream tree object of the pin | not recorded (the subtree is the pin plus local patches and omissions; the exact differences are listed below) |
|
||||
| Local repository path | `engine/strata/` |
|
||||
| Update date | 2026-10-25 |
|
||||
| Update method | documented tree replacement: 3-way `git merge-tree` of the old subtree against the new upstream, base = the old pin (see "How this update was made") |
|
||||
| Hosted project repository URL | https://github.com/paveldhq/strata-next (private) |
|
||||
| Import date | 2026-10-02 |
|
||||
| Engine build instructions | `scripts/build-cpu.sh` for source checks; CUDA build still to validate on Linux GPU |
|
||||
| Local patch strategy | Squashed Git subtree; preserve upstream commit IDs in subtree merge messages |
|
||||
| Engine build instructions | `scripts/build-cpu.sh` for source checks (needs network once: it fetches llama.cpp `3cf03257f` through CMake FetchContent); CUDA builds: see `deploy/README.md` and `docs/build-validation.md`. Upstream's `packaging/build_cuda_linux.sh` and `packaging/build_dsv41_cuda.sh` are the reference recipes and have not been run here |
|
||||
|
||||
The local Git remote `strata-upstream` points to the URL above. To review an update, run `git fetch strata-upstream main`, inspect the diff from the pinned SHA, choose a specific new commit, then run `git subtree merge --prefix=engine/strata --squash <chosen-SHA>` and the relevant checks. Do not silently advance to whatever happens to be latest.
|
||||
## Pin history
|
||||
|
||||
The imported upstream tree includes its own small optional experimental control-vector GGUF and reference data. Production model weights, captures, and generated output remain outside this repository. The private project repository was created on 2026-10-04; its initial `main` is `858e7aa050f56b051dac5e3d7b765a05cb958aee`. This preserves the existing subtree history and does not change the pinned upstream identity.
|
||||
| Pin | Upstream commit | Date | Engine | In this repository |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 1 (initial import) | `d9ab8435f654c368c586340d490915f6addf56a3` | 2026-10-02 | 0.1.35 | `engine/strata/` up to `570201a` (git subtree merge `c4e2137` of squash `906afc5de9dd` in the pre-squash history; later squashed into `4013e0c`) |
|
||||
| 2 (this update) | `41cf05a06a25dd29103b7b27a2279a3f60c21876` | 2026-10-25 | 0.1.50 | `engine/strata/` on `claude/upstream-sync` |
|
||||
|
||||
**Upstream rewrote its history.** `d9ab8435` is not an ancestor of upstream `origin/main` (`git merge-base --is-ancestor` fails). Its
|
||||
tree is identical (`git diff` is empty, tree `487c4cc0`) to upstream commit `5b734e42` ("Engine 0.1.35", same date), which is an
|
||||
ancestor of `41cf05a0`. So the real distance from the old pin to the new one is 3630 commits (`git rev-list 5b734e42..origin/main`), not
|
||||
the 4175 that `git rev-list d9ab8435..origin/main` prints. Both SHAs identify the same source tree; record both when comparing.
|
||||
|
||||
The local Git remote `strata-upstream` points to the URL above. Do not silently advance to whatever happens to be latest: choose a
|
||||
specific commit, fetch it, review the diff from the pin, and update this file in the same commit.
|
||||
|
||||
## How this update was made (repeat it the same way)
|
||||
|
||||
The pre-squash `git subtree` metadata does not exist in this repository's history (the project history was rebuilt from snapshots),
|
||||
so `git subtree pull` has nothing to anchor on. The update therefore used a tree replacement that still keeps a true 3-way merge:
|
||||
|
||||
1. In a scratch clone of upstream: `base` = tree of the old pin, `ours` = `git rev-parse 570201a:engine/strata` (the old subtree with
|
||||
the local patches), `theirs` = upstream `41cf05a0`.
|
||||
2. `git merge-tree --write-tree --merge-base=<base> <ours> <theirs>`; conflicts were resolved by hand (below); the result was checked by
|
||||
listing every blob that differs from upstream `41cf05a0` (only the 21 patched files, the 4 added files and the left-out files differ).
|
||||
3. The result tree went into `engine/strata/` with `git read-tree --prefix=engine/strata/ -u` (`core.autocrlf=false`, LF kept), then the
|
||||
left-out files were removed from the index and the working tree.
|
||||
4. `docs/upstream/local-patches-on-0.1.35.patch` is the patch that was re-applied (old pin to old subtree, 25 files);
|
||||
`docs/upstream/local-patches-on-0.1.50.patch` is the same patches as they stand on the new pin (new pin to new subtree, 25 files).
|
||||
The next update should treat the second file as its `ours` side: the merge base is then `41cf05a0`.
|
||||
|
||||
## Local patches (as re-applied, 2026-10-25)
|
||||
|
||||
All of them are default-off or build-profile only. None changes the default behaviour of the engine.
|
||||
|
||||
| Local patch | Files | Status after the update |
|
||||
| --- | --- | --- |
|
||||
| `STRATA_CUDA_STATIC` CMake profile (static CUDA toolkit libraries and GNU C++ runtime, Linux; STRA-23, `a36e45a`) | `CMakeLists.txt` | Re-applied. Added `OR STRATA_HIP_GFX906` to its refusal condition (upstream added a gfx906 compat build that also sets `STRATA_ENABLE_CUDA`). Upstream's own tests that link `CUDA::cudart` directly are not switched to the static target (as before) |
|
||||
| `STRATA_NEXT_EXPERIMENTAL_KAR_EXPERTS`: native verifier cache-miss callback to the external `gpu/kar` component (`87fdec7`, `53c9d7b`, `33f075f`, `b6563e3`) | `CMakeLists.txt`, `include/strata/core/expert_source.hpp`, `src/core/expert_source.cpp`, `src/program/generate.cpp` | Re-applied. The callback now runs before the CPU-work scan so `any_cpu` sees what is left; a completed row (`kind == 3`) is excluded from the new zeroing, offload-count and peer-count rules. Compiles (sm_86 objects, with `STRATA_NEXT_KAR_DIR=gpu/kar` of this repository); never run, and not exercised against upstream's new device-plan and route-tail-skip paths |
|
||||
| Experimental KAR PLE CPU quality arm and compressed GPU row cache, PLE row trace (`80f6670`, `e4d0c2d`, `36e512a`, `78e92d5` telemetry) | `include/strata/kernels/ngram.hpp`, `src/kernels/ngram.cpp`, `src/prefill/prefill.cpp`, `src/program/generate.cpp`, `CMakeLists.txt` | Re-applied on top of upstream's table-driven PLE formats (`fmt->dequant`, recursive mutex, `wait_prefetches`). The GPU-cache arm lands its rows through upstream's new `ple_land` path. Compiles with `STRATA_NEXT_EXPERIMENTAL_KAR_PLE=ON` and `STRATA_NEXT_EXPERIMENTAL_PLE_TRACE=ON` (sm_86 objects); never run |
|
||||
| Keyless V-only QSA arm (`a8411b5`; failed its quality gate, see `docs/experiments/2026-10-04-keyless-runtime.md`, `docs/keyless-runtime.md`) | `include/strata/core/keyless.hpp`, `src/core/keyless.cpp`, `src/kernels/cuda/keyless.cu`, `src/kernels/keyless_parity.cpp` (new files), plus `layer.cpp/.hpp`, `verify.cpp/.hpp`, `prefill.cpp`, `src/prefill/kernels.cu`, `kv_q8.cu`, `kv_stream.cu/.hpp`, `qsa_decode_attn.cu/.hpp`, `kv_stream_parity.cpp`, `conversation_snapshot.cpp/_test.cpp`, `mtp.cpp`, `generate.cpp` | Re-applied by hand (see conflicts). Needs `STRATA_KEYLESS_ROUTING` and `--kv int8`; refuses K8V4 and the new fused norm+rope; no slots / rows attention variant (falls back to per-query calls) |
|
||||
| Mode bits | `setup.sh` | The 0644 mode our 2026-10-14 snapshot (`7f896a8`) set on `setup.sh` and `docker-entrypoint.sh` is not carried: `setup.sh` is 0755 as upstream; upstream deleted `docker-entrypoint.sh` (it is `docker/entrypoint.sh` now) |
|
||||
|
||||
Other commits that touched `engine/strata` in the pre-squash history (`b1da05f` first-window logits capture, `78e92d5` telemetry) are
|
||||
either not part of the tracked snapshot at `570201a` or are the telemetry line listed above; `git grep` for the capture finds nothing in
|
||||
`570201a:engine/strata`, so nothing was lost by this update.
|
||||
|
||||
### Conflicts and how they were resolved
|
||||
|
||||
Content conflicts (15 files, 44 hunks) and one modify/delete. Everything else in the 25 patched files merged cleanly.
|
||||
|
||||
| File | Conflict | Resolution |
|
||||
| --- | --- | --- |
|
||||
| `CMakeLists.txt` (4) | STATIC option next to upstream's new gfx906 block; PLE/KAR targets next to upstream's new gfx1100 score test; `strata_engine` source list (upstream added `remote_expert_opt.cu`, `dflash2`, `peer_experts`, `vmm`, ...); `strata` link options next to upstream's Windows HIP delay-load and the whole `strata-dsv41` block | Union. `keyless.cpp` added to upstream's longer `strata_engine` source list. `STRATA_CUDA_STATIC` refuses `STRATA_HIP_GFX906` |
|
||||
| `kv_stream.hpp` | Our `kKvValueInt8 = 4` against upstream's new `kKvHybrid = 3` (K8V4 streaming) and its two helper functions | Both: `kKvF16=0, kKvInt8=1, kKvQ4=2, kKvHybrid=3, kKvValueInt8=4` |
|
||||
| `layer.hpp` | `qsa_kv_format()`: our hard refusal of hybrid state vs upstream's `kKvHybrid` | Upstream's hybrid line first, then ours for `without_key`. The old "hybrid never reaches the block movers" exit is gone because it is now false |
|
||||
| `kv_stream.cu` (2) | `runs_of()` and `kv_block_bytes()` | Chain `kKvHybrid`, `kKvValueInt8`, `kKvQ4`, `kKvInt8` |
|
||||
| `kv_q8.cu` | `is_v` computation vs upstream's `MULTI` template parameter | `k_q == nullptr \|\| (MULTI ? (z & 1) : z == 1)`. With keyless + `kv_append_q8_steps` the grid is 2 x tokens and both halves write the same V (redundant, correct) |
|
||||
| `qsa_decode_attn.cu` (4) | Upstream split the dispatch into `launch_chunks_batch`, `launch_merge_batch`, `qsa_decode_attn_slots`, `qsa_decode_attn_batch_rows`, added lane-cell/gfx906/`attn_v3`/daily variants | Took upstream's structure; `attn_kv_mode()` knows mode 4; mode 4 is dispatched in `launch_chunks_batch` and `qsa_decode_attn_step`; lane-cell is disabled for it; the slots variant returns false and the rows variant goes per row so they fall back to the per-query calls |
|
||||
| `verify.hpp` / `verify.cpp` (7 hunks) | Our keyless trace members and query routing against upstream's new fused norm+rope, `side_proj`/`q_chain`, `mm()` helper, `collect_profile()`, `launch_o->finish()` | Query routing moved into `norm_rope_on` (between norm and RoPE, all callers go through it); `fuse_nr` is off for keyless; K projection and K norm skipped for keyless; trace members renamed `kl_trace_*` because upstream already owns `trace_h_` (found only by compiling: a clean textual merge produced a duplicate member); the trace writer was re-added after the window's synchronize |
|
||||
| `layer.cpp` (3) | `qsa_layer` is one giant line; upstream dropped `n_bid`/`width` and re-wrapped the gemv lines | Upstream's text with our `without_key` guards re-inserted |
|
||||
| `expert_source.cpp` (2) | KAR miss callback vs upstream's `dec_batch`/`gpu_zeroes_hits`/`any_cpu`/`kind == -2` tail skip | Callback first, then upstream's block; kind 3 handled as above |
|
||||
| `ngram.cpp` (5) | KAR PLE vs `PleFormat` table, `std::recursive_mutex`, `wait_prefetches()` | Upstream's format table; KAR decode and cleanup kept under their macro; `close()` waits for prefetches first; `format()` falls back to `fmt->name` |
|
||||
| `prefill.cpp` (3) | PLE gpu-cache branch vs upstream's `ple_land`, `C`, pageable PLE ring | GPU-cache branch gathers on the device; else upstream's code |
|
||||
| `generate.cpp` (9) | Includes, options struct, keyless trace check vs upstream's host-core / pool-cores / aux-cpus / memory-guard blocks, KAR PLE open vs the new direct-read probe, `Drive` setup, request keys, serve-loop epilogue | Union; the PLE direct-read probe is skipped for the KAR PLE arm |
|
||||
| `kv_stream_parity.cpp` (2) | `append()` and the format name | Both formats |
|
||||
| `expert_source.hpp`, `verify.hpp`, `kv_stream.hpp` | adjacent member / enum additions | Union |
|
||||
| `docker-entrypoint.sh` | modified (mode only) by us, deleted by upstream | Deleted (upstream moved it to `docker/entrypoint.sh`) |
|
||||
|
||||
### What this does to the quality reference
|
||||
|
||||
`engine/strata/` on this branch is a different engine from the one the `stra169-ladder` Original was built from: with default flags it
|
||||
behaves differently from the old pin (upstream flipped defaults on: route tail skip, PcieAuto, sm_120 and sm_86 kernel sets, fused int8
|
||||
prompt experts, auto conversation cache; see `docs/upstream-digest-2026-10-25.md`). Do not use a build of this subtree for the greedy/tensor
|
||||
baselines of `docs/quality-gate.md`. The old pin remains reproducible from `git show 570201a:engine/strata` and from the upstream tree
|
||||
`487c4cc0` (upstream commit `5b734e42` / `d9ab8435`). Anything compared against the new subtree must set the old behaviour explicitly
|
||||
(the digest lists the switches).
|
||||
|
||||
## Left out of the subtree (rule: weights, captures, credentials, logs, media and generated artifacts stay out of Git)
|
||||
|
||||
Upstream content at `41cf05a0` that was not committed (2140 files in total; everything else in the upstream tree is committed byte for byte).
|
||||
The root `.gitignore` already drops `*.bin`, `*.gguf`, `*.log` and `models/`; the rest was left out by the rules below.
|
||||
|
||||
| Group | Files | Why | Where it is |
|
||||
| --- | --- | --- | --- |
|
||||
| New `bench/results/**` (community benchmark runs: request captures `requests/*.json.gz`, `*-request.json` prompts, engine logs `*.log`, monitor screenshots, build recipes, fixtures) | 2022 added | request captures and logs; 23 MB; the 162 older files of that directory that the first import carried are unchanged | upstream `bench/results/` |
|
||||
| Binary media and assets added by upstream | 61 | `apps/desktop/src-tauri/icons/**` and `nsis/*.bmp` (app icons), `apps/host/public/**` (favicons, three GT Walsheim Pro `*.woff2` commercial fonts, an example gif/mp4/pdf), `docs/terminal-previews/*.png` (7), `docs/media/*.png` (2), `docs/media/models/*` | upstream |
|
||||
| `docs/work/evidence/**` | 24 | test-run transcripts and JSON self-test output (logs) | upstream |
|
||||
| Model-adjacent binaries that the root `.gitignore` also matches | `data/dsv41/profile-2.00.bin`, `profile-2.25.bin` (hot-expert profiles for the DeepSeek packs), `data/draft_vocab_fr.bin`, `data/expert-profile-sycl.bin`, `tests/fixtures/dsv41/engram-final-header.gguf` | binary data files; needed only to run the DeepSeek engine or its SYCL path | upstream |
|
||||
| Already left out by the first import and still left out | `data/draft_vocab.bin`, `data/draft_vocab_cyrillic.bin`, `data/draft_vocab_en.bin`, `data/expert-profile.bin`, `data/expert-profile-coder.bin`, `data/experimental-speed-projection/*.gguf`, `bench/results/2026-09-30-community-rtx-5090/engine.log` | same rule | upstream |
|
||||
|
||||
Kept on purpose although they look large: `apps/host` and `apps/desktop` source (TypeScript / Rust text; 8 MB), `tools/qwen35/pictures/*.png`
|
||||
(three small test inputs), `docs/work/*.md`, `bench/prompts/**` (frozen benchmark prompts, hashed byte for byte), `sycl/`, `metal/`,
|
||||
`packaging/` (installer scripts, text), `third_party/` (ggml-tq headers, Project Maya license and notice). A scan of every kept blob found
|
||||
no private key, token or credential pattern. The kept scripts and installers are source only; none of them was run.
|
||||
|
||||
Consequences to know: `data/dsv41/profile-*.bin` must be fetched from upstream if the DeepSeek engine is ever built from this tree;
|
||||
`apps/host`, `apps/desktop` and the packaging flow will not build from this tree without the left-out icons and fonts. Neither is used by
|
||||
Leleka. Also, upstream's own `AGENTS.md` and `docs/AI_SETUP.md` tell an agent to run installers and `strata launch --yes`; they are
|
||||
upstream's instructions for its product and do not apply to work in this repository.
|
||||
|
||||
## Verification of this update
|
||||
|
||||
| Check | Result |
|
||||
| --- | --- |
|
||||
| Tree identity: every blob of `engine/strata/` compared with upstream `41cf05a0` | identical except the 21 patched files + 4 new files (and the left-out files) |
|
||||
| `git diff --stat` for line-ending churn | none (LF kept, `core.autocrlf=false`; the nested `.gitattributes` of the subtree sets `eol=crlf` for `*.bat/*.cmd/*.ps1` as upstream does) |
|
||||
| `scripts/build-cpu.sh` in WSL Ubuntu 24.04, GCC 13.3, CMake 3.31.6 | 16 of 16 ctest tests pass (the script's target list had to be extended: upstream registers 11 more CPU tests than the old pin; `Not Run` otherwise) |
|
||||
| CUDA compile (sm_86 only, `nvcc` 13.2, no GPU use) of the patched translation units: `kv_q8.cu`, `kv_stream.cu`, `qsa_decode_attn.cu`, `keyless.cu`, `prefill/kernels.cu`, `prefill.cpp`, `layer.cpp`, `verify.cpp`, `expert_source.cpp`, `mtp.cpp`, `conversation_snapshot.cpp`, `keyless.cpp`, `ngram.cpp`, `generate.cpp`, `kv_stream_parity.cpp`, `keyless_parity.cpp` | all 17 objects compile (warnings only) in the default configuration; the 7 objects that depend on the KAR/PLE macros (`ngram.cpp`, `expert_source.cpp`, `prefill.cpp`, `generate.cpp`, `kar_ple_cache.cu`, `kar_expert.cu`, `kar_expert_miss.cpp`) also compile with `STRATA_NEXT_EXPERIMENTAL_KAR_PLE=ON`, `STRATA_NEXT_EXPERIMENTAL_KAR_EXPERTS=ON`, `STRATA_NEXT_EXPERIMENTAL_PLE_TRACE=ON`. The compile found one error a textual merge cannot (a duplicate `trace_h_` member in `verify.hpp`), fixed by renaming ours to `kl_trace_*`. Not built: link, the `strata` binary, the parity tests, the sm_120 PTX |
|
||||
| GPU parity, quality gate, any model run | not run (by instruction); the keyless, KAR and PLE arms are default off and unexercised |
|
||||
| Port crates that `include_str!` files from `engine/strata` | none of those files changed upstream (`LICENSE`, `serve/chat_template.jinja`, `serve/chat_golden.json`, `tests/data/native_experts/*.txt`, `serve/mcp_fake_server.py`, `tools/mtp_rt.py`) |
|
||||
|
||||
## Local CUDA validation, 2026-10-04
|
||||
|
||||
@@ -24,6 +139,8 @@ V-only streaming and conversation snapshots passed. Pretrained-model quality
|
||||
failed; see [the report](experiments/2026-10-04-keyless-runtime.md). The ordinary
|
||||
K+V profile remains the production choice.
|
||||
|
||||
(That validation was on the 0.1.35 sources; it has not been repeated on the merged tree.)
|
||||
|
||||
## Local Linux packaging profile, 2026-10-04
|
||||
|
||||
STRA-23 adds the default-off `STRATA_CUDA_STATIC` CMake profile: static toolkit
|
||||
@@ -34,6 +151,8 @@ candidate still needs host glibc 2.43 and an NVIDIA driver; model qualification
|
||||
is pending. See `deploy/README.md` and `docs/build-validation.md` for the exact
|
||||
scope, artifact identity and remaining packaging limits.
|
||||
|
||||
(Re-applied on the 0.1.50 `CMakeLists.txt`; the ELF audit has not been repeated.)
|
||||
|
||||
## Experimental KAR expert integration, 2026-10-05
|
||||
|
||||
The pinned upstream commit remains unchanged. Local default-off
|
||||
@@ -45,10 +164,15 @@ environment settings, validates the archive payload and expert geometry, and
|
||||
rejects unsupported pool/multi-device configurations. This is an experimental
|
||||
quality arm, not full compressed-model residency or a qualified speedup.
|
||||
|
||||
(Written against the 0.1.35 sources; re-applied on 0.1.50, see the table above.)
|
||||
|
||||
## Port provenance, 2026-10-25
|
||||
|
||||
`engine/strata/` is unchanged since the import recorded at the top of this file (the Original used as the quality reference and for the
|
||||
vanilla baselines is a separate build of that commit plus the local patches above). The Leleka runtime under `crates/`, `desktop-core/` and
|
||||
`control-plane/` is a Rust/CUDA port of the Original mode17 serve path written for this project; it shares the model artifacts and the
|
||||
algorithms (not the C++ code) with Strata. The agreement of the port with the Original is measured in `docs/quality-gate.md`; the request-end
|
||||
prefix checkpoints (`docs/prefix-cache.md`) and the chain kernels (`docs/chain-kernels.md`) are port-side additions with their own gates.
|
||||
The Leleka runtime under `crates/`, `desktop-core/` and `control-plane/` is a Rust/CUDA port of the Original mode17 serve path written
|
||||
for this project; it shares the model artifacts and the algorithms (not the C++ code) with Strata. The Original used as the quality
|
||||
reference and for the vanilla baselines is a separate build of the OLD pin (`d9ab8435` / `5b734e42`, engine 0.1.35) plus the local
|
||||
patches that were in `engine/strata/` before this update; `engine/strata/` itself is no longer that source. The agreement of the port
|
||||
with the Original is measured in `docs/quality-gate.md`; the request-end prefix checkpoints (`docs/prefix-cache.md`) and the chain
|
||||
kernels (`docs/chain-kernels.md`) are port-side additions with their own gates.
|
||||
|
||||
A digest of what changed upstream and what is worth taking is in [upstream-digest-2026-10-25.md](upstream-digest-2026-10-25.md).
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user