Commit Graph
766 Commits
Author SHA1 Message Date
Niko1221 bd075a3a88 inkling2/sycl: DFlash 2 is opt-in on SYCL for 0.2.23 (--draft on or STRATA_INK_DRAFTER=dflash2) until a resident card has measured it
p1006 (Arc A750, hybrid) with the shipped mix file: acceptance 70 to 90 percent, greedy tokens equal to plain on all six prompts, also in the
exact mode. The default rule (residency veto, plain steps from 2048 tokens on a hybrid load) is in. No resident Battlemage card has run it
yet (the B70 workflow measures it), so the default stays off; kSyclDflash2DefaultOn = true switches it on.
2026-11-27 08:23:42 +01:00
Niko1221 8c86eb9538 inkling2/metal: DFlash 2 is off on Metal for 0.2.23 (the port accepts no draft token and changes greedy output on long documents)
Measured on the M5 Max (SQ-20, the c1 prompts, 4K / 8K / 16K documents): with the shipped
mix file AND with the original bf16 file the drafter offers drafts and none is accepted
(0 of 64; the engine's own spec check: drafted 40, emitted 62 in 63 steps, same
fingerprint for both files), decode is 11 to 18 percent below plain, and greedy tokens
differ from the no-drafter run on the 8K and 16K documents (also in the exact mode).

kMetalDflash2Available = false keeps the port in the tree but never loads it: plain
decode is the tip's, the DSpark gate is the tip's, and --draft on /
STRATA_INK_DRAFTER=dflash2 print one line ("DFlash 2 is not available on Metal in this
release") and decode without a drafter. The mix loader and the memory rule stay for the
next release.
2026-11-27 08:23:42 +01:00
Niko1221 99037019a9 inkling2/sycl: namespace of to_lower_ascii in the drafter rule 2026-11-27 08:23:42 +01:00
Niko1221 acb86ea168 inkling2/metal: the one drafter rule for DFlash 2 (residency veto at load, plain steps by context on a paged model), the load prints what it took
- unified memory: the model is resident while what the process holds, the drafter (about 1.1 GiB plus 43 MiB a slot) and 4 GiB for the system fit in the
  machine's memory; otherwise the default drafter is not loaded (strata/core/ink_draft_rule.hpp, one line printed); --draft on or
  STRATA_INK_DRAFTER=dflash2 loads it anyway
- draft_plain_now(): on a paged model a step from 2048 tokens on is plain
2026-11-27 08:23:42 +01:00
Niko1221 c3341564ca inkling2/sycl: the one drafter rule for DFlash 2 (residency veto at load, plain steps by context on a hybrid load), the widened file counted in the memory plan
- the expert placement asks strata/core/ink_draft_rule.hpp with the real expert bytes: DFlash 2 is not loaded when it would move the model off full
  residency or take 10% or more of the expert tier; one line is printed; --draft on or STRATA_INK_DRAFTER=dflash2 loads it anyway
- draft_plain_now(): on a hybrid load (experts in host memory) a step from 2048 tokens on is plain
- memory plan: 600 MiB for the widened weights (the shipped mix file's SF4 matrices become row-scaled int8 here) plus the per-slot rings; the load prints
  what it really took
2026-11-27 08:23:42 +01:00
Niko1221 3dca18b19a inkling2/metal: the FP8 KV read of the decode attention kernels lives in its own library (fast mode only); the default kernels read the half cache as before 2026-11-27 08:23:42 +01:00
Niko1221 7b09797717 review fixes: settings register, Level Zero V2 only without oneMKL, B70 CI fetches the shipped DFlash 2 file
- settings register and docs/SETTINGS.md: the 15 new names of the M5 Max and
  Intel Arc work (opt-in / research), tools/test_settings_register.py passes
- sycl: STRATA_INK_INTELARC=1 opts into Level Zero V2 only in a build without
  oneMKL (release builds link oneMKL, where V2 is the known SIGSEGV)
- intel-runner.yml: DFlash 2 comes from strata-engine/Inkling-2-Mini-DFlash2
  at 04ecd36f (Inkling-2-Mini-DFlash2-mix.safetensors, 551,600,700 B,
  sha256 cf7dbb08...), saved as dflash2.safetensors
2026-11-27 08:23:42 +01:00
Niko1221 0aa6a92cf6 inkling2/metal: effective_chunk() returns 0 when the M5 Max path is off, so --chunk works as before 2026-11-27 08:23:42 +01:00
Niko1221 950a616192 inkling2: Metal and SYCL DFlash 2 read the shipped pre-quantized file (strata-dflash2-q1, variant mix)
The owner's two ports only read the 990 MB original model.safetensors (every large
matrix as BF16 under its plain name). The file Strata downloads next to the model
is the 552 MB mix file: q_proj / o_proj as NAME.q (I8) + NAME.s (F32 per row), and
gate / up / down as SF4 (NAME.q U8, NAME.s U8, NAME.o F32), so both loaders stopped
with "missing tensor" and ran without a drafter.

ink_dflash2_mix.h widens the SF4 matrices on the host; the int8 ones are copied
as they are. Both backends then use their existing row-scaled int8 form.
2026-11-27 08:23:42 +01:00
Niko1221 f65183d68f inkling2/sycl: use the integration tip's shared backend hooks, DFlash 2 only
dspark_spec_step_sampled now has the tip's signature (knobs one by one plus a
(seed, offset) pair) and the runner's step seed is built from the pair. The
n-gram suffix fallback of the DFlash 2 draft (allow_pld) is switched off: DFlash 2
is the only drafter. The owner's separate hook commit (28adb84f8) is not applied
because the tip carries the same hooks under the R9700 / Strix names.
2026-11-27 08:23:42 +01:00
Niko1221 066537ef07 inkling2(sycl): add STRATA_INK_INTELARC SG16 XMX, DFlash 2, FMT_MX8, and 6 GSQ-RCO codecs 2026-11-27 08:23:42 +01:00
Niko1221 1299c63dd9 inkling2/metal: use the integration tip's shared backend hooks, drop the n-gram suffix drafter
The tip already carries the optional backend hooks (supports_sampled_spec with
the knob-by-knob dspark_spec_step_sampled, prefers_async_prompt_ckpt,
preferred_prefill_cap_with_decoders) from the R9700 and Strix lanes. The
owner's separate hook commit (28adb84f8 / 8acbcfa32) declares the same ideas
under other names and conflicts with the tip in four places, so it is not
applied. The Metal backend now overrides the tip's hooks:

- supports_post_step_prompt_checkpoint -> prefers_async_prompt_ckpt
- dspark_spec_step_sampled takes (temperature, top_k, top_p, min_p, rng_seed,
  rng_offset) and builds its own step seed from the pair
- the prompt-lookup n-gram fallback is removed: DFlash 2 is the only drafter
2026-11-27 08:23:42 +01:00
Niko1221 9bdc12b26c inkling2/metal: add opt-in M5 Max speed path, DFlash 2 drafter, and GSQ-RCO codecs 2026-11-27 08:23:42 +01:00
Niko1221 a1df145cea fix(inkling2-cuda): a failed CUDA graph instantiate no longer destroys its graph twice (the stale "invalid argument" that killed the engine after the eager fallback)
When cudaGraphInstantiate (pdl::instantiate) fails for lack of memory, the capture code falls back to eager mode. The graph handle was already destroyed right after the
instantiate call, and the failure branch destroyed it a second time: cudaGraphDestroy on the dangling handle returns cudaErrorInvalidValue and leaves it as the last error.
Nothing cleared it after that (the cudaGetLastError() of the branch ran before the second destroy), so the next code that reads the last error took it for its own:
InkTopkScratch::run() ("CUDA error 1 at ink_cuda_backend.cu:1314: invalid argument", the first top-k after the fallback) and ended the engine. It hit the shipped default path too.

Fix, at the five graph sites of ink_runner.cuh (the M-row decode graph, the tree-verify graph, the 5060 Ti prefix+core graph, the batched multi-slot graph and the batched chain-verify graph: GraphKey modes 0, 2, 200+, 10 and 30): gr = nullptr after the first destroy, and
(void)cudaGetLastError() after the failure branch's destroy, so the eager fallback starts with a clean error state. The same pattern was searched for in the whole engine
(a scan for a graph handle destroyed twice on one path): the DSpark / DFlash 2 graphs (ink_dspark.cuh, core/dflash2.cpp), core/mtp.cpp, core/session.cpp, core/verify.cpp,
the HIP backends and hy4 destroy once per path; only these five sites had it.

Test (RTX 3090, SQ-20 v2, DFlash 2, default path, the late-ballast shim of NV-ADA-AMPERE: all but 20 / 60 MiB of the free VRAM taken right before the first stream capture):
the old binary dies at 20 MiB after "Tree CUDA Graph capture unavailable (err=2)", the fixed binary completes (decode 86.7 against 87.4 normal tok/s); with 60 MiB (capture
succeeds) and without the shim both binaries are token-identical with the same speed; FASTQ math on the fixed build 88/90 with no fatal line.
2026-11-27 07:56:22 +01:00
Niko1221 adf4458724 inkling2 HIP DFlash 2: the start-up line names the block weight format from the loaded tensors 2026-11-27 07:37:05 +01:00
Niko1221 9e8e44f9de inkling2 HIP: DFlash 2 reads the shipped pre-quantized mix file (strata-dflash2-q1, variant mix)
The file Strata downloads next to the model keeps q_proj / o_proj as int8 (NAME.q I8 + NAME.s F32 per row) and gate / up / down as SF4
(NAME.q U8 E2M1 pairs, NAME.s U8 UE4M3 per 16, NAME.o F32). The HIP loader stopped with "SF4 sidecar tensors are not supported on HIP", so every
AMD card ran without a drafter. The int8 matrices load on the existing q8 path; the SF4 ones run natively (k_hdf2_gemv_sf4: a byte-to-two-int8
table, sdot4 on int8 activations, block scales decoded from UE4M3, the same arithmetic as the CUDA kernel), 4.5 bits per weight, so the drafter stays
at about 390 MiB on the card. STRATA_INK_DFLASH2_SF4=bf16 widens them on the host to bf16 with the shared decoder ink_dflash2_mix.h (copied unchanged
from f-owner-mi e46bc2bba) for a comparison. The residency rule counts the loaded size.
2026-11-27 07:37:05 +01:00
Niko1221 12982f239d sm120 table: the measured Ada / Ampere part sets (no PACK), the RTX 4060 Ti 16 GB and RTX 3060 12 GB rows measured but not default, the big-card guard
Measured on rented cards (SQ-20 v2, DFlash 2 on; RTX 3060 12 GB, RTX 4060 Ti 8 GB and 16 GB, RTX 3090 24 GB; rel0223/nv-ada-ampere/RESULTS.md):

- The small-card set (COMPACT, COMPACT_HYBRID on 12 GB and less, PLD, CORE_GRAPH, C64_SPEC, TC_ATTN) loses PACK: no gain with every expert resident and
  -30% at 9K on a hybrid load. PF_ATTN stays out (+14-18% prefill at 9-12K, but -16% at 16K and -39% at 32K on the 16 GB compact card).
- Rows "4060ti-16" and "3060" are measured (STRATA_INK_SM120=1 uses them without STRATA_INK_SM120_ROW) and default_on = false: KL against the old path is
  0.0055-0.0107 on four corpora (floor 0.0287), the FASTQ subset passes except the agent suite on the 16 GB card (5/10 against 7/10). No Ada / Ampere row is the default.
- DENSE_OPT, DSPARK_OPT and MOE_OPT allocate the 5090's big-card scratch and die on a 16 GB card next to COMPACT (79 MiB free). A row's set never turns them on for
  an Ada / Ampere card of 16 GB or less; only an explicit STRATA_INK_SM120_<PART>=1 does.
2026-11-27 05:19:28 +01:00
Niko1221 d04d40bd60 inkling2 HIP (RDNA2): the tiled grouped-MoE prefill kernels are opt-in (STRATA_HIP_RDNA2_MOE=1): KL 0.0006 against the per-row kernels for +3% prefill; the 64 x 64 dense GEMM stays the default (bit-identical, +22% prefill, STRATA_HIP_RDNA2_GEMM=0 restores the old kernel) 2026-11-27 04:44:08 +01:00
Niko1221 c59abf4025 merge f-owner-hip (OWNER-HIP: R9700 FP8 prompt path, Strix Halo opt-in, AMD-RDNA32 DFlash 2 HIP port and IQ decode) into the 0.2.23 integration; conflicts: ink_backend.h, ink_serve.h (the prompt checkpoint position is rq.ckpt_at of #7241 with the async prompt checkpoint of the HIP backend), settings register (union + regeneration) 2026-11-27 04:14:10 +01:00
Niko1221 752526d0ec inkling2(hip): Strix Halo defaults: SWA_FUSED, SF4 trunk, FP8 KV at C16 and the DirectML probe are opt-in (wrong logits at width 2048 / 4-7x floor / unmeasured); Q8 trunk stays the FAST trunk 2026-11-27 04:07:07 +01:00
Niko1221 0b9cdc1b27 inkling2(hip): R9700 default set on for a verified R9700 (kDefaultOn, refusal silent unless STRATA_INK_R9700 is set): FP8 prompt rows with the drafter window and tapped layers exact, fused attention, chunk 8192 2026-11-27 04:03:16 +01:00
Niko1221 8999231052 inkling2(hip): with DFlash 2 the R9700 FP8 rows only read prompt rows older than the drafter's window (STRATA_INK_R9700_FP8_TAIL, default 2304): the drafter keeps exact taps 2026-11-27 02:41:22 +01:00
Niko1221 50d9661d27 Drafter rule: a plain step skips the whole drafting block; COMPACT_HYBRID is no longer refused by the all-VRAM end-of-start estimate
1. The drafter rule's context cut (hybrid 2048, slow arch 3072) only made the fused tree step return 0; the serve loop then fell through to the
   dspark_draft + forward_batch path, which drafts as well, so the cut never took effect (RTX 5070 12 GB, 4K document: 27.8 tok/s, plain 58.6).
   New InkBackend::draft_plain_now(ctx_pos) (default false; CUDA: the rule with the hybrid flag, the --draft on override and the device cc);
   the single-stream drafting block in ink_serve.h skips on it. RTX 5070, SQ-20 v2, decode tok/s, 2 rounds, default path: 4K document 57.1
   (plain 58.6), 32K 30.3 (plain 30.4), code 84.7 (plain 80.3), tool 97.8 (plain 84.8), prose 72.0 (plain 85.8).
2. COMPACT_HYBRID has no all-VRAM end state, but the end-of-start estimate (runner + DFlash 2 vs free VRAM) still ran for it and read "0 MiB free" on
   every 8 / 12 GB card with the drafter, so the compact trunk was refused and the old path ran. The estimate now skips the hybrid case (the hybrid
   loader keeps its own reserve). RTX 5060 8 GB: C1 decode 14.8 vs 10.7 tok/s old path.
Open: the batched (2 or more slots) drafting path has no cut; the per-request governor (patch kept beside the results) was measured and not shipped:
it loses 15 to 20 % to plain on prose and the 4K document in 256-token runs.
2026-11-27 02:20:25 +01:00
Niko1221 f78e234a2c engine: the drafter rule's context threshold: 2048 tokens on hybrid cards, 3072 on resident sm < 80 cards
kDraftPlainCtxHybrid = 2048 (was the provisional 3072), from RTX 5070 12 GB (SQ-20 v2, 3 rounds, DFlash 2 against --draft off, plain = no drafting):
- prompts of 33-62 tokens: compact hybrid load: prose 76.2 (DFlash 2) vs 86.0 (plain), code 86.3 vs 80.7, tool 98.8 vs 84.9; old path: 47.0 vs 62.6, 52.0 vs 57.7, 57.4 vs 63.3
- a 4096-token document: hybrid 34.5 vs 59.2 tok/s (-42%), old path 22.1 vs 44.1; acceptance 1.9 tokens per step
- 32K: level (30.5 / 30.5 hybrid, 26.4 / 26.7 old path)
NV-OLDER (V100 / P100 / 2080 Ti): DFlash 2 is also below plain on a 4K document (V100 -7% at 4K, -10% at 8K with all experts resident; its draft step is emulated), so a fully resident card
below sm_80 goes plain from kDraftPlainCtxSlowArch = 3072 tokens. Resident sm_80 and newer: unchanged (the 5090 and the PRO cards win at 4K with the window governor).
ink_draft_plain_step takes the compute capability (default 90, no effect for callers that do not pass it); the CUDA hook passes the device's. Unit test covers the measured cases.
2026-11-27 02:20:25 +01:00
Niko1221 04c94cbe32 feat(inkling2-cuda): below sm_80 a hybrid load never gets the default drafter (principle 1b of the drafter rule), for .strata and .gguf
The residency-first rule (ink_draft_rule.hpp) vetoes the default DFlash 2 only when it would move a fully resident model to a hybrid one or cut the tier by 10 % or more. On the cards below
sm_80 (V100, RTX 20, GTX 10, P100) that left hybrid cases with a drafter that loses decode speed. SQ-20 v2, decode tok/s on prose, plain against DFlash 2: RTX 2080 Ti 11 GB 23.5 / 16.3,
P100 16 GB 25.1 / 22.1, GTX 1080 Ti 11 GB 12.7 / 9.2; the GSQ-RCO IQ3_S file on the 2080 Ti (DFlash 2 was loaded, the veto did not fire): prose 32.4 / 23.1, chat 35.9 / 29.1, code 36.0 / 30.3.
Every draft window reads more host experts than a plain step.

- InkDraftLoadIn::below_sm80 and principle 1b: below_sm80 && !full_without (some experts live in host memory, with or without the drafter) -> not loaded, the same veto line, `--draft on`
  (or STRATA_INK_DRAFTER=dflash2, STRATA_INK_DFLASH2_FORCE=1) loads it anyway, `--draft off` wins. A fully resident card below sm_80 (a V100 32 GB) keeps drafting.
- The backend applies the rule to a .gguf on those cards too (it was .strata only): the expert bytes are the file size minus the dense trunk (1.4 GiB compact GGUF trunk, 3.4 GiB otherwise).
- Unit test: the cases of the new principle (hybrid, the same load above sm_80, --draft on, --draft off, fully resident); `ink_draft_rule_test: ok` (g++ -std=c++17).

Proof on the Tesla P100 16 GB (sm_60, one binary built from this commit, 1 start per arm, default / `--draft on` / `--draft off`):
  SQ-20 v2 (hybrid, 2313 experts in VRAM / 759 host): default prints "[InkCUDA] DFlash 2 not loaded: it would move part of the model off the card (the experts need 14.6 GiB, 9.8 GiB fit with the
  drafter's 728 MiB, 10.5 GiB without it) ... `--draft on` loads it anyway." and runs with no drafter (decode 23.2 tok/s, ids identical to --draft off); `--draft on` loads DFlash 2 ("drafter on",
  2154 / 918 experts, decode 17.4); `--draft off` 22.7.
  IQ3_S (GSQ-RCO; all 3072 experts resident on the P100, so no hybrid load): default and `--draft on` load DFlash 2, `--draft off` does not, ids identical in all three: the rule does not
  fire on a fully resident card, as intended.
2026-11-27 02:08:44 +01:00
Niko1221 36a42cd914 sm120 table: the 16 GB Ada / Ampere rows (4080, 4070 Ti SUPER, 4060 Ti 16 GB, A4000) carry no COMPACT_HYBRID (with it COMPACT ran at 2..15 slots and a 16 GB card died at the start with 3 MiB free); a table test pins that no row of 15 GiB or more holds it 2026-11-27 01:57:37 +01:00
Niko1221 d6ed7cfa88 fix(inkling2-cuda): the Ada / Ampere small-card candidate rows try COMPACT with COMPACT_HYBRID (compact limit 20 GiB, chunk 256)
The candidate rows for the cards of 16 GB and less carry the compact size limit and the 256-token compact chunk, and COMPACT_HYBRID is in their candidate set,
so that a 12 GB or 8 GB card builds the compact trunk and puts the freed VRAM into the expert tier.
2026-11-27 01:48:23 +01:00
Niko1221 bc5817f17b sm120 table: the DGX Spark's fast set is the default (default_on), after the FASTQ subset
FASTQ subset on the GB10 (SQ-20 v2, DFlash 2), fast against off: needles 16K / 32K 8/8 and 8/8, tools 24/26 and 24/26, agent 7/10 and 6/10, code 11/11 and
11/11: not worse than off anywhere. Speed (default row, no switch): C1 decode prose 78 / chat 94 / json 99 / code 115 / count 184 / tool 113 tok/s against
off 55 / 69 / 81 / 78 / 97 / 81, C4 109 against 66, C32 305 against 186, prefill 2.5-2.8x; exact = off = the previous release build on every prompt.
Known: with the IQ3_S GGUF the fast set is mixed (prefill +12-17%, C1 chat +35%, json / code slower, C32 at the default 64 drafting slots 167 against 190);
STRATA_INK_SM120=0 is the old path. Table test: the default case of the Spark.
2026-11-27 01:46:24 +01:00
Niko1221 6f9b779ef9 sm120 table: the GB10 row is measured; drafting numbers cost 5 / plain 0, an empty exact set
Measured on a DGX Spark GB10 (Vast, SQ-20 v2 and IQ3_S, DFlash 2 as the drafter). The 5090's drafting numbers (spec_cost 8, plain margin 1.02) made
fast mode decode at the plain rate (53 tok/s) on prose and chat, below off (55 / 69). With spec_cost 5 and plain 0 the C1 decode is prose 79,
chat 94, json 99, code 115, count 183, tool 112 against off 55 / 69 / 81 / 78 / 97 / 81 (mean 113.6 against 76.8), prefill 2.5-2.8x. Dropping
MOE_OPT or the FP8 trunk lost speed, TC_ATTN lost at C1, PDL and SPEC_ADAPT changed nothing, so the fast set stays the 5090's big set.
The exact set is empty (kSm120SparkExact): DSPARK_OPT replaces the window numbers and the verify tree, and exact tokens then differed from off with a
drafter on (json, tool); without it exact = off on every prompt, with and without a drafter. default_on follows from the FASTQ subset.
Table test updated (measured count 3, the Spark cases).
2026-11-27 01:46:08 +01:00
Niko1221 c8613a0561 fix(inkling2-cuda): dp4a_i8 uses the hardware dp4a on sm_70 (a V100 ran an emulation); the V100 head screen of DFlash 2 is the dp4a kernel
dp4a_i8 took the hardware __dp4a only on sm_61 and sm_75 and newer, on the comment that PTX dp4a is emulated on sm_70. It is not: cuobjdump of a sm_70 module shows IDP.4A.S8.S8, and a probe
(phaseA-tests/rel0223/nv-older/dp4a_probe.cu, Tesla V100 SXM2, CUDA 12.8) runs 2667 G dp4a/s for __dp4a against 1265 G/s for the four-multiply form (2.1x). Only sm_60 (P100) has no dp4a.
The guard is now `__CUDA_ARCH__ >= 610`; sm_60 keeps the exact integer emulation. Integer arithmetic: the results are bit-identical.

V100 (SQ-20 v2 and the GSQ-RCO IQ3_S file, same sources, only the guard differs, 2 rounds, alternating):
  IQ3_S plain: prefill 4K 197 -> 207 tok/s, 600-token prompt 206 -> 220, 30-token 210 -> 252; decode 70.0 -> 74.5 / 68.6 -> 73.0 / 70.8 -> 75.7; ids identical 2/2 on all steps
  SQ-20 plain (--draft off): prefill 4K 2142 -> 2143, decode 60.5 -> 60.8 / 63.6 -> 63.8: no change, ids identical 2/2 (the SQ-20 kernels do not go through dp4a_i8)
  DFlash 2 (Q8 GEMVs and the screen): draft step 4.78 -> 3.43 ms (hardware dp4a, cuBLAS INT8 screen) -> 3.02 ms (with the dp4a screen kernel); decode prose 66.9 -> 69.7 -> 70.7, json 128.8 -> 132.4 -> 133.8,
  tool 87.5 -> 90.7 -> 91.7, 4K document 60.8 -> 63.2 -> 64.1 tok/s; tokens identical to the emulated build on all four prompts (2/2).
Because the dp4a screen kernel is faster than the cuBLAS INT8 GEMM on the V100, DFlash 2 uses the kernel there (sm_60 and sm_70); sm_61 and sm_75 keep the cuBLAS GEMM
(STRATA_INK_DFLASH2_SCREEN=cublas|kernel still picks either for an A/B).
2026-11-27 01:17:24 +01:00
Niko1221 ee31112947 inkling2(hip): R9700 FIXED_SWA is opt-in only (swa_ring without margin corrupts small batches: KLD 0.014 at width 16 against 0.000 without it); EXACT no longer turns it on at C>=16 2026-11-27 00:44:49 +01:00
Niko1221 f0e22a2893 fix(inkling2-cuda): the ring margin of ensure_slot is the 128 MiB of the start-up loop (the 256 MiB of the first fix would have cut the rings the 16/64-slot starts were measured with) 2026-11-27 00:39:45 +01:00
Niko1221 15cae0067f sm120: no drafter for 2..15 slots on a card below 24 GiB; DFlash 2's rings stop while 128 MiB stay free; the COMPACT keep stays 128 MiB (crash proof)
No K/V keep change: the 128 MiB keep passed the crash proof on an RTX 5060 Ti (default settings, DFlash 2 mix beside the model, --parallel 1 --max-context 40000, FASTQ harness: GSM-100 + MATH-50 (149 of 150 right)
+ one 32K needle (pass); 0 fatal engine lines). The start ends with 161 MiB free; nvidia-smi used 15716 MiB after the load and 15798 MiB at the peak, so the lazy growth is 82 MiB and the lowest free is 161 - 82 = 79 MiB
(threshold 48). A 256 MiB keep would cut the device K/V from 7808 to about 1400 tokens (8K decode 71 -> about 30, prefill 3864 -> about 1556), so it is not taken.

2..15 slots (a card below 24 GiB, no STRATA_INK_DRAFTER): no drafter. There is no multi-user chain at those counts (COMPACT refuses them, every RTX 50 part is off) and DFlash 2's memory only costs experts: RTX 5060 Ti fast,
4 / 8 slots 43.5 / 53.0 tok/s with DFlash 2 against 50.6 / 63.3 without; exact 44.6 / 50.3 against 47.5 / 55.2. A pack that carries DSpark but runs without a drafter no longer keeps its reserve or builds the unembed screen
(has_dspark means "a drafter runs": the pack's DSpark only with STRATA_INK_DRAFTER=dspark, or DFlash 2's sidecar). Result: the default equals --draft off, 54.4 / 65.6 tok/s fast and 50.7 / 57.8 exact at 4 / 8 slots, with the same
resident experts (2093 / 1768 fast, 2003 / 1581 exact); the residency-first rule's second build_screen line (plan_for) got the same condition, without which the merged tree still built the 442 MiB screen (4 / 8 slots: 45.2 / 53.6 tok/s, 1976 / 1651 experts). STRATA_INK_DRAFTER=dflash2 still asks for the drafter by name.

16 and more slots, compact: the previous COMPACT commit added DFlash 2's real total to the headroom at every slot count, which at 16 slots (726 MiB) made COMPACT refuse and the engine fail to start ("not enough free GPU
memory for the working buffers", also with --draft off, which the loader cannot see). The real total is now added for 1 slot only, and the start-up rings stop while 128 MiB would stay free (before: all 8 rings, the start ended with 27 MiB
free). RTX 5060 Ti fast, DFlash 2 / no drafter e2e tok/s: 16 slots 212 / 191 (+11 percent, 8 rings, 183 MiB free at the end of the start), 32 slots 303 / 236 (+29, 7 rings, 163), 64 slots 350 / 238 (+47, 5 rings, 127).
2026-11-27 00:39:38 +01:00
Niko1221 72f18fa640 fix(inkling2-cuda): the hybrid plan holds back the whole DFlash 2 drafter below sm_80 (--parallel 4 ran a 2080 Ti out of memory)
On a card below sm_80 the drafter's memory is larger than the plan counted: the BF16 matrices sit as FP32 (+112 MiB), the Q8 / Q8 + SF4 block weights, the scratch, and 42 MiB of ring per slot.
For one slot the 1850 MiB figure of the hybrid path covers it; with 4 slots the planned K/V + workspace side is the larger one and counted only the 42 MiB rings of DFlash 2 (168 MiB),
so after the load 2175 MiB were free, the runner + K/V took 1800 and DFlash 2 took 370 and the 5 MiB left died at the first request
("CUDA error 2 ... allocating 4 MiB; 1 of 11005 MiB free", RTX 2080 Ti 11 GB, SQ-20 v2, --parallel 4, 4 requests). df2_f32_path() cards now count the drafter as the RTX 50 branch does
(df2_total_mib minus 100 MiB that DSpark's pad already holds): 2539 MiB free after the load, 55 MiB left at the end of the run, and the run completes (C4 e2e 14.9 vs 15.8 tok/s for the
shipped DSpark build, 2 rounds). Cards of sm_80 and newer keep their sizing.
2026-11-27 00:36:26 +01:00
Niko1221 017b6b8651 engine(cuda): the Turing (sm_75) kernel series is on by default; STRATA_SM75_PERF=0 turns it off (#7041, #7076)
Until 0.2.22 the bitwise Turing kernels (PRs #2069-#2072, #2081, #2091-#2093, #2145-#2146, #2220-#2223, #1821) were on only with STRATA_SM75_PERF=1, because
nobody on the team had an sm_75 card.  #7041 measured them on 2x RTX 2080 Ti: +4.7% to +21% cold prefill from 32K to 207K tokens, decode level.

Our own check, a rented RTX 2080 Ti, Qwen3-30B-A3B UD-Q4_K_XL, one binary, STRATA_SM75_PERF unset against =1, 7 interleaved pairs:
- the same ids on 12 prompts at temperature 0 (10 short, 16K, 32K), and in every pair (decode short and 4K, prefill 16K and 32K);
- cold prefill 16K / 32K level (B/A 0.999 / 0.999), 4K level (1.000); decode after a 4K prompt B/A 1.042; short decode B/A 0.967 with a spread of 49.4 to
  57.2 tok/s in the A arm alone, so within run-to-run noise (2 of 7 pairs faster);
- no warning or error line only in one arm.
The reporter's prefill gain did not show on that model (a different pack and card count), so this is "no change measured", not a confirmed speed-up.

STRATA_SM75_PERF unset or non-zero: on for a compute capability 7.5 card; =0: off (the 0.2.22 default).  Only 7.5 cards are ever affected (is_sm75; under
STRATA_EMULATE_CC=75 an sm_86 card runs the series for tests); each kernel keeps its own switch, which wins in both directions; the numerics-changing Turing
options (SELECT_SIMT, PA_V2T, PF_FUSED_SM75, BF16_TC) stay opt-in.  sm75_series_test covers the rule.
2026-11-27 00:34:45 +01:00
Niko1221 4220c5c755 merge f-amd-rdna32 5a1a767d4 (DFlash 2 slot rings on demand) into f-owner-hip 2026-11-27 00:25:54 +01:00
Niko1221 5a1a767d44 inkling2 HIP DFlash 2: only slot 0's ring is taken at start, the others when they first run and 1 GiB stays free 2026-11-27 00:25:26 +01:00
Niko1221 19ee92a519 inkling2(hip): R9700 FP8 trunk and FP8 MoE skip the drafter-tapped layers 5/11/17/23 (STRATA_INK_R9700_FP8_TAPS=1 restores) 2026-11-27 00:21:14 +01:00
Niko1221 b1b9fea48c merge f-amd-rdna32 6d71afe55 (RDNA2 GEMM, DFlash 2 window model, df2_skip_) into f-owner-hip 2026-11-27 00:19:20 +01:00
Niko1221 6d71afe55e inkling2 HIP DFlash 2: no drafting for 1 to 3 steps after a plain decision (the draft is not free) 2026-11-27 00:10:17 +01:00
Niko1221 6d6e9064ef settings register regenerated after the late merges (STRATA_PF_SYNC_DEBUG, STRATA_INK_DFLASH2_F32 / _SCREEN, the picture reader names); table test: the 5090 row holds TC_ATTN 2026-11-27 00:03:02 +01:00
Niko1221 550d0e14fa inkling2 HIP DFlash 2: larger MoE share in the window model when part of the experts is on the host 2026-11-27 00:02:49 +01:00
Niko1221 8c2ed915b1 inkling2 HIP: one DEPENDS line for the IQ codec header 2026-11-27 00:00:55 +01:00
Niko1221 f06b91a85e merge f-amd-rdna32-iq (RDNA2 dense GEMM and fdot2 MoE bodies) into f-amd-rdna32 2026-11-27 00:00:47 +01:00
Niko1221 ddeafea876 sm120: the row's drafting numbers (beam, cost, plain margin) apply in fast mode only; a table test pins that no row's exact set holds DSPARK_OPT or any other part that changes tokens or the drafting policy 2026-11-26 23:59:24 +01:00
Niko1221 f96e8c096c sm120 table: the RTX PRO 4000 row is default on (FASTQ equal or better than off on every suite) 2026-11-26 23:55:17 +01:00
Niko1221 402cd017e4 engine: the ONE drafter on/off rule: residency first at load, plain steps by context on hybrid cards
strata/core/ink_draft_rule.hpp (host-only, unit-tested by ink_draft_rule_test) states two principles for every backend:
1. Residency first. A default drafter is not loaded when its weights and rings would move the model from full residency (every expert in VRAM) to a hybrid load, or cut the
   expert tier by 10% or more. One line is printed, with the sentence start the HIP backend uses ("DFlash 2 not loaded: it would move part of the model off the card (the experts
   need X GiB, Y GiB fit with the drafter's Z MiB, W GiB without it) ... `--draft on` loads it anyway."). `--draft on` (BackendOpts::draft_forced), STRATA_INK_DFLASH2_FORCE=1 and
   STRATA_INK_DRAFTER=dflash2 ask for it by name and are never vetoed; `--draft off` stays off.
2. Plain steps by context. On a hybrid card (experts in host memory) a step from kDraftPlainCtxHybrid tokens of context on is a plain step, per step, so it follows every request.
   With all experts resident the existing window governor decides alone. The rule never turns drafting on.
CUDA: the backend compares the load plan with and without the drafter against the free VRAM, the trunk and the expert section (the COMPACT path keeps its own accounting) and sets
df2_residency_veto(), which df2_requested() reads. Tested on an RTX PRO 4000 24 GB with SQ-20 and a VRAM ballast: ballast 2600 MiB keeps full residency with DFlash 2 loaded (no line);
3000 MiB is the flip (3072 experts resident without DFlash 2, 3034 with it): the line is printed and DFlash 2 stays out, `--draft on` loads it (38 experts to host); 3400 and 3800 MiB
(hybrid either way, tier cut below 10%) load it. BackendOpts::draft_forced and its `--draft` parsing are the same lines the HIP backend adds.
2026-11-26 23:55:17 +01:00
Niko1221 9188799840 sm120 table: measured rows for the RTX 5080, 5070 Ti, 5070 (12 GB), 5060 (8 GB) and the RTX PRO 6000 / 5000 / 4500 / 4000
Measured on rented Vast boxes and l620 (SQ-20 v2, f-sm120-rows / f-0223-int builds, C1 on 6 prompts, C4, C8, 4K and 32K prefill and decode, 2-3 rounds), FASTQ off against fast.
- RTX PRO 6000 / 5000 / 4500 / 4000: the 5090 set plus TC_ATTN (kSm120ProFast). With the 5090 row alone these cards decode slower than off at 32K (PRO 5000 72 GB: 150 off, 111 fast;
  with TC_ATTN 186); the 4K numbers and the prefill do not move; teacher-forced KL of fast + TC_ATTN against off equals the fast set's (0.006-0.011). Default on for the first three
  (FASTQ equal or better); the 4000 stays off until its FASTQ is in.
- RTX 5070 12 GB and RTX 5060 8 GB: COMPACT_HYBRID (kSm120HybridFast: compact trunk, FP16 KV, tensor-core small-M kernels; no PACK / PREFILL / PLD / CORE_GRAPH, which made these cards slower).
  The 5070 is default on (FASTQ within noise, KL at the engine floor); the 5060 stays off until its FASTQ is in.
- RTX 5080 and 5070 Ti (16 GB): measured, fast = compact with the Bk128 MoE variant (+8% steps/s), default OFF: 32K prefill and decode lose with the K/V in host memory.
- the table test is updated (10 measured rows) and checks the new defaults.
2026-11-26 23:55:17 +01:00
Niko1221 bb5bd7d991 inkling2(hip): one effective_chunk(): owner opt-in chunk when active, else the compact-GGUF chunk 2026-11-26 23:50:31 +01:00
Niko1221 fbc44fab40 merge f-amd-rdna32 13dd52dda (HIP IQ decode, DFlash 2 residency rule, 4-bit FFN drafter, ring fix) into f-owner-hip 2026-11-26 23:49:09 +01:00