mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1473] STRATA_SYCL_SPIN_MAX default: a JIT build of the B70 gets the A-series bound and loses 46-67% of decode #589
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#589
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?
Originally created by @demetree on GitHub (Oct 8, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1473
The 2,000,000 spin bound costs 46-67% of decode on a JIT build of the B70
0.1.40.3 made the device's spin bound on host flags a build option (
STRATA_SYCL_SPIN_MAX) and defaulted it to20,000 only for a
bmgAOT build - 2,000,000 for everything else, on the grounds that the A-series JIT buildneeds it, where the GPU genuinely waits on the host's slow per-layer CPU expert work.
A B70 built without AOT is not a
bmgAOT build, so it inherits the A-series value. But the two cases areopposite: on the A-series the wait ends when the CPU expert work is done; on a card whose host handshake is not
visible during a window, the wait is expected to run out and give up, and every extra read is time spent on nothing.
STRATA_VERIFY_NO_HOST=1exists for exactly that case - the port's own note is that a kernel's writes tohost-mapped memory are "not reliably visible while the graph runs".
Same binary, one
-DSTRATA_SYCL_SPIN_MAXapart, Arc Pro B70, OpenCL, Coder IQ1_M,--spec 4 --mtp, 128 greedytokens, medians of two interleaved runs:
-DSTRATA_SYCL_SPIN_MAX=2000000=20000The loss grows with the context, which is what more expired waits looks like. With 20,000 the same engine decodes
faster than 0.1.40.2 did (42.9 against 40.8 at the 2,048-token context; 59.0 against 51.0 short), so the whole of
the regression I reported earlier is this default.
What would help
Keying the carve-out on the card (
bmg) rather than onSTRATA_SYCL_AOT MATCHES "^bmg"would cover the JIT build ofthe same card, which is what
docs/INTEL.mdtells people to avoid only for speed (the AOT build is the recommendationbecause of JIT time, not because the JIT build is wrong). Alternatively the bound could follow the property it exists
for - whether this build's host handshake is visible during a window - which on the OpenCL backend it is not, on any
card.
No behaviour change either way in my measurements:
quantize_act_parityandsampler_parityare 0 failures at bothbounds, and through the API 2+2 answers 4.
@demetree commented on GitHub (Oct 8, 2026):
Correction: it is not the card, and it is not one-directional
I dug further and the first version of this report was half right in a way that matters. Keying the carve-out on the
card would not fix it, because the bound is worth about 3x in either direction depending on how the engine is
configured, and what it actually decides is whether speculation works at all - not how long a window costs.
A window that spins on a host flag it cannot see runs out and goes on without what it was waiting for. That is
harmless when what it wanted was a plan it already has (the window's waits, with the MTP drafter on, since the MTP
record path has already published it) and ruinous when it was a draft (the suffix drafter's own waits, without
--mtp). Same build, one-DSTRATA_SYCL_SPIN_MAXapart, Coder IQ1_M with--ple-gguf, 256 greedy tokens after a2,048-token prompt, medians of two interleaved runs, acceptance from the engine's own speculation line:
--spec 4 --mtp--spec 2--spec 4, no--mtpSo 20,000 is both faster and better with
--mtp- the drafts come back right - and 3.7x slower without it, becausethe suffix drafter produces nothing at all inside that bound and every round then verifies a single token. Nothing about
that failure is visible in the answer: 2+2 is still 4.
What I think this points at
A single build constant is asked to cover two kinds of wait, and they want opposite things:
and every read past the moment they give up is time spent on nothing (worth ~3x on the
--mtppath);(worth ~3x on the
--spec-only path).Bounding them separately would take both, and would also let the bound follow the property it exists for instead of a
card name or an AOT flag - which is what the 20,000 and 2,000,000 values are each standing in for today. If the two
kinds were told apart (a drafting wait that runs out being a hard error rather than a silent "carry on"), the default
would not have to guess.
For my port I have taken the 20,000 default on Windows with the MTP drafter (the configuration setup writes) and a
stderr warning in the run wrapper when the engine is launched without
--mtp, pointing at-DSTRATA_SYCL_SPIN_MAX=2000000. Numbers and code: PR #1390.Parity is unchanged at both bounds:
quantize_act_parityandsampler_parityare 0 failures. Through the API on the--spec 4 --mtpconfiguration, 2+2 answers 4 and a Fibonacci request returns a correct function.@Niko1221 commented on GitHub (Oct 10, 2026):
Thank you, the measurements (and the correction to the first version) were the missing piece. What v0.1.42 does:
Intel(R) Graphics [0xe223]), then the marketing name. That card gets 20,000 reads as well. We checked the detection on a B70 under both the Level Zero and the OpenCL backend; the Windows case itself we cannot run.--mtpneeds the long bound (68.8 vs 21.8 tok/s at--spec 2), is applied as well: with--spec>= 2 and no--mtpthe bound stays 2,000,000 on such a card.Could you run your two configurations (
--spec 4 --mtpand--spec 2) on a v0.1.42 build on Windows with no-DSTRATA_SYCL_SPIN_MAXand tell us whether each gets the better bound?STRATA_SPIN_MAX=<reads>still overrides both.@Niko1221 commented on GitHub (Oct 13, 2026):
Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.
If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.