mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #889] [CLOSED] sycl: read doorbell flags with an uncached L1+L3 hint (the GPU never saw the host's store on an Arc Pro B60) #2898
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#2898
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/889
Author: @joeyjoe02
Created: 10/5/2026
Status: ❌ Closed
Base:
main← Head:sycl-doorbell-uncached-read📝 Commits (10+)
fa16567setup: an earlier config that does not parse is skipped, not a crash; configs are written atomically (#459)749d957setup (--backend hip): a system ROCm without the HIP development files falls back to the wheels (#446)5a30024calibrate: the engine's arguments come from the server's engine_args; a failed tuning says why (#447)9f60d13serve, setup: name the small split card that caps the prompt chunk; setup recommends the big card alone (#448)eb8da1d/metrics: each request's speculative draft counts, and their sums in the totals (#457)6a09387setup (--gguf-dir): GGUFs Strata cannot run are named as such, with the --family/--model to use (#444)d6a91e2docs: the Coder is weaker outside code, Chinese/CJK text included; the unpruned sizes for that (#438)d8d4ad3Merge branch 'f-135-eng' into rel-0.1.357b600d5Merge branch 'f-135-small' into rel-0.1.35d9ab843Engine 0.1.35: Windows AMD uses its bundled HIP runtime (#468 #461), the low-RAM resident mode on Windows 32 GB PCs (#467), fixes #460 #459 #446 #447 #457 #448 #444; setup requires it📊 Changes
1 file changed (+18 additions, -0 deletions)
View changed files
📝
sycl/include/strata/sycl_doorbell.hpp(+18 -0)📄 Description
This fix was found, tested and written by Claude on my machine, at my request. I'm not a developer; I'm submitting it because it may help other Arc owners.
What
strata::sys_load(the device side of every doorbell wait:wait_flag_ge_kernel,wait_flag_ge_or_kernel, the elementwise spins) now reads the flag through anannotated_ptrwith an uncached L1+L3read_hint, after an acquire fence, instead of a system-scope atomic load. One file,sycl/include/strata/sycl_doorbell.hpp. The old load is kept behind-DSTRATA_DOORBELL_ATOMIC_LOAD.Why
This is the "GPU not seeing the host's flag store" cost noted in #866 (and the visibility question in #667). On an Arc Pro B60, a system-scope
atomic_refload ofmalloc_hostmemory is still served from the GPU's cache, so a device spin does not see the host's store and runs tokSpinMaxevery time. That bound is what made the per-layer waits slow, and why a smallerkSpinMaxlooked faster but produced degenerate output (comment on #866).A standalone, bounded host/GPU ping-pong (GPU waits for
flag == i, answersack = i; host times each round; 200 rounds, every device spin bounded) shows it directly:malloc_host, system-scope atomic load (current)malloc_host, atomicfetch_add(0)zeMemAllocHostwithBIAS_UNCACHED, atomic loadmalloc_host,read_hintuncached L1+L3(The host side always saw the GPU's
ackstores, so only the device-side load needed changing.)Effect in Strata
Same machine as my #866 comment: Arc Pro B60 24 GB (
8086:e211) over OCuLink PCIe 4.0 x4, NEO 26.31.39395.14, oneAPI 2026.1.1, port commit7ba023e+ #866 + this change, AOTbmg-g21. Flash-Next GSQ-RCO IQ2_XS, 32K context, int8 KV,--spec 4with MTP, 10,813 experts resident and 13,763 in the pinned host mirror, per-layer waits (noSTRATA_VERIFY_NO_HOST):--stream-experts)NO_HOST=1(all-device plan, no waits)Output is unchanged in quality: on a 16-task tool-calling test set run twice, the same model scored 28/30 before and 28/29 after (the one miss is the same kind of model slip in both runs), so the data the host hands back is read correctly too, not only the flag.
Not tested
memory_scope::systematomic loads behave differently on other driver versions; this change does not depend on that.The ping-pong test (standalone, ~100 lines)
Build:
icpx -fsycl -O2 -fsycl-targets=spir64_gen -Xs "-device bmg-g21" pingpong2.cpp -o pingpong2 -lze_loader🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
--family swift#4676