Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.
C++
sycl: IQ4_NL expert dots with the codebook in registers and aligned loads (decode 70.8 -> 76.1 tok/s)
maxfridbe223c9c3a011f
diff --git a/docs/INTEL.md b/docs/INTEL.mdindex 41357bb57..3a3103fcf 100644--- a/docs/INTEL.md+++ b/docs/INTEL.md@@ -19,7 +19,7 @@ PCIe 3.0 x8 slot (the card trains at Gen3 x8 there; it can do Gen5 x16).| model files | the same GGUFs | the same GGUFs + a native pack | the same GGUFs || where the model lives | experts in RAM, hot ones on the card | every expert in VRAM (`--stream-experts`: no host copy), shard 2's lookup table read from the SSD by row | all of shard 1 on the card, shard 2 paged from disk || RAM needed | 32-64 GB | little (23 GB is fine) | little (23 GB is fine) |-| decode, Coder IQ1_M | 44-51 tok/s on an RTX 5070 | **70.8 tok/s** (19-token prompt, 256 greedy tokens), **63.6** after a 2,184-token prompt; ~56 through the API on a chat request | 23-25 tok/s |+| decode, Coder IQ1_M | 44-51 tok/s on an RTX 5070 | **76.1 tok/s** (19-token prompt, 256 greedy tokens), 63.6 after a 2,184-token prompt (before the IQ4_NL change); ~56 through the API on a chat request | 23-25 tok/s || prompt reading | ~1,870 tok/s | **799 tok/s** at 2,184 tokens, 1,062 at 80K | ~150 tok/s (424 at 105K) || speculative decoding (MTP) | yes | yes (the base checkpoint's draft layer; 70-85% of drafts accepted on code) | no || images | yes | not yet | not yet |@@ -405,7 +405,8 @@ runtime's teardown began); it now exits directly once its requests are done.| + the GR down kernel reads the activations directly (the 60 KB SLM tile per group capped occupancy) | 58.7 || + wide 16-byte-load kernels for Q4_K, Q5_K, IQ4_XS (codebook in registers) | 62.6 || + wide kernels for Q8_0 (MTP dense, shexp down of layer 0) and IQ4_NL (shexp down); Q6_K's activation loads aligned | 65.6 |-| + the GR down projection sliced by columns (each group stages one 128-column slice of xn, 4 lanes per row) + a fixed-order reduce | **70.6** |+| + the GR down projection sliced by columns (each group stages one 128-column slice of xn, 4 lanes per row) + a fixed-order reduce | 70.6 |+| + IQ4_NL expert dots (the down projection in 39 of 48 layers): codebook in registers, weights as aligned 4-byte loads, bitwise the same ints (2026-10-01) | **76.1** |The last step changes the output: identical for 146 tokens, then a near-tie after a comma goes the other way (the newkernels sum in a different order). Q8_0 kernels 4-6x (189 -> 31 us at 2560 x 10240, 2 columns), IQ4_NL 640 -> 2560@@ -467,7 +468,7 @@ wherever upstream touched a file they mirror. They are refreshed by re-migration| | ||---|---|-| decode | 70.8 tok/s on a 19-token prompt, 63.6 after a 2,184-token prompt (256 greedy tokens, MTP + suffix drafts) |+| decode | 76.1 tok/s on a 19-token prompt (2026-10-01); 63.6 after a 2,184-token prompt before the IQ4_NL change (256 greedy tokens, MTP + suffix drafts) || prompt | 799 tok/s on 2,184 tokens || through the API | 55.7 tok/s on a 300-token chat answer, prompt included || VRAM | all 12,288 experts resident, ~1.9 GB free with everything loaded (`--vram-reserve-mib 1024`) |diff --git a/sycl/src/kernels/cuda/iq_kernels.dp.cpp b/sycl/src/kernels/cuda/iq_kernels.dp.cppindex 51f081b0e..0b116b406 100644--- a/sycl/src/kernels/cuda/iq_kernels.dp.cpp+++ b/sycl/src/kernels/cuda/iq_kernels.dp.cpp@@ -326,16 +326,53 @@ __dpct_inline__ float vec_dot_iq1_m_q8_1(const void *__restrict__ vbq,return d * ((sumi[0] + sumf[0]) * sc0 + (sumi[1] + sumf[1]) * sc1);}+// SYCL port: the IQ4_NL codebook in registers and its 2-byte-aligned weights as aligned loads. ggml reads 4 uint32 of+// the codebook from global memory per lookup and each weight int as two 16-bit loads (block_iq4_nl is 18 bytes, its+// qs 2-byte aligned); the expert down projection (IQ4_NL in 39 of 48 layers) was the largest expert kernel. Same ints+// out, so the dots are bitwise unchanged.+__dpct_inline__ uint32_t iq4nl_lut4(uint32_t q4) { // four nibbles -> four kvalues_iq4nl bytes+ constexpr uint32_t t0 = 0xBFAD9881u, t1 = 0xF6EADDCFu, t2 = 0x26190D01u, t3 = 0x71594535u;+ uint32_t r = 0;+#pragma unroll+ for (int i = 0; i < 4; ++i) {+ const uint32_t n = (q4 >> (8 * i)) & 0xF;+ const uint32_t t = n < 4 ? t0 : n < 8 ? t1 : n < 12 ? t2 : t3;+ r |= ((t >> (8 * (n & 3))) & 0xFF) << (8 * i);+ }+ return r;+}+__dpct_inline__ sycl::int2 iq4nl_pair(int aux) { // = get_int_from_table_16(aux, kvalues_iq4nl)+ return sycl::int2((int) iq4nl_lut4((uint32_t) aux & 0x0f0f0f0fu), (int) iq4nl_lut4(((uint32_t) aux >> 4) & 0x0f0f0f0fu));+}+__dpct_inline__ sycl::int2 load8_a2(const uint8_t* p) { // 8 bytes at a 2-byte-aligned address, as two ints+ const uintptr_t a = reinterpret_cast<uintptr_t>(p);+ const uint32_t* q = reinterpret_cast<const uint32_t*>(a & ~uintptr_t(3));+ const uint32_t w0 = q[0], w1 = q[1];+ if (!(a & 2)) return sycl::int2((int) w0, (int) w1);+ const uint32_t w2 = q[2]; // only when unaligned: it then holds needed bytes, so it cannot cross a page+ return sycl::int2((int) ((w0 >> 16) | (w1 << 16)), (int) ((w1 >> 16) | (w2 << 16)));+}+#ifndef STRATA_IQ4NL_FAST+#define STRATA_IQ4NL_FAST 1 // compile-time: -DSTRATA_IQ4NL_FAST=0 for ggml's table/16-bit-load path+#endif+__dpct_inline__ float vec_dot_iq4_nl_q8_1(const void *__restrict__ vbq,const block_q8_1 *__restrict__ bq8_1,const int &kbx, const int &iqs) {const block_iq4_nl* bq4 = (const block_iq4_nl*) vbq + kbx;const int* q8 = (const int*) bq8_1->qs + iqs;int sumi = 0;+#if STRATA_IQ4NL_FAST+ const sycl::int2 qq = load8_a2(bq4->qs + 4 * iqs);+#endif#pragma unrollfor (int l = 0; l < 2; ++l) {+#if STRATA_IQ4NL_FAST+ const sycl::int2 v = iq4nl_pair(l ? qq.y() : qq.x());+#elseconst int aux_q4 = get_int_b2(bq4->qs, iqs + l);const sycl::int2 v = get_int_from_table_16(aux_q4, kvalues_iq4nl);+#endifsumi = ggml_cuda_dp4a(v.x(), q8[l + 0], sumi);sumi = ggml_cuda_dp4a(v.y(), q8[l + 4], sumi);}@@ -577,10 +614,17 @@ template <> struct Multi<20> { // iq4_nl (down)static constexpr bool has = true; static constexpr int NW = 4;__dpct_inline__ static void prep(const void* vbq, int kbx, int iqs, MultiW& m) {const block_iq4_nl* bq4 = (const block_iq4_nl*) vbq + kbx;+#if STRATA_IQ4NL_FAST+ const sycl::int2 qq = load8_a2(bq4->qs + 4 * iqs);+#endif#pragma unrollfor (int l = 0; l < 2; ++l) {+#if STRATA_IQ4NL_FAST+ const sycl::int2 v = iq4nl_pair(l ? qq.y() : qq.x());+#elseconst int aux_q4 = get_int_b2(bq4->qs, iqs + l);const sycl::int2 v = get_int_from_table_16(aux_q4, kvalues_iq4nl);+#endifm.w[2 * l + 0] = v.x();m.w[2 * l + 1] = v.y();}