mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2193] [CLOSED] sycl: fused GR read without the private GrMulti copy (GR_PICK); large GRF on Arc A-series only - A770 decode 5.4 -> 22 tok/s #3914
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#3914
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/2193
Author: @aslater3
Created: 10/12/2026
Status: ❌ Closed
Base:
main← Head:a770/up-gr-pick📝 Commits (1)
7a581e5sycl: fused GR read without the private GrMulti copy (GR_PICK); large GRF on Arc A-series only📊 Changes
1 file changed (+79 additions, -24 deletions)
View changed files
📝
sycl/src/kernels/cuda/fused_gr.dp.cpp(+79 -24)📄 Description
Title
Issue: #1545, #1606 (Arc A770 decode)
Summary
On an Arc A770 (Alchemist,
xe) the fused GR read kernels index the by-value kernel argumentGrMultiwith a runtime token index (m.a[k]). IGC then copies the whole ~1.2 KB struct into every work-item's private scratch (unitrace: ~40 KB private per SIMD32 thread ingr_up_multi/gr_down_reduce/gr_norm_split).GR_PICKselects one field with compile-time indices only, so nothing is copied. Addressing only: the same values, read and summed in the same order, so outputs are bit-identical.On current
mainthis copy is what makes A770 decode crawl withSTRATA_VERIFY_STEPPED=1: each window segment ends with the fused GR read, and the host waits ~3.5 ms longer per segment. With this PR, 8K decode goes from 5.9 to 22.1-22.6 tok/s with the same output tokens.The same commit runs the sliced down kernel and the multi-token up kernel in large-GRF mode (256 registers) on Alchemist only (
strata::intel_gpu_gen), because at 128 the up kernel still spills ~3.4 KB/thread there. Large GRF halves the threads per Xe core, so Battlemage and every other device launch exactly the kernels they launch today.STRATA_GR_LARGE_GRF=1forces it on anywhere,=0off.What changed
sycl/src/kernels/cuda/fused_gr.dp.cpp:GR_PICK(a fold overstd::index_sequenceof selects on the uniform argument) replacesm.a[k].fieldin the multi-token GR kernels;gr_large_grf(queue)(once per process, Alchemist by default, env override) picks between the existing launch and agrf_size<256>copy of the same kernel for the sliced down and multi-token up launches. On a non-Alchemist device, only the GR_PICK addressing change applies.How it was checked
Arc A770 16 GB,
xe, Linux 7.0, oneAPI 2026.1 (JIT), Ryzen 7 3800X, 30 GB RAM; builds ofa0116b27(+ #2190, without which this card cannot size its expert cache) with and without this commit, same day.Bit-identity.
gr_bench(1-6 tokens, real Coder dims) prints the same checksum for every token count onmain, with this commit, and withSTRATA_GR_LARGE_GRF=0.gr_multi_parity: 32 cases, 0 failures.gr_parity: the same single failure as onmain(QFUSE: T=1 rep 0: not writtenin the fused GR read + q8_1 case) — pre-existing on this card, unrelated to this change.Kernel time,
gr_bench, 1-6 tokens:mainSTRATA_GR_LARGE_GRF=0(GR_PICK only)Decode, Coder IQ1_M, 8K-token code prompt, 256 new tokens, greedy,
--resident-experts --expert-cache auto --max-context 131072 --kv int8 --kv-resident 20480 --vram-reserve-mib 1200 --prefill-borrow --prefill auto --spec 4 --spec-min-p 0.5 --mtp --adapt-every 8,STRATA_VERIFY_STEPPED=1:main+ #2190STRATA_DOORBELL_CHECK=1/STRATA_LEND_MIRROR=0(5 other default runs hung, see the note below)STRATA_GR_LARGE_GRF=0(*) the 15.60 run followed an OOM-killed run (cold page cache; its pool phase was 56.9 ms/round). Output ids are identical to
mainin every run where the expert placement matched (72b762d5b2a3); one large-GRF-off run had a different cache placement (hits 0.7605 vs 0.7468) and different ids, which the CPU-vs-GPU expert rounding explains (seen onmaintoo).Not built or run on Battlemage, i915 or Windows; on those the change is the GR_PICK addressing only (and the large-GRF switch if forced). CUDA/HIP: file is SYCL-only.
Extra Notes
main+ #2190 this card intermittently hangs at the start of a decode window (main thread inVerifier::run->queue::wait, no xe reset logged, RSS grows until the OOM killer); 3 of 5 baseline runs here hit it, 1 of ~15 runs with this PR.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.