mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2437] [Engine] sycl: the IQ4_XS expert dot reads its codebook from registers #4045
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#4045
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2437
Author: @deriknel
Created: 10/14/2026
Status: 🔄 Open
Base:
main← Head:pr/sycl-iq4xs-codebook-registers📝 Commits (1)
dbc834bsycl: the IQ4_XS expert dot reads its codebook from registers📊 Changes
1 file changed (+4 additions, -0 deletions)
View changed files
📝
sycl/src/kernels/cuda/iq_kernels.dp.cpp(+4 -0)📄 Description
Problem and result
vec_dot_iq4_xs_q8_1, the dot the expert gate/up lane kernels use for IQ4_XS, looks each 4-bit value up withget_int_from_table_16, which readskvalues_iq4nlfrom global memory on every lookup.vec_dot_iq4_nl_q8_1and IQ4_XS's split kernel already get the same ints fromiq4nl_pair, which keeps the codebook in registers. With this change the IQ4_XS dot does the same, with the same output. The gain scales with how many expert layers are IQ4_XS.Related discussion
Haxi52 measured it on Swift 1.5 IQ4_XS, where every routed expert's gate/up rows are IQ4_XS, on three Arc Pro B70s with 0.1.44 (comment below): decode 51.1 -> 66.0 tok/s chat, 49.5 -> 65.0 agent (+29% / +31%), prompt reading unchanged, parity suites passing. No scope agreement needed: a focused fix.
Approach
sycl/src/kernels/cuda/iq_kernels.dp.cpp,vec_dot_iq4_xs_q8_1:iq4nl_pair(aux_q4)in place ofget_int_from_table_16(aux_q4, kvalues_iq4nl), under the existing compile-timeSTRATA_IQ4NL_FASTswitch (on by default;-DSTRATA_IQ4NL_FAST=0keeps the old lookup). Both return the same ints. The branch still merges cleanly intomain.Validation
Setup for every run:
maine88ee39dbuilt for SYCL (AOTbmg-g31, oneAPI 2026.1, Compute Runtime 26.35.39758.10, IGC 2.41.5) in a container; host CachyOS, kernel 7.2.11,xe. 2x Intel Arc Pro B70 32 GB, layer split 26, Swift 1.5 Flash-Next IQ3_S with every expert in VRAM,--max-context 262144, int8 KV,--spec 4 --spec-min-p 0.6,--prefill 4096. Each build has only this PR's commit on top ofmain. Greedy check: 5 fixed prompts (prose, code, maths, an edit, a story), temperature 0, 400 tokens, thinking off, compared character by character. Swift IQ3_S has IQ4_XS on one expert layer of 48, so the gain here is small. Pipeline windows off;mainand this PR alternated on fresh engines, two runs each.Passed:
main83.2 / 82.8 (prose), 106.6 / 106.6 (code); this PR 83.9 / 84.0 and 107.4 / 107.7 (+1.1% / +0.9%).main's, both runs.cteston both cards: the same 3 failures as onmain;iq_paritywith fixtures, 0 failures.Failed:
Not run:
sycl/only.Limits
The grouped gate/up path (
native_gu_multi_kernel) is not changed; Haxi52 found its cost is elsewhere (lane layout and loads).We investigated (myself and Claude Opus 5.5 in Claude Code) and I reviewed the findings and ran every test on my two Arc Pro B70s on my CachyOS machine.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.