mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #866] [CLOSED] sycl: keep cudaStreamQuery's answer in the per-layer ring waits #2884
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#2884
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/866
Author: @LocalXPU
Created: 10/5/2026
Status: ❌ Closed
Base:
main← Head:sycl-stream-query-fix📝 Commits (1)
33a6f27sycl: keep cudaStreamQuery's answer in the per-layer ring waits📊 Changes
3 files changed (+12 additions, -3 deletions)
View changed files
📝
sycl/src/core/session.cpp(+4 -1)📝
sycl/src/core/verify.cpp(+4 -2)📝
sycl/tools/fixups.py(+4 -0)📄 Description
The SYCL port's per-layer ring wait gives up too early. With experts mirrored in host RAM, a layer whose GPU time passes 2 ms is reported as
layer N never rang (graph finished)while the graph is still running. On one Arc Pro B60 the Coder IQ1_M run stopped at layer 15 every time.Where it broke
The CUDA code asks the stream whether it is still running, and only gives up when it is not (
src/core/verify.cpp:1458):The migration turned the query into
const dpct::err0 q = DPCT_CHECK_ERROR(cs_->ext_oneapi_empty()).DPCT_CHECK_ERRORevaluates to 0 whenever the expression does not throw, soqis always 0,q != 1is always true, and any ring that takes longer than 2 ms is a failure. The same pattern is insession_run_token(sycl/src/core/session.cpp) andVerifier::run(sycl/src/core/verify.cpp).With every expert in VRAM the host does not wait layer by layer (
STRATA_VERIFY_NO_HOSTwaits for the whole window), so the paths measured on the B70 never reached it. With part of the experts mirrored in RAM the host does wait, and the first layer slow enough to trip it was layer 15 of the Coder.The change
qis now 0 when the queue is empty and 1 while it is running, which is what the guard and the trace comment ("1 = still running") already expect:Two sites, 8 lines added and 3 removed in the engine files, plus a
fixups.pyentry (#8) that produces the same code from a fresh dpct run, so a re-migration keeps it.Verified
One Arc Pro B60 24 GB, Coder IQ1_M, 4,042 of 12,288 experts mirrored in pinned RAM,
--max-context 8192 --kv int8 --spec 4, 128 greedy tokens, AOTbmg-g21, Level Zero V2, NEO 26.09.37435.12, oneAPI 2026.1.1, Ryzen 5 5600 with 64 GB RAM:verify: layer 15 never rang (graph finished), 5 of 5 tries;The all-resident path is unchanged (two B60s,
--layer-split, every expert in VRAM: Coder 56.6 tok/s, IQ2_XS 58.6 to 61.3, same as before the change). Setup and numbers are in the results report, #867.Notes
verify.cppby maxious's fork (maxious/Strata_SYCL, branchb70, "DPCT_CHECK_ERRORdiscards the value of its expression", fixed there as an explicitidle = cs_->ext_oneapi_empty()). Thesession.cppcopy (session_run_token) is still unfixed in that fork and inmaxfridbe/Strata_B70at the time of writing. This PR covers both sites on upstream's tree, with a reproduction on a card.sycl::atomic_fence(seq_cst, system)instrata_spin_pause(). Before this fix it fails at layer 15 the same way, so it is not the cause of this failure. After this fix the run with the fence did 11.4 tok/s and without it 11.2 to 11.9, so it made no difference here. It is not part of this PR.wait for rings, and it falls with the device-side spin boundkSpinMax(25.1 tok/s at 2,000, 28.4 at 200). That looks like a separate problem, the GPU not seeing the host's flag store, and I have not changed it.src/core/verify.cpphas two moreq != cudaErrorNotReadywaits (:1983,:2098) with no SYCL copy yet. They need the same treatment when ported.6f32ec0sycl/does not build without it.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.