[GH-ISSUE #4919] [Other] Unofficial SYCL port of the dsv41 line on Intel GPUs (community repo, not a merge request) #2262

Open
opened 2026-11-04 01:58:00 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @dingyiyuan on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4919

Not a merge request. This is an announcement of an unofficial, separate repository, posted so that people searching for an Intel GPU path find it instead of rebuilding it.

What

dingyiyuan/poorseek — a SYCL port of this engine's dsv41 line, maintained for exactly one configuration:

  • Intel Arc Pro B70, 32 GB VRAM, 192 GB host RAM
  • DeepSeek-V4.1-Flash, MoE (40 layers, 384 routed experts each, 15 360 total), IQ2_XXS
  • 384 K context, oneAPI / Level Zero, -O3

32 GB cannot hold the experts, so ~1 500 of them stay in VRAM and the rest come from host memory through a CPU lane. Everything in the port is a trade around that.

Numbers on that machine (real, not best case)

decode, three different prompts 19.5 / 23.2 / 20.5 tok/s
decode, same prompt repeated (experts all hot — inflated, don't compare configs with it) 26–27 tok/s
prefill, 80 983 tokens 517.6 s (156.5 tok/s)
decode at 81 K context 12.6 tok/s
decode with MTP/DSpark (512-token warm run, 2026-11-04) 42.9 / 43.9 tok/s (without it: 26.3 / 26.0)
decode with MTP/DSpark, real text, 256 tokens 34.3 tok/s (without it: 18.8)
speculative verify, one T=6 round 128.6 ms (was 304 ms)

100 K input is roughly 9–11 minutes of prefill, then 11–13 tok/s. Same order as the 32 GB configurations reported for other engines on this model, which is the point: this is what the hardware does, not a claim that a port is faster.

Why post it

Intel GPU users currently only have the CUDA path. This is one data point that the engine's structure survives the port, plus the measurements of where it stops: dense projections at the VRAM bandwidth (no headroom), the CPU lane at the host's DDR5 bandwidth (no headroom), and the expert GEMM of a speculative verify window.

Correction, 2026-11-04 — an earlier version of this issue said the verify window left the GPU idle about half the time, i.e. that per-layer dispatch was the wall. That was wrong. Instrumenting the window's host spans showed the host submits are 0.55 ms of a 3.69 ms layer and are fully hidden by the in-order queue; the wall is the expert GEMM itself (2.36 ms a layer). What actually cost the window 300 ms was the kernel choice: it ran the large-m two-phase grouped path (6.86 ms a layer) instead of the decode-tuned per-token kernels (2.36 ms a layer). See the update below.

What I am not asking for

Nothing merged, nothing adopted, no timeline. If a backend abstraction ever becomes interesting, the port and its measurement notes are there to look at, and I am happy to answer questions about what did and did not survive the port. Intel users who try it are welcome to file issues in that repository.

(Related: I opened a PR here earlier, #4911, that was never meant as a merge request; it is closed. This issue is what that should have been.)

Update, 2026-11-04: speculative decoding now wins on this machine

The port previously reported MTP/DSpark as a net loss here (acceptance 100%, draft 7 ms a round, but a verify step of 285–304 ms). That has been fixed: a T=6 verify round is now 128.6 ms, so 5.8 tokens a round is 43.9 tok/s against 26.0 without it (+69%) on a 512-token warm run, and 34.3 vs 18.8 (+83%) on real text.

What changed: the window's experts go through the decode-tuned token kernels per token (moe_gate_up / moe_down, 12 launches a layer) instead of the grouped two-phase path built for large-m prefill. A stride bug in that change was found and fixed as well (each token's gate/up output needs kPicks * FF, not FF).

Two findings that may be useful to anyone measuring speculative decoding on a small card:

  • A speculative path is not bit-reproducible run to run. With the expert placement frozen (--profile-readonly), the same binary and prompt produced different tokens on two consecutive runs — on both the old and the new expert path. Experts moving between VRAM and the CPU lane changes the reduction order (lane fp32 vs GPU), and near-tie argmax flips. Equivalence has to be judged statistically, not by hashing output.
  • The expert VRAM share is not a free knob. It changes both speed and output. At 1.0 and at 0.75 of the budget the server fell off a cliff after ~20 requests (0.15 tok/s: 596 MiB and 4.5 GB free respectively, experts no longer able to turn over), while 0.5 (7 GB free) ran a 24-question set with no degradation. Speculative decoding adds the drafter's ~7 GB on top, so the budget has to cover both.

The remaining 3.5x would need a new small-m grouped MoE kernel (each expert blob read once, efficient at m=1..2); it is not reachable by tuning.

Originally created by @dingyiyuan on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4919 **Not a merge request.** This is an announcement of an unofficial, separate repository, posted so that people searching for an Intel GPU path find it instead of rebuilding it. ## What [dingyiyuan/poorseek](https://github.com/dingyiyuan/poorseek) — a SYCL port of this engine's `dsv41` line, maintained for exactly one configuration: - Intel **Arc Pro B70, 32 GB** VRAM, **192 GB** host RAM - DeepSeek-V4.1-Flash, MoE (40 layers, 384 routed experts each, 15 360 total), IQ2_XXS - 384 K context, oneAPI / Level Zero, `-O3` 32 GB cannot hold the experts, so ~1 500 of them stay in VRAM and the rest come from host memory through a CPU lane. Everything in the port is a trade around that. ## Numbers on that machine (real, not best case) | | | |---|---| | decode, three different prompts | 19.5 / 23.2 / 20.5 tok/s | | decode, same prompt repeated (experts all hot — inflated, don't compare configs with it) | 26–27 tok/s | | prefill, 80 983 tokens | 517.6 s (156.5 tok/s) | | decode at 81 K context | 12.6 tok/s | | **decode with MTP/DSpark** (512-token warm run, 2026-11-04) | **42.9 / 43.9 tok/s** (without it: 26.3 / 26.0) | | **decode with MTP/DSpark**, real text, 256 tokens | **34.3 tok/s** (without it: 18.8) | | **speculative verify, one T=6 round** | **128.6 ms** (was 304 ms) | 100 K input is roughly 9–11 minutes of prefill, then 11–13 tok/s. Same order as the 32 GB configurations reported for other engines on this model, which is the point: this is what the hardware does, not a claim that a port is faster. ## Why post it Intel GPU users currently only have the CUDA path. This is one data point that the engine's structure survives the port, plus the measurements of where it stops: dense projections at the VRAM bandwidth (no headroom), the CPU lane at the host's DDR5 bandwidth (no headroom), and the expert GEMM of a speculative verify window. > **Correction, 2026-11-04** — an earlier version of this issue said the verify window left the GPU idle about half the time, i.e. that per-layer dispatch was the wall. That was wrong. Instrumenting the window's host spans showed the host submits are 0.55 ms of a 3.69 ms layer and are fully hidden by the in-order queue; the wall is the expert GEMM itself (2.36 ms a layer). What actually cost the window 300 ms was the kernel *choice*: it ran the large-m two-phase grouped path (6.86 ms a layer) instead of the decode-tuned per-token kernels (2.36 ms a layer). See the update below. ## What I am not asking for Nothing merged, nothing adopted, no timeline. If a backend abstraction ever becomes interesting, the port and its measurement notes are there to look at, and I am happy to answer questions about what did and did not survive the port. Intel users who try it are welcome to file issues in that repository. (Related: I opened a PR here earlier, #4911, that was never meant as a merge request; it is closed. This issue is what that should have been.) ## Update, 2026-11-04: speculative decoding now wins on this machine The port previously reported MTP/DSpark as a net loss here (acceptance 100%, draft 7 ms a round, but a verify step of 285–304 ms). That has been fixed: a T=6 verify round is now **128.6 ms**, so 5.8 tokens a round is **43.9 tok/s against 26.0 without it (+69%)** on a 512-token warm run, and **34.3 vs 18.8 (+83%)** on real text. What changed: the window's experts go through the decode-tuned token kernels per token (`moe_gate_up` / `moe_down`, 12 launches a layer) instead of the grouped two-phase path built for large-m prefill. A stride bug in that change was found and fixed as well (each token's gate/up output needs `kPicks * FF`, not `FF`). Two findings that may be useful to anyone measuring speculative decoding on a small card: - **A speculative path is not bit-reproducible run to run.** With the expert placement frozen (`--profile-readonly`), the same binary and prompt produced different tokens on two consecutive runs — on both the old and the new expert path. Experts moving between VRAM and the CPU lane changes the reduction order (lane fp32 vs GPU), and near-tie argmax flips. Equivalence has to be judged statistically, not by hashing output. - **The expert VRAM share is not a free knob.** It changes both speed and output. At 1.0 and at 0.75 of the budget the server fell off a cliff after ~20 requests (0.15 tok/s: 596 MiB and 4.5 GB free respectively, experts no longer able to turn over), while 0.5 (7 GB free) ran a 24-question set with no degradation. Speculative decoding adds the drafter's ~7 GB on top, so the budget has to cover both. The remaining 3.5x would need a new small-m grouped MoE kernel (each expert blob read once, efficient at m=1..2); it is not reachable by tuning.
Author
Owner

@dingyiyuan commented on GitHub (Nov 1, 2026):

Update 2026-11-02 — long-context prefill 168 → 271 tok/s (+61%), decode unchanged

Found by profiling rather than by a new kernel: the attention slab's batch size
(c.A = attn_slab_rows(env, chunk, base, spare, ...)) is auto-selected from spare VRAM.
At long contexts the KV cache grows, spare shrinks, the slab collapses to a small batch,
and the q_b/wo projections end up dequantising the same weights over and over —
q_b + rope alone was 42.9% of a 122k-token prefill (310.9 s of 726 s), against 5.8% at 3.2k.

Fix: force the slab and give the freed VRAM back to the experts.

DS4_ATTN_SLAB=2048          # slab rows, instead of "whatever the spare VRAM allows"
--vram-experts 1.0          # expert slots 1524 -> 1616, 595 MiB still free

Measured, Arc Pro B70 32 GB + 192 GB DDR5, DeepSeek-V4.1-Flash IQ2_XXS:

prompt prefill before prefill after
45.6k tokens — 347 tok/s (345.0 / 348.4 / 348.4)
122k tokens 167.9 270.7
200k tokens — 266.8

Decode is unchanged (~21 tok/s, 20.3 / 22.1 across three prompts): the CPU lane is at the
host's memory bandwidth (31 ms/token of lane compute against 21 ms of device wait).

Two things worth recording for anyone else on this path:

  • Long-context prefill is not a sync problem. The device-wait counter reads exactly
    40.00 waits/token (= one per layer) on the decode path, and a 122k prompt run as a
    single chunk (chunk=131072) is the same speed as three chunks (167.6 vs 167.5 tok/s).
    It was the slab, nothing else.
  • CED / YOCO truncation is already in the engine (yoco_layer(), DS4_YOCO_KEEP,
    default keep = (n_layers - yoco_layer) * (window - 1) + window = 316 rows, armed above
    kYocoMin = 1024), and the pack carries kv_source_layer_ids 2,8,14,20,
    index_source_layer_ids 2,8,14,20,24,28,32,36, candidate_source_layer_id 20,
    sliding_window 128. So there is no 2x "skip the decoder half" win left to take here —
    the remaining wall is the 2-bit dequantiser: the expert kernels run at 3.7 TFLOPS
    (gate+up), which is where the time actually goes.
<!-- gh-comment-id:6565639198 --> @dingyiyuan commented on GitHub (Nov 1, 2026): **Update 2026-11-02 — long-context prefill 168 → 271 tok/s (+61%), decode unchanged** Found by profiling rather than by a new kernel: the attention slab's batch size (`c.A = attn_slab_rows(env, chunk, base, spare, ...)`) is auto-selected from *spare VRAM*. At long contexts the KV cache grows, `spare` shrinks, the slab collapses to a small batch, and the `q_b`/`wo` projections end up dequantising the same weights over and over — **`q_b + rope` alone was 42.9% of a 122k-token prefill** (310.9 s of 726 s), against 5.8% at 3.2k. Fix: force the slab and give the freed VRAM back to the experts. ``` DS4_ATTN_SLAB=2048 # slab rows, instead of "whatever the spare VRAM allows" --vram-experts 1.0 # expert slots 1524 -> 1616, 595 MiB still free ``` Measured, Arc Pro B70 32 GB + 192 GB DDR5, DeepSeek-V4.1-Flash IQ2_XXS: | prompt | prefill before | prefill after | |---|---|---| | 45.6k tokens | — | **347 tok/s** (345.0 / 348.4 / 348.4) | | 122k tokens | 167.9 | **270.7** | | 200k tokens | — | **266.8** | Decode is unchanged (~21 tok/s, 20.3 / 22.1 across three prompts): the CPU lane is at the host's memory bandwidth (31 ms/token of lane compute against 21 ms of device wait). Two things worth recording for anyone else on this path: - **Long-context prefill is not a sync problem.** The device-wait counter reads exactly **40.00 waits/token** (= one per layer) on the decode path, and a 122k prompt run as a *single* chunk (chunk=131072) is the same speed as three chunks (167.6 vs 167.5 tok/s). It was the slab, nothing else. - **CED / YOCO truncation is already in the engine** (`yoco_layer()`, `DS4_YOCO_KEEP`, default keep = `(n_layers - yoco_layer) * (window - 1) + window` = 316 rows, armed above `kYocoMin = 1024`), and the pack carries `kv_source_layer_ids 2,8,14,20`, `index_source_layer_ids 2,8,14,20,24,28,32,36`, `candidate_source_layer_id 20`, `sliding_window 128`. So there is no 2x "skip the decoder half" win left to take here — the remaining wall is the 2-bit dequantiser: the expert kernels run at **3.7 TFLOPS** (gate+up), which is where the time actually goes.
Author
Owner

@dingyiyuan commented on GitHub (Nov 3, 2026):

Update: the prompt's experts were dequantizing the same weights 15 times

Worth posting here because it is the largest single change since this announcement, and because it
explains why prefill was so expensive at long context.

The expert kernel tiles the prompt by 64 activation rows, and every tile dequantizes the same expert
weights again. At 900 rows per expert that is ceil(900/64) = 15 passes over the same bytes. That is
the right trade for decode (R == 1, one pass, no f16 scratch) and the wrong one for a prompt.

Fix: dequantize each expert once into an f16 scratch, then one f16 GEMM per matrix on the tensor
cores, gated on rows >= 96 so decode keeps the fused kernel.

Measured on the same machine (Arc Pro B70 32 GB, DeepSeek-V4.1-Flash IQ2_XXS, 6 experts/word):

fused dequantize once + f16 GEMM
expert kernel, 900 rows/expert, gate/up 58,334 us 4,011 us (14.5x)
expert kernel, 900 rows/expert, down 16,968 us 2,054 us (8.3x)
prefill, 62,290-token prompt 375.8 tok/s 944.1 tok/s (2.51x)

Decode is untouched by design and by measurement: a matched A/B (48-token prompt, 160 output tokens,
engine restarted between runs) gives 20.8-20.9 tok/s steady state either way. Numerics slightly
improve rather than degrade: set gate_up worst 3.34e-04 against the harness's double-precision
reference, versus 7.02e-03 for the fused path, because f16 weights with an f32 accumulator round less
than per-value f32.

Where the 14.5x comes from, measured rather than estimated - repeating just the dequantize N times
inside the new path is linear at 1,704 us/pass:

N gate/up, 900 rows
1 4,011 us
2 5,715 us
15 27,870 us
fused 58,334 us

so 6.95x is the redundancy going away and 2.09x is the inner product moving from a fused F32
dot product to a tensor-core f16 GEMM
. The 96-row case is the control: redundancy 2x, speedup 3.7x.

Two caveats so the numbers above are not misread:

  • 944.1 tok/s is at 62 K. The 156.5 tok/s in the announcement above was at 80,983 tokens, and
    longer context is slower in both structures. I have not re-run 81 K with this change; with more
    rows per expert it should gain more, not less, since the redundancy grows with ceil(rows/64).
  • Decode rates should be quoted from >= 128 generated tokens, steady state. A 24-token window right
    after a long prefill reads about 9 tok/s on this machine purely from the first tokens and the
    engine coming up, which is how I briefly fooled myself.

Implementation and the reproduction scripts are in dingyiyuan/poorseek main (commit 8c74494b);
the measurement report and the proposed upstream shape are in #5047. The same code path exists in
src/dsv41/ds4_iq.cu:1595 here, which is what #5047 is about.

<!-- gh-comment-id:6593762333 --> @dingyiyuan commented on GitHub (Nov 3, 2026): ## Update: the prompt's experts were dequantizing the same weights 15 times Worth posting here because it is the largest single change since this announcement, and because it explains why prefill was so expensive at long context. The expert kernel tiles the prompt by 64 activation rows, and every tile dequantizes the same expert weights again. At 900 rows per expert that is `ceil(900/64) = 15` passes over the same bytes. That is the right trade for decode (`R == 1`, one pass, no f16 scratch) and the wrong one for a prompt. Fix: dequantize each expert once into an f16 scratch, then one f16 GEMM per matrix on the tensor cores, gated on `rows >= 96` so decode keeps the fused kernel. Measured on the same machine (Arc Pro B70 32 GB, DeepSeek-V4.1-Flash IQ2_XXS, 6 experts/word): | | fused | dequantize once + f16 GEMM | |---|---:|---:| | expert kernel, 900 rows/expert, gate/up | 58,334 us | 4,011 us (**14.5x**) | | expert kernel, 900 rows/expert, down | 16,968 us | 2,054 us (**8.3x**) | | **prefill, 62,290-token prompt** | **375.8 tok/s** | **944.1 tok/s (2.51x)** | Decode is untouched by design and by measurement: a matched A/B (48-token prompt, 160 output tokens, engine restarted between runs) gives 20.8-20.9 tok/s steady state either way. Numerics slightly improve rather than degrade: `set gate_up` worst 3.34e-04 against the harness's double-precision reference, versus 7.02e-03 for the fused path, because f16 weights with an f32 accumulator round less than per-value f32. Where the 14.5x comes from, measured rather than estimated - repeating just the dequantize N times inside the new path is linear at 1,704 us/pass: | N | gate/up, 900 rows | |---:|---:| | 1 | 4,011 us | | 2 | 5,715 us | | 15 | 27,870 us | | fused | 58,334 us | so **6.95x is the redundancy going away** and **2.09x is the inner product moving from a fused F32 dot product to a tensor-core f16 GEMM**. The 96-row case is the control: redundancy 2x, speedup 3.7x. Two caveats so the numbers above are not misread: - 944.1 tok/s is at 62 K. The 156.5 tok/s in the announcement above was at **80,983** tokens, and longer context is slower in both structures. I have not re-run 81 K with this change; with more rows per expert it should gain *more*, not less, since the redundancy grows with `ceil(rows/64)`. - Decode rates should be quoted from >= 128 generated tokens, steady state. A 24-token window right after a long prefill reads about 9 tok/s on this machine purely from the first tokens and the engine coming up, which is how I briefly fooled myself. Implementation and the reproduction scripts are in `dingyiyuan/poorseek` `main` (commit `8c74494b`); the measurement report and the proposed upstream shape are in #5047. The same code path exists in `src/dsv41/ds4_iq.cu:1595` here, which is what #5047 is about.
Author
Owner

@dingyiyuan commented on GitHub (Nov 3, 2026):

Correction: the 2.51x end-to-end figure was cache warming between the two runs, not this change

I re-ran the 62.3 K comparison with the order reversed - two-phase first, fused second - after seeing that a
132 K comparison showed no difference at all (461 vs 457 tok/s). The engine's own prefill timings:

62.3 K prompt first run (cold after restart) second run (warm)
two-phase first 65,278 ms (954 tok/s) -
fused second - 65,338 ms (953 tok/s)

With the warm cache both configurations land within 0.1% of each other. So the 375.8 -> 944.1 tok/s in my
first A/B was the first run paying for the expert readahead (118 GB of weights streamed in from the model
files) and the second run inheriting it, not the expert kernel getting cheaper. The same 62.3 K prompt now
prefills at ~953 tok/s on unmodified fused kernels.

What still stands, because it is measured in isolation and reproduces:

  • the kernel-level difference is real: at 900 rows/expert, gate/up 58,334 us fused against 4,011 us two-phase,
    down 16,968 against 2,054, and the attribution table (1,704 us per redundant dequantize pass, linear) is
    reproducible with one binary and no model load;
  • the numerics are slightly better, and all seven quant types the harness covers pass.

What does not stand is any claim that this makes prefill faster on this machine. At both 62 K and 132 K, with
the cache warm, the wall clock is unchanged - which means the prompt's expert GEMM is not where the time goes
here; the streaming of 118 GB of expert weights is. That is the thing to measure next (a DS4_PROF stage table
at 62 K and 132 K, both with and without the change), and I would rather correct this now than leave a number
in this thread that a reader could not reproduce.

DS4_EXP_2PHASE is off again in the local config. The PR's report file still describes the kernel
measurement, which is the part that holds.

<!-- gh-comment-id:6594224664 --> @dingyiyuan commented on GitHub (Nov 3, 2026): ## Correction: the 2.51x end-to-end figure was cache warming between the two runs, not this change I re-ran the 62.3 K comparison with the order reversed - two-phase first, fused second - after seeing that a 132 K comparison showed no difference at all (461 vs 457 tok/s). The engine's own prefill timings: | 62.3 K prompt | first run (cold after restart) | second run (warm) | |---|---:|---:| | two-phase first | **65,278 ms (954 tok/s)** | - | | fused second | - | **65,338 ms (953 tok/s)** | With the warm cache both configurations land within 0.1% of each other. So the 375.8 -> 944.1 tok/s in my first A/B was the *first* run paying for the expert readahead (118 GB of weights streamed in from the model files) and the *second* run inheriting it, not the expert kernel getting cheaper. The same 62.3 K prompt now prefills at ~953 tok/s on **unmodified** fused kernels. What still stands, because it is measured in isolation and reproduces: - the kernel-level difference is real: at 900 rows/expert, gate/up 58,334 us fused against 4,011 us two-phase, down 16,968 against 2,054, and the attribution table (1,704 us per redundant dequantize pass, linear) is reproducible with one binary and no model load; - the numerics are slightly better, and all seven quant types the harness covers pass. What does not stand is any claim that this makes prefill faster on this machine. At both 62 K and 132 K, with the cache warm, the wall clock is unchanged - which means the prompt's expert GEMM is not where the time goes here; the streaming of 118 GB of expert weights is. That is the thing to measure next (a DS4_PROF stage table at 62 K and 132 K, both with and without the change), and I would rather correct this now than leave a number in this thread that a reader could not reproduce. `DS4_EXP_2PHASE` is off again in the local config. The PR's report file still describes the kernel measurement, which is the part that holds.
Author
Owner

@dingyiyuan commented on GitHub (Nov 3, 2026):

Correction to my earlier follow-up on this PR: the end-to-end gain is real. I should not have retracted it.

Earlier I said the 375.8 -> 944.1 tok/s was page-cache warmup between two runs. That was wrong, and the reason
is worth stating because it was a measurement bug on my side, not a property of the engine.

The A/B I used to retract it switched configurations by rewriting the server config's env block. It cleared the
three tensor-core switches but never cleared the two-phase one, so in the reversed order the "fused" leg inherited
DS4_EXP_2PHASE=1 from the leg before it. Both legs ran two-phase. That is why they came out identical
(65,338 vs 65,278 ms) and why the retraction looked justified.

Here is the controlled version: one binary, the env is the only variable, four runs per length, and both
orders
run (fused first, then two-phase first). Every request carries a unique tail so the server's KV/slot
cache cannot hit - the engine reports 0 reused on all of them.

62,289-token prompt
  fused       165,971 / 165,433 / 166,217 / 164,973 ms   375.3 / 376.5 / 374.7 / 377.6 tok/s
  two-phase    65,978 /  65,077 /  65,652 /  65,072 ms   944.1 / 957.2 / 948.8 / 957.2 tok/s
                                                                    -> 2.54x

132,068-token prompt
  fused       485,660 / 484,041 ms   271.9 / 272.8 tok/s
  two-phase   271,950 / 271,159 ms   485.6 / 487.0 tok/s
                                                                    -> 1.79x

Within a configuration the spread is under 1% in both orders, so this is not a cache effect. The expert stage
alone goes 111,674 -> 12,179 ms (9.17x) at 62K and 257,038 -> 45,109 ms (5.70x) at 132K, and the per-type
throughput moves from 4.2-7.2 TFLOPS to 33.9-51.8 TFLOPS - the library f16 GEMM really is landing on XMX.

Two things this changed about the shape of the proposal, which matter for the CUDA patch if anyone writes it:

  1. The win shrinks with context, and it is no longer the experts that bound you. At 62K the remaining
    profile is sparse attention 36%, experts 29.5%. At 132K it is compressor+indexer 30% (82 s), sparse attention
    18.6%, experts 16.7%, q_b+rope 15.3%. So after this change the next target is the attention side, not the
    expert GEMM - and that is probably true on CUDA too.
  2. rows >= 96 really is the right gate. Decode is untouched: single-token steps report
    BELOW-MINROWS and stay on the fused kernel, steady-state decode is unchanged at 20.8-20.9 tok/s.

Correctness evidence is unchanged from the kernel-level parity already quoted (all seven quant types, worst
3.61e-04 against 1e-02) - and one more note for whoever implements it: in the pack I profile, IQ1_M is
not a trellis type (tq_kbits(29) == 0, is_iq(29) == true), it is a plain IQ type and 22 of the 40 layers
use it, so the dequantize-once path covers all of the experts here.

<!-- gh-comment-id:6596564752 --> @dingyiyuan commented on GitHub (Nov 3, 2026): Correction to my earlier follow-up on this PR: **the end-to-end gain is real. I should not have retracted it.** Earlier I said the 375.8 -> 944.1 tok/s was page-cache warmup between two runs. That was wrong, and the reason is worth stating because it was a measurement bug on my side, not a property of the engine. The A/B I used to retract it switched configurations by rewriting the server config's env block. It cleared the three tensor-core switches but never cleared the two-phase one, so in the reversed order the "fused" leg inherited `DS4_EXP_2PHASE=1` from the leg before it. **Both legs ran two-phase.** That is why they came out identical (65,338 vs 65,278 ms) and why the retraction looked justified. Here is the controlled version: one binary, the env is the only variable, four runs per length, and **both orders** run (fused first, then two-phase first). Every request carries a unique tail so the server's KV/slot cache cannot hit - the engine reports `0 reused` on all of them. ``` 62,289-token prompt fused 165,971 / 165,433 / 166,217 / 164,973 ms 375.3 / 376.5 / 374.7 / 377.6 tok/s two-phase 65,978 / 65,077 / 65,652 / 65,072 ms 944.1 / 957.2 / 948.8 / 957.2 tok/s -> 2.54x 132,068-token prompt fused 485,660 / 484,041 ms 271.9 / 272.8 tok/s two-phase 271,950 / 271,159 ms 485.6 / 487.0 tok/s -> 1.79x ``` Within a configuration the spread is under 1% in both orders, so this is not a cache effect. The expert stage alone goes 111,674 -> 12,179 ms (**9.17x**) at 62K and 257,038 -> 45,109 ms (5.70x) at 132K, and the per-type throughput moves from 4.2-7.2 TFLOPS to **33.9-51.8 TFLOPS** - the library f16 GEMM really is landing on XMX. Two things this changed about the shape of the proposal, which matter for the CUDA patch if anyone writes it: 1. **The win shrinks with context, and it is no longer the experts that bound you.** At 62K the remaining profile is sparse attention 36%, experts 29.5%. At 132K it is compressor+indexer 30% (82 s), sparse attention 18.6%, experts 16.7%, q_b+rope 15.3%. So after this change the next target is the attention side, not the expert GEMM - and that is probably true on CUDA too. 2. `rows >= 96` really is the right gate. Decode is untouched: single-token steps report `BELOW-MINROWS` and stay on the fused kernel, steady-state decode is unchanged at 20.8-20.9 tok/s. Correctness evidence is unchanged from the kernel-level parity already quoted (all seven quant types, worst 3.61e-04 against 1e-02) - and one more note for whoever implements it: in the pack I profile, IQ1_M is **not** a trellis type (`tq_kbits(29) == 0`, `is_iq(29) == true`), it is a plain IQ type and 22 of the 40 layers use it, so the dequantize-once path covers all of the experts here.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2262
No description provided.