Commit Graph
44 Commits
Author SHA1 Message Date
Niko1221 759ccf6c68 fix(engine): harden hy4 vcache headroom, inkling2 Metal/HIP/SYCL/CUDA guards, GGUF layout, and CMake checks 2026-11-23 01:10:33 +01:00
Niko1221 5ea521afe4 Wire RDNA2-4 HIP Unsloth WMMA/DP4A dispatch, v_perm LUT16, and settings register 2026-11-22 20:02:36 +01:00
Niko1221 4414c29887 Optimize Unsloth CPU SIMD quant kernels and all-tier VRAM/RAM planning
Vectorize quantize_q8_K across AVX2, isolated AVX-512, and ARM64 NEON; optimize cold-expert dot and dot_x4 kernels (Q4_K, Q5_K, Q6_K, Q8_0, IQ4_XS, IQ3_XXS, IQ3_S) with 0 EVEX zmm leakage in AVX2 TUs; add #4870 coverage-based adaptive cache defaults (2/192/0.92 for 15%-65% coverage) and heterogeneous Unsloth slot sizing in generate.cpp; add #6354 auto int8 KV + elastic --kv-resident, 4/6 GB discrete unlock, and full discrete/UMA tier planner + test suite.
2026-11-22 19:10:57 +01:00
Niko1221 53f59c0640 engine: fix Windows WDDM VRAM paging, sm_89 defaults, gfx1200/RDNA4 crashes & NaNs, sm_70 V100 kernels, and MSVC CUDA LNK2005
- Windows WDDM VRAM safety floor & post-cache shrink (#6128, #5915): join warm_gemm_libraries before sizing, enforce per-tier WDDM discrete free-VRAM floors (>=1280 MiB >=16 GB, >=960 MiB 10-12 GB, >=640 MiB 6-8 GB, >=448 MiB 4 GB; opt-out STRATA_WDDM_VRAM_FLOOR=0), raise legacy --vision --vram-reserve-mib 700, reserve 384 MiB late-alloc headroom on WDDM, and include mtp_bind + prefill_mib + late_alloc in both sized_slots and post-memset shrink with 0 slack so Driver 595+/621.01 never pages VRAM to host RAM.
- Prefill chunk cap & sm_89 / multi-GPU tiny-cache fixes (#5199, #6509, #6208, #6431, #6583): keep bare --prefill auto at 8192 on <=16.5 GiB NVIDIA GPUs so prompt loans do not cannibalize hot expert slots; remove regressive STRATA_L2_PF=1 and conflicting STRATA_QFUSE=1 from sm_89 Ada defaults; extend tiny-cache (<25% resident) swap dampening and 25% Zipf-head pinning to multi-GPU layer splits.
- RX 9060 XT / gfx1200 RDNA4 fixes (#6254, #6526, #5162, #6127, #5649, #5718): serialize warm_gemm_libraries on Windows HIP to avoid amdhip64_7.dll/rocblas.dll cold-boot 0xC0000005; default DEBUG_HIP_DYNAMIC_QUEUES=0 before first HIP call (opt-out STRATA_HIP_DYNAMIC_QUEUES=1); use __builtin_memcpy in RDNA4 load_int_b2 and hoist Q6KTraits scales into registers to avoid gfx1200 NaNs; add STRATA_VERIFY_TIMEOUT_S (30s HIP default) with one-shot flag re-publish grace.
- Volta sm_70 opt-in bitwise kernels (PR#6603 STRATA_GR_V70, PR#6604 STRATA_Q8_V70) + PR#6505 cudaGetDevice error checks.
- Windows MSVC CUDA LNK2005 fix: default CMAKE_CUDA_RUNTIME_LIBRARY=Shared on MSVC across engine/cmake/backends/cuda.cmake and engine/src/inkling2/CMakeLists.txt so strata.exe and strata-inkling.exe link cleanly without cudart_static.lib/cudart.lib collisions.
2026-11-22 17:22:37 +01:00
Niko1221 adab4d45e0 Merge branch 'f-0220-new-issues' into f-0220-int 2026-11-22 16:24:45 +01:00
Niko1221 5f6c45ff95 hip: guard gfx1103 hipBLASLt auto-table on cwsr_enable!=0 and fall back on pre-launch error (#6574) 2026-11-22 15:11:59 +01:00
Niko1221 ddca992850 Merge branch 'f-0220-nextgen' into f-0220-int
# Conflicts:
#	engine/src/hy4flash/run/hy4_gpu_model.hip.h
#	engine/src/hy4flash/run/hy4_main.hip.cpp
#	engine/src/inkling2/cuda/ink_hybrid.cuh
#	engine/src/inkling2/cuda/ink_runner.cuh
#	engine/src/inkling2/hip/ink_hip_backend.hip.cpp
#	engine/src/program/generate.cpp
2026-11-22 15:05:59 +01:00
Niko1221 1f6bd2d34b feat(ssd-stream): add 3-tier NVMe streaming and first-class GPU+SSD & CPU+SSD modes 2026-11-22 14:51:40 +01:00
Niko1221 534802c8dc engine: integrate #6406, #6529, #6550, #6523 and fix #6515, #6431, #6462, #6423, #6417, #6493, #6533, #6470 2026-11-22 13:23:13 +01:00
Niko1221 7aaa789a94 feat(nextgen): apply NextGen integration across engine, qwen35, hy4flash, and inkling2 2026-11-22 13:12:57 +01:00
Niko1221 00dd0cdc6a hip: fix unified CI build for dflash2, nvfp4_decode_sm120 stub, and strata-inkling Win CRT 2026-11-22 04:53:47 +01:00
Niko1221 d1f409140c Merge f-0219-sm120: Blackwell sm_120, Ada sm_89, and Ampere sm_86 Flash-Next optimizations 2026-11-22 04:19:02 +01:00
Niko1221 ce2a51b2eb cuda/prefill: add MIT sm_120a/121a dense_fp4_tc and upgrade moe_fp4_tc v4 2026-11-22 02:27:43 +01:00
Niko1221 d3b59978e7 Merge f-0219-rdna3: RDNA3 gfx1100-1151 WMMA, PF_F16=2, WDDM coherent, and OCuLink optimizations 2026-11-22 01:39:46 +01:00
Niko1221 431a26db11 cuda/cpu: sm_120 & sm_86 prefill, decode, DFlash2 TC, and default stack optimizations
Add clean-room MIT Blackwell (sm_120) and Ampere (sm_86) speedups for Qwen3.8-Flash-Next across IQ3_S, UD-Q4_K_XL, and NVFP4 with zero quality loss (STRATA_ROUTE_TAIL_SKIP=0; force_check.py PASS -0.042 pts, 0 events):

- Prefill pipeline & CPU pool:
  - Warm CUDA GEMM libraries at init to remove cold cuBLAS stall (2.4-3.8x faster TTFT).
  - Pre-pin cpu_x/cpu_rows/cpu_ones + dedicated async cpu_x_stream D2H and ExpertPool::run_range parallel native_quant_act (host grouping 81->7 ms on RTX 5090, 114->16 ms on RTX 3090).
  - Parallelize in-memory PleTable::gather_batch across up to 8 threads and skip per-row madvise syscalls when --ple-io ram already faulted pages (eliminates ~40 ms FP8 PLE stall on NVFP4).
  - Upgrade x86 AVX-512 VNNI dot_nvfp4_q8_0 to mul_sum_i8_pairs_float and register ENTRY(NVFP4, Q8_0, nvfp4_q8_0) (138-147 GB/s CPU pool BW; quant_selftest PASS).
  - Optimize sm_120a/sm_121a mxf4nvf4 MoE prefill v3 (NT=256, single-pass TR=64, coalesced loads, 0 spills, 1.37x at T=8192).
- Decode & DFlash2 verification:
  - Add clean-room sm_80+ BF16 Tensor Core DFlash2 attention (2.1x faster attention, -0.10 to -0.20 ms/round drafting).
  - Fix native_mmvq launch_multi chunking (>8 cols, 0 cuda_spill_guard spills) and keep interleaved native_mmvq_il for ncols 1..8 while routing ncols 9..16 to dense_i8_tc (with WARPS=1 small-N specialization).
  - Hoist Split<TG>::load outside NTC loop in native_gu_fused_kernel and extend to Q4_K, Q5_K, and NVFP4; add opt-in coalesced sm_120a nvfp4_decode_sm120 (STRATA_NVFP4_DEC_SM120=1) and opt-in vhead_bitplane (STRATA_VHEAD_BITPLANE=1) with out_nonfinite support.
  - Default sm_80+ Q8_0 HC to exact-FP32-activation gr_down_q8_fast + gr_up_q8_fast (0 KLD loss; opt-in INT8 TC via STRATA_HC_Q8_TC=1/2).
- Defaults & tests:
  - Enable verified sm_120 and sm_86 defaults in nv_defaults.cpp (with STRATA_VERIFY_DEVICE_HITS=1 + auto pcie_frac=0 on >16 GiB single-GPU cards, preserving ADAPT_FETCH=2 on <=16 GiB cards) and update nv_defaults_test.cpp.
2026-11-21 23:10:29 +01:00
Niko1221 d31256b79d rdna3: Phase 3 CU-safe/WDDM-safe WMMA DFlash2, rdna_gr, rdna_mmvq, and GDN megakernel 2026-11-21 21:31:25 +01:00
Niko1221 34b82b5409 rdna3: Phase 1 WDDM coherent alloc, gfx1100-1151 defaults, and AVX512BW+VNNI ZMM dots 2026-11-21 21:31:24 +01:00
Niko1221 e78cd033ca cuda: add clean-room bit-plane LM head, INT8 TC dense GEMM, and mxf4nvf4 v2 2026-11-21 20:39:07 +01:00
Niko1221 b60658cae5 hip: first-class Radeon 780M (gfx1103) and Strix Point (gfx1150) iGPU support with UMA coherent GTT allocation and <=1s TDR/MES guards 2026-11-21 19:58:13 +01:00
Niko1221 a14c910fe6 Engine: rebase MIT sm_120a/sm_121a mxf4nvf4 prefill and partial-VRAM device hit planning onto 0.2.18 2026-11-21 19:48:39 +01:00
Niko1221 8601e766b3 Merge f-hy4-int (Hy4-Flash Strata side and runner base) into the 0.2.18 branch 2026-11-20 00:15:23 +01:00
Niko1221 de17f306f7 Merge f-hy4-run (933b9bfd3: Hy4-Flash .strata reader, S_K codecs, Engram reader, gfx1151 runner) into the 0.2.17 release candidate
The merge is clean: every file of f-hy4-run is new on top of the candidate except
engine/include/strata/artifact/model_family.hpp (+6) and engine/cmake/backends/quant.cmake (+3).
2026-11-19 20:51:34 +01:00
Niko1221 ca99e886f7 STRATA_ADAPT_FETCH=2 is the default on compute capability 12.x CUDA cards with 16 GiB of memory or less
RTX 5050 / 5060 / 5060 Ti / 5070 / 5070 Ti / 5080 and the laptop parts. A card with more memory,
and every other vendor and architecture, keeps it off. A value the user sets (0 included) always wins;
STRATA_ADAPT_FETCH=0 is the way back, STRATA_SM120_PERF=0 and STRATA_DEFAULTS=026 leave it out with the
rest of the sm_120 table.

The switch is read once per process and only a one-card run uses it (a layer split, helper cards, a peer
tier and --batch turn it off), so the engine's main card (STRATA_PRIMARY_DEVICE) decides; its memory is
cudaDeviceProp::totalGlobalMem, read without making a context.

BW-9, 2x RTX 5060 Ti 16 GB, UD-Q4_K_XL, tail skip off, product flags, 3 paired rounds: decode +4 to +43%
by kind (medians 1.087 to 1.325), expert cache hit rate 54.4 -> 62.0%, forced-token KL against the FP16
prompt path 0.948 [0.830, 1.063] of the default's, prompts level except json 169 at +3 to +5%.

The start-up line of the sm_120 defaults names it and says it is not bit-exact; the lines that say the
switch cannot run in a given start (a layer split, --batch, ...) say the default is not used there.
Unit test adapt_fetch_default_test (the card rule, the table, apply_nv_defaults with the user's value,
the off switches); settings register: status default.
2026-11-19 19:22:00 +01:00
Niko1221 c9ac62833f CUDA tests: check_cuda_spills_unit runs from the repository root (tools/ left engine/ in the 0.2.16 layout move; the test failed with 'No module named tools' since 0.2.16) 2026-11-19 16:54:10 +01:00
Niko1221 4a409b919b Serve: the first request's free-VRAM note is said only when the free memory fell since the start-up line or is under 512 MiB (item 17)
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.
2026-11-19 16:24:56 +01:00
Niko1221 902ea23283 CPU pool: STRATA_POOL_DEP is on by default (the per-expert dependency queue of a native layer call); STRATA_POOL_DEP=0 is the way back
BW-G measured it bit-exact (BASE-05 27 of 27, pool_determinism --reps 20, 124,656 checks) with the CPU pool's window -2.9% on an RTX 5090 + EPYC box.
ExpertPool's constructor reads the variable once: unset or anything but "0" is on. Not under the NUMA split and not for Q2_0 down rows, as before.
A second ctest, pool_determinism_dep_off, runs pool_determinism with STRATA_POOL_DEP=0 so the way back stays covered.
2026-11-19 16:23:12 +01:00
Niko1221 cb60135e78 Gyro-L AVX2 pair-trellis rows: the fast form of #5873 is opt-in (STRATA_TQP_AVX2_FAST=1)
Follow-up to the #5873 port (author Ante042; the fast kernel and the state unpack are the PR's code, kept as
rows_tqp_fast_t and tq_states_tqp_fast). The PR claims 2.3 to 2.8x per thread. Our paired A/B on a Ryzen 5 5600X (the same Zen 3
family as the PR's 5800X; GCC -O2, the real tq_rows through a harness, 7 interleaved pairs) gave identical output hashes for
types 147, 148 and 149 at 1 and 4 tokens, but no gain: 1 token 1,023 us (147) before, 1,178 us after (0.87x, slower in 7 of 7
pairs); 4 tokens 1,378 before, 1,328 after (1.04x, faster in 6 of 7). So by the rule for speed items the fast form is a switch, OFF by
default: unset, the rows are the ones before (pairs8, the scalar state function); STRATA_TQP_AVX2_FAST=1 selects the PR's form.
The PR measured with MSVC on Windows, where the old code may compile worse; we have not repeated that. Two ctest entries
(tqp_cpu_test_fast, tqp_cpu_test_avx2_fast) run the existing bit-for-bit test with the switch on. The name is in the settings
register (status research).
2026-11-19 16:19:27 +01:00
Niko1221 dee9d83572 AVX-only builds: IQ4_NL PLE rows are unpacked with two 128-bit byte shuffles per block (#5830)
From PR #5830 (aktalascloud; its commit cbeeec003), author kept. In the experimental older-CPU build (STRATA_ISA_FLOOR=avx, a CPU with
AVX and no AVX2) the IQ4_NL PLE rows were unpacked one scalar value at a time. Under __AVX__ without __AVX2__ the unpack
now uses two _mm_shuffle_epi8 per block (same split-half order, same FP16 scale multiply, so signed zero and non-finite
scales come out the same), and the CUDA / HIP CMake file compiles ngram.cpp with -mavx -mno-avx2 -mno-fma -mno-f16c (or
/arch:AVX) in that build so the code is live. Builds with the default AVX2 floor, and every other CPU, are untouched.
Our paired A/B (Ryzen 5 5600X, the real iq4nl_dequant_row compiled twice with -mavx -mno-avx2, 7 interleaved pairs): 67.0
ns per 160-value row before, 16.7 after (4.0x, after faster in 7 of 7), and the output hash over all 65,536 fp16 scale
encodings with random codes is the same in both arms. The PR's own number: 157.08 to 53.53 ns on a Xeon E5-2697 v2.
2026-11-19 16:19:27 +01:00
Niko1221 d37776eeaa CPU tests: the container quota plan, a pool-plan matrix and the affinity-mask guard (#6189, #13, #14)
From PR #6189 (FluxNimbusAi; its commit ff3d1e645), author kept; tests only, no engine code. PR #14 fixed a dangling else in the
Linux affinity read (every CPU id outside the mask re-appended all of hardware_concurrency(), so a 16-of-1024 mask
returned 16143 CPUs, issue #13), but nothing guarded it. New cgroup_quota_plan_test reads a container quota from
fake cgroup mounts (v2, v1, hybrid) and feeds it into plan_pool_workers: 13.6 CPUs on a 64-core machine gives 12
workers, an unreadable quota leaves the count at its pre-cgroup value (never a collapse to 1), q == n does not clamp.
pool_plan_test gains the quota x affinity x reserve x cap goldens, and pool_affinity_linux_test pins the test process to
k allowed CPUs and requires get_thread_affinity to return exactly those, refusing the old blown-up count by name. The
three targets pass on the Linux CPU build here (cpu-check and cpu-check-native, 0 failed; p1006 job in the gate table).
2026-11-19 16:19:24 +01:00
Niko1221 3a772dad17 Windows HIP: the engine executables are long-path aware, so hipBLASLt's Tensile files load from a long folder (#4691)
From PR #4691 (tobitege; its commit bf3ef2584), author kept. On Windows a HIP engine installed under a long folder
could fail to open hipBLASLt's Tensile kernel files and stop in getAlgosFromIndex (0xC0000005, reproduced on
gfx1151 with the packaged tuning table at a 273-character path; Windows long paths were already on). The Windows
HIP build uses clang's GNU-style driver, so the MSVC-only manifest helper does not run for it. engine/cmake/
hip_backend.cmake now embeds strata-utf8.manifest into every HIP executable (an INTERFACE target with
/MANIFEST:EMBED and /MANIFESTINPUT, tracked as a link dependency), and the manifest gains longPathAware next to
the UTF-8 code page. Author's check: the hipBLASLt gemm test at the long path, 4 cases pass with 4 tuned launches
and 0 fallbacks (it stopped before).

Not taken from the PR: its hc_persist_parity.cpp hunk (Windows setenv): the file already maps setenv and unsetenv
to _putenv_s on Windows.
2026-11-19 16:19:16 +01:00
Niko1221 30156e2432 one-read top-k: the sampling stride doubles past 524,288 cells instead of failing every query (#5201)
From PR #5201 (D-Ogi; its commit 3ea40c9c4), author kept. block_topk_sample_kernel samples every 32nd block into a
4096-key buffer; a row with more blocks (past 524,288 cells) flagged every query as failed before reading anything,
and the wide six-read kernel took the second half of a 1M-token prompt. The stride (ts) now doubles while the
samples do not fit, up to 128 (2M cells); it depends on nb only, so it is the same for the whole CTA. The
candidate budget, the threshold and the emit are unchanged, so the ids stay the reference's. For rows of 524,288
cells and less ts is 32, as before.

Test: qsa_topk_active_parity sizes its score rows by each case's context and gains 8 cases (524,284, 524,288,
600,000 and 1M cells, odd query counts, ties); a new ctest, qsa_topk_active_parity_sample, runs all of them with
STRATA_TOPK_SAMPLE=1 on any CUDA card. The PR's CMakeLists hunk went into engine/cmake/strata_gpu_engine.cmake,
where the test is now defined. Author numbers (RTX 4090): top-k of 256 queries at 250,001 blocks 1.60 to 0.52 ms,
ids identical.
2026-11-19 16:19:16 +01:00
Niko1221 f5936798d0 Merge f-fix-speed (FIX-SPEED) into f-eng-0163 2026-11-19 16:18:59 +01:00
Niko1221 88b8578c3b Merge f-fix-eng (FIX-ENG) into f-eng-0163 2026-11-19 16:18:56 +01:00
Niko1221 87d20b7cc8 Merge f-tailskip-engine (engine: STRATA_ROUTE_TAIL_SKIP off when unset) into f-eng-0163 2026-11-19 16:18:53 +01:00
Niko1221 29ca1fca37 Merge f-bw-e (BW-E: CPU prompt share, VNNI rows) into f-eng-0163 2026-11-19 16:18:53 +01:00
Niko1221 76195455f4 Tests: the parallel-conversion test is built and run by the CPU build (tools/check cmake-cpu)
The split engine's CMake tree is only configured with STRATA_BUILD_SPLIT, so split_convert_parallel_test
(#5800) did not run in any default check. It needs only gguf.cpp and POSIX mmap, so it is registered
in the CPU test list (cmake/backends/cpu.cmake, UNIX only) instead of in src/split/CMakeLists.txt.
2026-11-19 14:14:38 +01:00
Niko1221 a9a00cd48e CPU expert rows: STRATA_ROW_PF=<bytes> requests the weights a few rows ahead (opt-in, off by default)
The Q4_K / Q5_1 / Q8_0 row loops of native_gu_rows / native_down_rows can request the next rows of the expert while the current row is computed (row_prefetch.hpp; t0 / t1 / nta hint, a prologue for the first rows). It reads and writes nothing: the results are the same bits. On a 22-worker pool over a cold 6 GB arena it moves the layer call by at most 2.5% (0.389 to 0.379 ms), so it stays off.

Adds bwg_pool_bench: the pool's own run_split_multi_native on UD-shaped synthetic experts (Q4_K gate/up, Q5_1 / Q8_0 down), cold or hot arena, optional MADV_HUGEPAGE, a hash of the outputs.
2026-11-19 12:33:39 +01:00
Niko1221 de7ba14078 Verify window capture: an error an earlier call left pending is said and cleared, not blamed on the capture's first launch (#5636)
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).
2026-11-19 11:36:29 +01:00
Niko1221 5152c03663 --batch-mtp: the slot's own draft counters reach the response (#5890)
With --batch-mtp the proposals are checked in the slot windows and were counted only in the engine's totals and its log, so every response of a batch-path
request read timings.draft_n = 0 and draft_n_accepted = 0 (and last_timings) while /metrics and the log showed real drafting; users read it as "MTP is off".

Each batch slot now counts the proposals its windows checked and kept (both the serial and the pipelined group path), and its BDONE line ends with
` drafts=<checked>:<kept>` (nothing is added for a slot that checked none; an older server ignores the key). The server's _apply_bdone adds them to the admission's
DONE counters, which feed the response and the per-request record.

Tests: terminal/serve/test_parallel.py BatchDraftCounters (fake engine with --drafts: the response record reads them; without the key it reads as before),
engine/src/program/bdone_drafts_test.cpp (the text).
2026-11-19 11:09:13 +01:00
Niko1221 301a452657 CUDA: the gated shared-expert combine rounds its product on its own (#5100)
nvcc does not know `#pragma clang fp contract(off)`, so in native_moe.cu's combine<GATED> the shared expert's product `shared[col] * g` was fused into
the add (`sum = fma(shared, g, sum)`, one rounding), while the comment, and shared_expert_multi's scale_rows store followed by the ungated combine,
round the product first. STRATA_LFUSE is on by default, so the default path took the fused form. The product is now `__fmul_rn(shared[col], g)` on CUDA
(the pragma stays for HIP, where clang reads it); the same guard on the three other unguarded pragmas (verify_kernels.cu gdn_q8_1_store,
iq_kernels.cu s26_swiglu_q8_1_kernel, which also rounds its product by hand now, as swiglu_q8_1_entries_kernel does). No more nvcc #20199-D warnings.

Test: tests/cuda/native_moe_gated_test.cu, the gated combine against a scale-rows store followed by the ungated combine, bitwise, synthetic data.
RTX PRO 5000 (sm_120): 3,898 of 15,360 outputs differ before the change, 0 after.
2026-11-19 11:09:13 +01:00
Niko1221 461b94b43a CPU experts: AVX-512 VNNI multi-token rows for UD-Q4_K_XL (Q4_K gate/up, Q5_1 and Q8_0 down)
The Q4_K gate/up rows had no 512-bit tier in the default build (the quant layer's Avx2 contract, one token at a time), and the Q5_1 / Q8_0 down rows had a
256-bit VNNI tier per token.  kq_avx512.cpp runs the integer part of every block on vpdpbusd (Q4_K: 64-byte vectors, the 6-bit scales through vpdpwssd) with the
weights decoded once per row for every token of a group, and keeps the AVX2 contract's float chain (the eight-lane accumulator, the mins term, the hsum) so each token's
row is the one-token dot's bit for bit.  Dispatch only on a CPU with AVX-512 F/BW/VL/DQ/VNNI/VBMI (cpu_avx512_ok); the old rows stay the fallback; kq512_ok checks the
rows against the build's own dot on first use and sends a mismatch back to it; STRATA_NO_KQ512=1 never takes them, STRATA_KQ512_MIN=N moves the token floor (gate/up 3, down 2).

kq512_parity (840 cases: 1 to 160 tokens, real and raw-byte activations, row ranges, the SwiGLU of the gate/up rows) is bit-equal on a Xeon 8352V and skips (77) without
AVX-512.  One thread, 256 rows, Xeon 8352V: Q4_K n=2560 8 tokens 113 us against 182 us for the dot per token and 125 us for the AVX2 multi-token rows, 64 tokens 767 / 1474 / 1054;
Q5_1 n=640 8 tokens 44 / 122 / 78; Q8_0 40 / 67 / 48; one token is slower than the dot (Q4_K 68 against 38 us), hence the floors.
2026-11-19 10:26:21 +01:00
Niko1221 9624759956 Engine: STRATA_ROUTE_TAIL_SKIP is off when it is not set, on every backend (for 0.1.63)
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.
2026-11-19 08:53:27 +01:00
Niko1221 a2b5af0b6d [Engine] Add native Hy4-Flash .strata v1.0 codecs, reader, 4-module Engram, and tools/squant pipeline 2026-11-19 00:38:14 +01:00
Niko1221 4058aa782b Layout move for 0.2.16: the top level becomes app/, engine/, terminal/, docs/, tools/ and .github/
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.
2026-11-17 13:19:21 +01:00