mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2812] [Engine] sycl: STRATA_GR_FUSED=1, the two-kernel BF16 hyper-connection read (opt-in) #4276
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#4276
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/2812
Author: @hotschmoe
Created: 10/16/2026
Status: 🔄 Open
Base:
main← Head:pr/sycl-hc-fused-read📝 Commits (2)
f1cdc43sycl: STRATA_HC_Q8=1 reads the Q8_0 hyper-connection projections (it loaded them and never read them)a703ff1sycl: STRATA_GR_FUSED=1, the two-kernel BF16 hyper-connection read (opt-in)📊 Changes
8 files changed (+1472 additions, -22 deletions)
View changed files
📝
docs/INTEL.md(+82 -0)📝
sycl/CMakeLists.txt(+1 -1)➕
sycl/include/strata/kernels/fused_gr_fused.hpp(+11 -0)➕
sycl/include/strata/kernels/fused_gr_q8.hpp(+16 -0)📝
sycl/src/core/native_dense.cpp(+29 -20)📝
sycl/src/kernels/cuda/fused_gr.dp.cpp(+723 -1)➕
sycl/src/kernels/gr_fused_parity.cpp(+284 -0)➕
sycl/src/kernels/gr_q8_parity.cpp(+326 -0)📄 Description
Problem and result
The SYCL port's default hyper-connection read issues four launches per layer half (norm, sliced down projection, reduce, up projection), each small and latency-bound on an Arc Pro B70.
STRATA_GR_FUSED=1does the norm, the down projection and its partial reduction in one kernel and the up projection in a second. Same BF16 weights, no extra VRAM, the default read's per-element arithmetic, another summation order. With the flag unset the default read runs unchanged. WithSTRATA_HC_Q8=1set the Q8_0 read runs and this flag changes nothing; this read is for setups that keep BF16 (exact weights wanted, or no VRAM for the Q8_0 copies).Result on 0.2.0-beta, two B70s, one stream: verify window 39.4 / 40.2 -> 37.9 / 38.2 ms (-4%), decode 70.6 / 73.7 -> 81.4 / 81.2 tok/s (most of the tok/s spread is a different draft acceptance of the changed output; the window time is the read's effect). Prompt reading unchanged.
Related discussion
Feature issue #2811 (closed in the 0.2.0 tracker reset). No maintainer agreement on scope yet. Stacked on #2810 (
STRATA_HC_Q8=1): this branch is that one plus one commit and reuses its argument struct, scratch and helpers, so #2810 goes first. The diff of this PR alone is the top commit.Approach
sycl/src/kernels/cuda/fused_gr.dp.cpp,namespace gr_fused:gr_fused_down_kernel(a work-group = 32 rows, 2 per lane, x a 1,280-column slab; stagesR' * w_normwith the slab's sums of squares; the 16 sub-group partials added in a fixed order; the last work-group of a row group to arrive applies rs per stream and resets the counter) andgr_fused_up_kernel(16 columns x 4 streams per work-group, K in 4 quarters summed in a fixed order, then the default read's epilogue: pending write, gate, stream mean). The hook infused_gr_read_multi, right after the Q8_0 one. Arguments not at the callers' fixed strides fall back to the default read with one stderr line.fused_gr_set_fused(int)for the parity test.sycl/include/strata/kernels/fused_gr_fused.hpp(new),sycl/src/kernels/gr_fused_parity.cpp(new, in the--selftestloop),docs/INTEL.md.Not changed:
src/,include/, the default SYCL read, the Q8_0 read of #2810 (a sibling namespace and one hook line after its hook).STRATA_GR_*follows the port's prefix for its read switches.Validation
Setup: 0.2.0-beta
maine88ee39dagainst this branch rebased on it. 2x Intel Arc Pro B70 32 GB, kernel 7.1, Compute Runtime 26.22.38646.4 at run time; built with the repository dev image (sycl/tools/Dockerfileon the currentllama-sycl-b70:stable, IGC 2.41.5; an older cached base with IGC 2.36.3 cannot build 0.2.0, see #3219), AOTbmg-g31. Model Qwen3.8-Flash-Next ISTA GSQ-RCO IQ3_XXS,--layer-split 30 --prefill 8192 --max-context 65536 --kv int8 --spec 4 --mtp <BF16 draft layer> --mtp-max-t 4 --spec-min-p 0 --stream-experts --expert-cache auto, one slot, greedy, two fixed coding prompts with 512-token replies, a fresh engine per arm, then fresh 4K and 32K prompts. Coherence check and per-card health after every stop.Passed:
gr_fused_parity --selftest(0.2.0-beta + #2810 + this commit, heada703ff1e, one B70):gr_fused_parity: pass (0 failing of 33 cases)(T = 1..8 x pending write on/off x inject rows on/off; both reads against FP64 and each other within 1e-4, R_out bitwise, a captured graph replayed twice bitwise the direct call, the fixed-stride fallback bitwise the default read).e88ee39dSTRATA_GR_FUSED=1Failed: none observed.
Not run: kernel-level timings on 0.2.0 (unchanged code; on 0.1.x: T = 1 / 4 / 6 reads 38.7 -> 34.8, 50.8 -> 41.5, 62.0 -> 47.1 us), the 40K-context turn, two streams (
--batch-mtprefused on a layer split), CUDA/HIP (not touched),ctestas a whole.Limits
STRATA_GR_V3); greedy output changes after a near-tie.docs/INTEL.mdsection quotes the 0.1.x measurement (main296b59d2); I can swap in the 0.2.0 numbers.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.