mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4919] [Other] Unofficial SYCL port of the dsv41 line on Intel GPUs (community repo, not a merge request) #2262
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2262
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
dsv41line, maintained for exactly one configuration:-O332 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)
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.
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 needskPicks * FF, notFF).Two findings that may be useful to anyone measuring speculative decoding on a small card:
--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 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.
@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,
spareshrinks, the slab collapses to a small batch,and the
q_b/woprojections end up dequantising the same weights over and over —q_b + ropealone 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.
Measured, Arc Pro B70 32 GB + 192 GB DDR5, DeepSeek-V4.1-Flash IQ2_XXS:
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:
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.
yoco_layer(),DS4_YOCO_KEEP,default keep =
(n_layers - yoco_layer) * (window - 1) + window= 316 rows, armed abovekYocoMin = 1024), and the pack carrieskv_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.
@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) = 15passes over the same bytes. That isthe 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 >= 96so decode keeps the fused kernel.Measured on the same machine (Arc Pro B70 32 GB, DeepSeek-V4.1-Flash IQ2_XXS, 6 experts/word):
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_upworst 3.34e-04 against the harness's double-precisionreference, 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:
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:
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).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/poorseekmain(commit8c74494b);the measurement report and the proposed upstream shape are in #5047. The same code path exists in
src/dsv41/ds4_iq.cu:1595here, which is what #5047 is about.@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:
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:
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;
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_2PHASEis off again in the local config. The PR's report file still describes the kernelmeasurement, which is the part that holds.
@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=1from 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 reusedon all of them.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:
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.
rows >= 96really is the right gate. Decode is untouched: single-token steps reportBELOW-MINROWSand 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 layersuse it, so the dequantize-once path covers all of the experts here.