Commit Graph
10 Commits
Author SHA1 Message Date
Niko1221 5bafbe3bcd engine(cpu): the 4-row dot kernels are the default from two tokens per expert call, off for one token (#7075, #6552)
0.2.21 made the dot_x4 kernels of the native CPU expert path opt-in
(STRATA_DOT_X4=1) because a single-thread cold bench showed them slower on a
DRAM-bound row.  #7075 measured the other side (2x RTX 5090, PCIe-streamed
NVFP4, 4 slots): without them warm batched decode lost ~15% and short prompt
reads ~8% against 0.1.66, and STRATA_DOT_X4=1 recovered both, while solo
decode (one token per expert) was better with them off.

The default now follows the call, as the reporter suggested and the reply on
the issue promised: on from kDotX4MinTokens = 2 tokens that share the expert in
one call, off for one token.  STRATA_DOT_X4=1 forces them on for every call,
STRATA_DOT_X4=0 off for every call (exactly the 0.2.21 / 0.2.22 default),
STRATA_NO_DOT_X4 (any value) still wins.  The two forms give the same bits:
dot_x4_test, and cpu_dispatch_dump hashes of every nt 1..8, whole and off-vector
row ranges, both arithmetics, identical for off / default / on / NO_DOT_X4
(zz_x4_proof.sh); pool_determinism passes in all three modes.

dot_x4_policy.hpp: dot_x4_mode() (read once) and dot_x4_enabled(mode, nt);
dot_x4_policy_test covers every case.
2026-11-26 23:04:57 +01:00
Niko1221 8ada71145d rc1: merge f-0221-qperf (66f2ee2b0: the 4-row dot kernels of the native expert path are opt-in, #6552) 2026-11-23 21:21:21 +01:00
Niko1221 66f2ee2b0a perf(cpu): the 4-row dot kernels of the native expert path are opt-in (#6552)
4414c2988 (0.2.20) put the dot_x4 kernels in front of the 1-row dots in native_gu_rows /
native_down_rows (Q4_K, Q5_K, Q6_K, Q8_0, IQ4_XS, IQ3_XXS ...), on by default. They give the
same bits (dot_x4_test) and share the activation loads, which pays with the weights in cache.
A cold expert is read from DRAM, and there the 4-row form is slower. New dot_x4_bench (one
thread, 512 MiB of rows, n = 2560), x4 speed against four 1-row calls:
  Ryzen 7 255 (Zen 4, AVX-512 VNNI)  Q4_0 0.77  Q8_0 0.42  Q4_K 0.26  Q5_K 0.33  Q6_K 0.24  IQ4_XS 0.27  IQ3_XXS 0.52
  Ryzen 5 5600X (Zen 3, AVX2)        Q8_0 0.85  Q4_K 0.29  IQ4_XS 0.32
  i9-13900K (AVX-VNNI)               Q8_0 1.20  Q4_K 0.86  IQ4_XS 0.80
  (cache-resident: 0.8 - 1.3 everywhere)
This is the #6552 reporter's Ryzen 7 7700 (STRATA_NO_DOT_X4=1 brought the old speed back).

dot_x4_enabled() (strata/quant/dot_x4_policy.hpp): STRATA_DOT_X4=1 turns the kernels on,
STRATA_NO_DOT_X4 (any value) still turns them off and wins. The answers are the same bits either
way. dot_x4_policy_test covers the rule; dot_x4_bench is registered as an executable only.
2026-11-23 21:21:03 +01:00
Niko1221 c25b0fdddd inkling2 CPU backend: AVX2 / AVX-512 / NEON dense dot, and matmul parallel over the weight rows
The q / k / v / o / gate projections of the CPU backend (matmul_f32) were `parallel for` over the activation rows with `if (M * N >= 4096)`: a one-token decode step
ran most of them on ONE thread, and a prompt read every weight row M times from memory. They are parallel over the weight rows now (threshold on M * N * K), each row is
read once and reused for all M activation rows from L1; every y[m][n] is the same dot call as before, so the result does not depend on the thread count.

The dot itself (CPU backend, attention scores, inkling2_loop.cpp's helpers) is strata::quant::sk::dot_f32, one more function of the run-time tiers: 4 accumulators of the
tier's vector width (AVX-512 / AVX2 with FMA / NEON), plain 4-accumulator C++ in the base tier (bit-identical to the sum it replaces: sk_tier_test checks it). The vector
tiers sum in lane order, so a CPU-only run differs from 0.2.20 by float rounding (SQ-10 teacher-forced KL(old||new) 4e-4, repeatable run to run).

Measured, CPU backend, SQ-10 prefill 128 / decode 8, alternating pairs: Apple M5 Max prefill 3.2 -> 7.7 ppts, decode 1.6 -> 2.5 tok/s (spread under 1 %);
Zen 4 16 threads, UD-Q2_K_XL: prefill 11.1 -> 13.0, decode 2.7 -> 4.3.
2026-11-23 20:09:19 +01:00
Niko1221 7aaa789a94 feat(nextgen): apply NextGen integration across engine, qwen35, hy4flash, and inkling2 2026-11-22 13:12:57 +01:00
Niko1221 9c862f9822 strata-inkling: unified HF safetensors + GGUF loaders, Graph-Doorbell NUMA offload, and Dual-GPU EP
Unify official Hugging Face safetensors (thinkingmachines/Inkling-2-Mini + mtp.safetensors
+ vision) and community/Unsloth GGUF checkpoints (UD-Q4_K_XL, IQ3_S, IQ4_NL, IQ4_XS, Q4_K,
Q5_K, Q6_K, Q8_0, MXFP4, NVFP4, split multi-shard, and external dspark GGUF/safetensors)
directly inside strata-inkling while keeping native .strata v1.1 (SQ-20/15/10 + Vision)
as the flagship recommended default.

- Zero-requantization official HF safetensors adapter (ink_safetensors_loader.h): maps
  NVFP4 L0..19 straight to SF4 (code_id=15), MXFP8 L20..23 straight to MX8 (code_id=16),
  BF16 dense trunk, 3x loop-weighted vram_load_order, mtp.safetensors DSpark drafter,
  and model.visual.* vision weights (ink_vision.h).
- Community / Unsloth GGUF adapter (ink_gguf_loader.h): supports both llama.cpp master
  (GGUF_shard_rewrite) and PR #32187 layouts, split multi-shard GGUFs, bit-exact
  NVFP4 -> SF4 nibble-desplit repack, lossless SkCode::GGUF_RAW (id=20) native block
  dispatch across CPU and CUDA, full-array 200K o200k tokenizer + chat_template export,
  and Unsloth dspark-*.gguf (dflash arch) 54-tensor mapping.
- Ported PR #6520 CUDA-Graph mapped-memory doorbell + NUMA-aware AVX-512/AVX2 CPU expert
  worker pools + decayed-use background promotion (hybrid_doorbell.{h,cu}) and --kv
  k8v8|k8v4 KV compression (ink_batch.h, hybrid_doorbell.cu).
- Ported PR #6506 Dual-GPU Expert Parallelism (--gpus 2 / --ep-split / IK2_EP_SPLIT)
  with P2P / pinned fallback and native SF4/MX8/S_K/GGUF_RAW GPU kernels
  (ep_dual_gpu.{h,cu}) in modular non-conflicting files.
- Wired multi-format detection, community HF sources, local import args, and HF o200k
  tokenizer loading into terminal/setup.py, terminal/strata_cli/launch/catalog.py,
  terminal/tools/strata_tokenizer.py, and terminal/serve/test_inkling_formats.py.
- Preserved original MIT copyright headers (Project Maya, Baptiste Rajaut, merbanan,
  cobra91) and documented contributor credits for 0.2.19 release notes.
2026-11-21 22:22:51 +01:00
Niko1221 1f5f53e140 inkling2: add standalone strata-inkling v1.1 engine, 1..64 batching, vision, and serving
Add .strata v1.1 reader/codecs (SF4, MX8, paired 2-row S_K, vram_load_order), standalone strata-inkling shape-engine binary with 1..64 continuous slot batching (FP16/FP8 paged SWA-1024 + Global KV, compact ShortConv pool, DSpark speculative verify with exact per-step ShortConv rollback), 23-layer Vision ViT shard support, o200k tokenizer + ignore_merges, Jinja generation tag extension, InklingOutputParser, and StrataEngine parallel=64 integration.
2026-11-21 20:27:58 +01:00
Niko1221 f37add3afb [Quant] Fix H64 symmetric Hessian transform, add MACaQ-R compensation, Q8-INT8 Engram, and CUDA S4_K warp kernel 2026-11-19 00:45:14 +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