Commit Graph
105 Commits
Author SHA1 Message Date
Niko1221 d290efcdec hip hybrid decode: split GGUF_RAW experts too (quantized-dot kernels and the dequantize fallback)
The first change split SF4, MX8 and S_K experts over the CPU pool. The Unsloth files use other layouts:
UD-Q4_K_XL has NVFP4 experts in layers 0-19 (lossless SF4) and Q8_0 experts in the last four layers (the coda layers
are placed last, so on a 12-16 GB card they are the RAM experts), UD-Q2_K_XL mixes IQ1_S/IQ2_* with NVFP4/MXFP4.

expert_m1_gu_rows / expert_m1_dn_rows now also cover SkCode::GGUF_RAW, with the same 4-row grouping and the same
dot kernels as eval_inkling2_expert_batch, and the same dequantize-then-float-dot code for the types without a
quantized dot (Q8_0, F16, BF16). ink_expert_split_test checks Q4_K, Q5_K, Q6_K, Q8_0, Q3_K, Q2_K, IQ4_XS, Q4_0 and
IQ4_NL gate/up with Q8_0, Q4_0 and IQ4_NL down, interleaved and split layout, bit for bit against the whole expert.
2026-11-23 13:58:05 +01:00
Niko1221 6cb548ffb1 hip hybrid decode: split each RAM expert over the CPU pool; keep unplaced GGUF experts in RAM
A hybrid decode step (some experts in RAM) routes 8 experts, so only 1-4 of them are RAM experts per layer, and the
CPU pool ran each of them as ONE job on ONE thread. With 10-24 pool threads most cores sat idle while the GPU waited
(per token on a Radeon AI PRO R9700, SQ-10 with 38% of the experts in RAM: 52 ms of CPU wait out of 70 ms).

- expert_m1_gu_rows / expert_m1_act / expert_m1_dn_rows (inkling2_loop.cpp): the same per-row code as
  eval_inkling2_expert, callable on a row range, so every output element is computed in the same order and any split
  gives the same bits (SF4, MX8, S2_K..S8_K; GGUF_RAW experts keep the old path). Test: ink_expert_split_test
  (whole-expert result vs six slicings, slices run in reverse order, bitwise).
- The pool splits every single-token job over ceil(threads / jobs) slices in three phases (gate/up rows, SITU, down
  rows) and adds the expert outputs in job order. The old code added per-thread buffers whose content depended on which
  thread took which job, so the sum order changed from run to run. STRATA_HIP_CPU_SPLIT=0 turns the split off.
- STRATA_HIP_HYB_PROF=1 prints the time split of the hybrid decode step.
- A GGUF whose experts need a transcode (IQ1_S, IQ2_*, IQ3_S: no HIP kernel) grows when it is transcoded to S_K, so the
  planner's file-size budget (--vram-experts-gb 7.26 --ram-experts-gb 0 for UD-Q2_K_XL) left experts that fit neither
  VRAM nor RAM; they were re-read and re-transcoded from the file on every token (0.3 tok/s, prefill 3.9 tok/s on
  gfx1201). They now stay in RAM when MemAvailable allows (a line says so), otherwise a warning says why decode is slow.
- INK_LOGITS_HASH=1 (direct generation mode) prints an FNV hash of the logits of every step.

Measured on p620 (gfx1201, Threadripper PRO 3975WX), SQ-10, --vram-experts-gb 5.2 --ram-experts-gb 3.2 --draft off,
bench 128/128, three alternating rounds: 12.8 / 13.0 / 12.9 tok/s before, 32.2 / 32.6 / 32.9 after (all experts in
VRAM: 73.6). UD-Q2_K_XL with the flags of #6729: 0.3 -> 28.8 tok/s (64 tokens, includes warm-up).
2026-11-23 13:48:26 +01:00
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 9e3ad2778f Accelerate Unsloth quants and NVFP4 across Metal, SYCL, and HIP RDNA2-4
Add first-class Unsloth quant (Q2_K, Q3_K, Q4_K, Q5_K, Q6_K, Q8_0, IQ4_XS, IQ3_XXS) and NVFP4 (type 40) support and optimizations across Apple Silicon Metal, Intel Arc SYCL, and AMD RDNA2/3/3.5/4 HIP backends:

- Metal (engine/metal/): Add T_IQ3_XXS, T_Q2_K, T_Q3_K, T_Q8_0, and T_NVFP4 across quant, units (incl. STRATA_METAL_F16), mma, dense_mm, gemv, gemvu, gr (BF16+F32 inject), moe, moeu, and moe_mm (v1/v2/v3/v4/v6 ragged tiles + halved-load W8 for IQ4_XS/IQ4_NL), plus host dispatch (window.cpp, prompt_chain.inc, moe_tiles.h, ref_quant) and parity suites.
- SYCL (engine/sycl/): Add full NVFP4 (40) decode/dequant/combine with exact s_gate/s_up/s_down tail scales in all branches, hoisted Split<TY>/KqSplit<TY> across all Unsloth/NVFP4 types, opt-in SYCL EXP_MODE=8 with had_block==0 guard, SG16 XMX SLM decoders for Q4_K/Q5_K/Q6_K/IQ4_XS/NVFP4, and expanded parity suites.
- HIP (engine/include/strata/kernels/hip_unsloth_*.hpp, engine/src/kernels/hip/): Add clean-room RDNA2/3/3.5/4 Wave32 DP4A + hoisted HipSplit<TY> + fused EXP_MODE=8 (had_block==0 guard, 65535-safe grid striding, exact NVFP4 tail scales) and unified gfx11/gfx12 Wave32 WMMA FP16/BF16/INT8 + fused dequant-to-LDS prefill kernels with standalone 5-arch verification harness.
2026-11-22 19:51:03 +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 e3ef567e35 Merge branch 'f-0220-8g12g-qwen' into f-0220-int 2026-11-22 16:00:41 +01:00
Niko1221 63b73ba73f Merge branch 'f-0220-multigpu' into f-0220-int 2026-11-22 15:59:06 +01:00
Niko1221 d28c053e67 perf(low-vram): optimize 8 GB & 12 GB consumer GPUs and unlock 4 GB 0-slot mode 2026-11-22 15:57:43 +01:00
Niko1221 cc62949293 engine: fix multi-GPU usage race (#6560), PHB peer fault, SYCL stage_dev, #6427/#6501/#6504, and Win HIP split-2 2026-11-22 15:52:07 +01:00
Niko1221 40fa01b31e hy4flash: enable multi-GPU across CUDA, AMD HIP, Intel SYCL, and DGX Spark (#6562, #6565, #6568) 2026-11-22 15:52:06 +01:00
Niko1221 99ee215756 Merge branch 'f-0220-ink-gguf-ep2' into f-0220-int 2026-11-22 15:22:40 +01:00
Niko1221 a8e30004ab inkling2: native CUDA GGUF (unsloth + ggml-org), full on-GPU cuda-ep2, PR #6586 & #6571 2026-11-22 15:19:45 +01:00
Niko1221 dceb034d57 mtp: support native GGUF experts (Q4_0, IQ4_NL) in drafter (#6582) 2026-11-22 15:11:30 +01:00
Niko1221 a727ce5d1b sm_86: fix 2-GPU lend-slot mismatch and QFUSE decode regression (#6583), add STRATA_SM86_DOWN_WS (#6581) 2026-11-22 15:08:21 +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 1a2b551ea4 Merge branch 'f-0220-ink-msycl-gguf' into f-0220-int 2026-11-22 14:26:52 +01:00
Niko1221 7031ccaf95 inkling2+hy4: auto-default L0-V1 for Arc B70 oneMKL & native GPU GGUF/safetensors loading on Metal/SYCL/HIP 2026-11-22 14:24:41 +01:00
Niko1221 44710df59b engine: fix #6489 sm_86/89 staged 128-row prefill tile, #6487 warmup error masking, and update settings register 2026-11-22 13:43:00 +01:00
Niko1221 14618d7d2f Merge branch 'f-0220-eng-q36' into f-0220-eng-fixes 2026-11-22 13:39:01 +01:00
Niko1221 3319f9e272 q36: support per-layer head_count_kv arrays (#6522) and staging headroom
Accept qwen35moe.attention.head_count_kv (and head_count) as either a scalar or a per-layer integer array of length block_count in both check_architecture_qwen35moe and geometry_from_gguf, resolving the non-zero full-attention head count (never blindly reading entry 0), tolerating feed_forward_length == 0 and optional nextn_predict_layers. Add optional headroom to OneSessionInput and HybridIn for card-0 driver/pinned-mapping overhead, plus CPU unit test q36_metadata_test wired into cpu-check.
2026-11-22 13:37:40 +01:00
Niko1221 64363f6809 Merge branch 'f-0220-eng-sycl' into f-0220-eng-fixes 2026-11-22 13:23:14 +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 f44ed40b8d sycl: Battlemage grouped routed-expert prefill and weight reuse (PR #6567) 2026-11-22 13:06:10 +01:00
Niko1221 1f1057b3f3 sycl: preserve message-boundary checkpoints for branching follow-ups (PR #6534, #6533) 2026-11-22 13:05:20 +01:00
Niko1221 0f1738e611 engine: integrate #6547, #6548, #6538, #6465 (batched MTP, QSA stream batch, persistent spill, bounded swap) 2026-11-22 13:02:10 +01:00
Niko1221 ad4c565e86 engine: integrate #6549, #6532, #6543, #6545, #6546, #6554 2026-11-22 13:01:28 +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 a2ca43e53b cuda: sm_120/121/89/86 Wave-2+3 decode/prefill multipliers, partial-cache fix, and defaults 2026-11-22 02:27:43 +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 f8ebab6179 rdna3: keep STRATA_GDN_CHUNKED opt-in on discrete gfx11 (32.6x lower 4K KL) 2026-11-22 01:35:02 +01:00
Niko1221 9145ea30eb Merge branch 'f-0219-ink-gguf' into f-0219-int 2026-11-22 01:30:25 +01:00
Niko1221 c0e8cfa042 Merge branch 'f-0219-ink-hip' into f-0219-int 2026-11-22 01:30:11 +01:00
Niko1221 c8c82e300a rdna3: fix STRATA_VERIFY_DEVICE_HITS alias in expert_source and keep opt-in on discrete gfx11 2026-11-22 01:05:25 +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 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 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 bbb22af24a rdna3: Phase 2 native_h11p_kernel (PF_F16=2) and discrete moe_p1a FL=3 across gfx1100-1151 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 199ecbd7ec inkling2: complete multi-gen AMD ROCm/HIP backend (RDNA4, RDNA3/3.5, 780M/890M/Strix Halo, RDNA2) 2026-11-21 21:20:54 +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 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 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 7c90399f4e Merge f-cg1-ram: a cgroup v1 limit credits the group's clean page cache in the RAM probe 2026-11-19 21:05:19 +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