mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1606] Intel Arc A770 (Alchemist, i915): prefill serialized (~47 tok/s, GPU idle, 1 CPU core), decode CPU-bound (all 14 cores at 90%, no VNNI) #641
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#641
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 @Javalopes on GitHub (Oct 8, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1606
Summary
On an Intel Arc A770 (Alchemist DG2) with the i915 driver, the prefill phase is severely serialized: the GPU sits idle (RING_MODE: idle, Awake? 0), only 1-2 CPU cores do any work, and the prefill runs at ~47 tok/s. Expected on similar hardware from docs/INTEL.md is 400+ tok/s. Decode works correctly (uses all 14 physical cores), but is CPU-bound at ~13.5 tok/s because the CPU lacks AVX-512/VNNI.
This is a follow-up to #1248 (compilation failures on A-series, now fixed in v0.1.40.3+).
System
GPU: Intel Arc A770 16 GB (Alchemist / DG2, PCI ID 8086:56a0)
Driver: i915 (forced: i915.force_probe=56a0 xe.force_probe=!56a0)
CPU: Intel Xeon E5-2680 v4 (14C/28T, Broadwell, 2.4-3.3 GHz, no AVX-512, no VNNI, AVX2 only)
RAM: 62.6 GB DDR4-2400 quad-channel
SSD: Fanxiang S500PRO 256GB NVMe (~1500 MB/s buffered reads)
OS: CachyOS (Arch-based), kernel 7.2.9-1-cachyos, oneAPI DPC++ 2026.1.1
Compute runtime: intel-compute-runtime 26.35.39758.10-1.1
Strata: v0.1.41 (also tested v0.1.40.3), SYCL backend, native build
Kernel cmdline includes i915.force_probe=56a0 xe.force_probe=!56a0 because on this kernel the xe driver has "ext_intel_free_memory is not supported" and --expert-cache auto reports 0 slots. With i915, the engine works, but the prefill issue below appears.
Config
--pack /home/javal/Strata-data/packs/iq3_xxs
--native .../Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf
--ple-gguf .../Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf
--expert-profile /home/javal/Strata/data/expert-profile.bin
--expert-cache 4096
--prefill auto
--spec 4 --spec-min-p 0.5
--mtp /home/javal/Strata-data/mtp/rt
--max-context 32768
--kv int8
--ple-io direct
--vram-reserve-mib 300
5480 experts in VRAM (8.89 GiB). VRAM in use at idle: 15.70 GiB / 15.90 GiB.
Env: STRATA_VERIFY_DEVICE_PLAN=1, STRATA_VERIFY_NO_HOST=0, STRATA_STAGER_THREADS=12, SYCL_CACHE_PERSISTENT=0, ZES_ENABLE_SYSMAN=1, ONEAPI_DEVICE_SELECTOR=level_zero:gpu, UR_L0_ENABLE_RELAXED_ALLOCATION_LIMITS=1. FP64 emulation vars present or absent — same results.
Problem 1 - Prefill is serialized, GPU is idle
Test: 5,756-token prompt, 200-token output.
Engine log:
[strata] reading the prompt: 5,756 tokens, 10 s so far
[strata] reading the prompt: 5,756 tokens, 20 s so far
...
[strata] reading the prompt: 2,048 of 5,756 tokens, 46 s so far
[strata] reading the prompt: 2,048 of 5,756 tokens, 56 s so far
...
[strata] reading the prompt: 4,096 of 5,756 tokens, 83 s so far
...
[strata] answering: 6 of max 200 tokens, 14.0 tok/s, 124 s
Total prefill: 5,756 tokens in ~123 s = ~47 tok/s (vs 424+ tok/s on the B70 in docs/INTEL.md). Pattern: 30-40 s stalls between 2048-token chunks with no visible progress.
i915 engine info captured during prefill (cat /sys/kernel/debug/dri/1/i915_engine_info):
rcs0
Awake? 0
RING_MODE: 0x00001200 [idle]
RING_HEAD: 0x00000000
RING_TAIL: 0x00000000
ACTHD: 0x00000000_00000000
Requests: (empty)
The GPU compute engine is off. Not slow — idle.
nvtop during prefill:
GPU util: 25%, frequency 717 MHz (max 2400 MHz)
CPU: 97% of one core (out of 28 logical CPUs)
Thread dump during prefill (ps -T -p -o tid,stat,wchan:25,pcpu):
TID STAT WCHAN %CPU
51113 R<l - 35.4 <- main thread, 35% only
...
51606 S<l futex_wait 30.2 <- 13 workers, all in futex_wait
51607 S<l futex_wait 30.2
... (13 workers 51606-51618, all 30.2%)
...
51631 S<l anon_pipe_read.cold 0.0 <- blocked on pipe
51632 S<l hrtimer_nanosleep 0.0
The main thread is at 35% (not 100%). The 13 expert-pool workers are all parked in futex_wait. One thread (51631) is stuck in anon_pipe_read.cold — a blocked pipe read.
iotop during prefill showed no significant NVMe activity from the strata process.
Problem 2 - Decode is CPU-bound (expected, no VNNI), but well parallelized
mpstat during decode (mpstat -P ALL 1 45, summary):
Average: all 45.25 0.26 3.35 0.11 ... 50.98
Average: 0 89.44 0.00 4.24 0.02 ... 5.98 <- core 0 at 89%
Average: 1 90.56 0.00 0.00 0.13 ... 9.09 <- core 1 at 90%
...
Average: 13 90.60 0.00 0.00 0.02 ... 9.20 <- core 13 at 90%
Average: 14 0.11 0.02 0.29 2.43 ... 96.61 <- HT thread idle
...
Average: 27 0.35 0.00 0.89 1.95 ... 96.81 <- HT thread idle
All 14 physical cores at ~90%, HT threads idle. nvtop confirms: CPU 1378%, GPU spikes 0-100% at 2400 MHz.
Decode at 13.4-16.7 tok/s - consistent with docs/INTEL.md for the A750 (10-15 tok/s), and CPU-bound because the Xeon lacks AVX-512 and VNNI (Broadwell, 2016).
Flags tested
--host-core first -> WORSE (decode 13.1 vs 16.7 tok/s)
--kv-resident 32768 -> WORSE (decode 13.4 vs 16.7; prefill unchanged)
--pcie-frac 0 -> NEUTRAL
--ple-io mmap -> NEUTRAL vs direct
--ple-io ram -> OOM (28 GB table + 47 GB arena > 62 GB RAM)
--expert-cache 5120 -> OOM
--expert-cache 4096 -> BASELINE (5480 experts, 8.89 GiB VRAM)
FP64 emulation vars -> NEUTRAL
Version comparison
v0.1.40.3:
Prefill 5,756 tokens: ~123 s (~47 tok/s)
Decode 800 tokens, cache 4096: 13.4 tok/s
VRAM idle (cache 4096): 15.70 GiB
v0.1.41:
Prefill 5,756 tokens: ~123 s (~47 tok/s)
Decode 800 tokens, cache 4096: 13.7-13.9 tok/s
VRAM idle (cache 4096): 15.70 GiB
No regression between versions for this hardware. Release notes mention +22% decode on A750 in 0.1.41 — not observed on A770 (both use DG2 ACM-G10).
Hypothesis
The prefill thread (51631) blocked in anon_pipe_read.cold, combined with the GPU being idle and only the main thread working, suggests the CPU-GPU doorbell/handshake channel is not delivering during prefill on Alchemist.
Possible causes:
The pipe that feeds work to the GPU is only populated by one thread (the main one), and that thread stalls in anon_pipe_read waiting for the previous chunk's completion signal
The 13 expert workers park in futex_wait because no work is dispatched
The GPU gets no commands because the pipe never delivers
Cycle repeats per 2048-token chunk -> the visible 30-40 s stalls
If a Battlemage card (B70, B580) shares this code path but works, the difference may be in the Level Zero doorbell implementation on Alchemist (i915 vs xe) or in the number of in-flight requests the DG2 can hold.
Request
Could you (or anyone with Alchemist hardware) reproduce this? Specifically:
Large prompt (>4K tokens) on A750 / A770 / A580 with i915
Capture i915_engine_info during prefill — is the GPU also idle?
Thread dump — is a thread blocked in anon_pipe_read?
I have direct SSH access to the box and can test patches.
Additional context
The xe driver has a separate issue (ext_intel_free_memory is not supported) that makes --expert-cache auto fail with 0 slots. Worth a separate report — this forced us to use i915.
With --expert-cache 4096 (5480 experts), the GPU hits 98% VRAM. A larger cache OOMs.
mpstat data and raw i915_engine_info available on request.
@Niko1221 commented on GitHub (Oct 10, 2026):
Thank you for the engine-info dump; it showed the GPU idle while the host waited. PR #1602 (duncanmcqueen) is ported into v0.1.42 with his commits. We tested on an Arc A750 (i915, no A770): the 10-prompt gate passes (10/10, no new GPU hang lines). Two parts of the PR were slowing the A750's decode, so they are scoped in the port: the payload checksum wait (decode -17% on the A750) is opt-in with
STRATA_DOORBELL_CHECK=1, and the uncached payload stores are used on xe, not on i915 (where a plain store reaches the host in time; decode -11% otherwise). With those, base and port decode the same on the A750 (4K-prompt decode 14.9 vs 14.9 tok/s). The A750's 4K prompt reads at the same 72 tok/s with and without the port, so we cannot confirm the prefill fix on this card; its cache is small (0.34 GiB) and never reaches past 4 GiB, which is where the PR's address fix applies. Could you run your A770 case on v0.1.42 and post the 'reading the prompt' lines and decode speed? Also trySTRATA_DOORBELL_CHECK=1once, in case your stale-payload case needs it (the PR measured 14 of 2,832 rings stale on an A770).@flare04 commented on GitHub (Oct 11, 2026):
https://github.com/Niko1221/Strata/issues/1545 does this help with your xe driver issue?
@Javalopes commented on GitHub (Oct 11, 2026):
Tested v0.1.42 on A770 (i915). Config: cache 4096, kv int8, max-context 32768, ple-io direct, native build, oneAPI 2026.1.1.
A770 prefill (5,733 tokens), three runs:
v0.1.40.3 (before port): 123s (47 tok/s)
v0.1.42 (default): 145s (40 tok/s) <- slower
v0.1.42 + STRATA_DOORBELL_CHECK=1: 117s (49 tok/s) <- best
With DOORBELL_CHECK=1:
Decode (200 tokens, warm): 12.8-13.4 tok/s, stable across runs. No penalty from the check (unlike the A750's -17%).
So the doorbell check recovers ~28s but the stall pattern remains: each 2048-token chunk takes ~36s, GPU idle between them. Cache is 8.89 GiB, well past 4 GiB, so the address fix applies here, unlike the A750 (0.34 GiB).
Two other things the diagnostics showed:
Happy to run any patch or test any flag. Should I try STRATA_VERIFY_STEPPED=1 (#1713) or #1710 (fast router)?
Update after testing the extra flags on the A770 (i915, cache 4096, 5480 experts, 8.89 GiB):
STRATA_DOORBELL_CHECK=1: works.
STRATA_VERIFY_STEPPED=1: worse on A770.
Also checked the STRATA_HAVE_ZE path mentioned by flare04:
Summary: STRATA_DOORBELL_CHECK=1 is a small win (28s faster prefill), STEPPED hurts, and the prefill stall pattern remains (36s per 2048-token chunk, GPU idle between).
Should I try #1710 (fast router) next, or wait for a patch?
@flare04 commented on GitHub (Oct 11, 2026):
Providing an xe A770 (Alchemist) data point on v0.1.42, since you asked for numbers from a card that crosses the 4 GiB cache line.
Setup: Arc A770 16 GB on the xe kernel driver (not i915), Ryzen 9 8945HX, 32 GB DDR5. Qwen3.8-flash-next-coder (35B-A3B MoE) with the MTP draft at --spec 4, --expert-cache auto, 64k context. The build is v0.1.42 plus three small xe-side fixes I still carry locally (a Level-Zero header/build fix, a device_free_bytes() host-mirror sizing fix in the expert cache, and a generate-path fix) — so call it v0.1.42 + xe nits, not stock. Happy to hand over the diffs.
Prompt reading — real lines, warmed, drafting on:
strata serve: prompt 920 tokens = 0 reused + 920 read in 5250 ms (175.2 tok/s), 2 generated in 203 ms (9.9 tok/s), drafts accepted 3 of 3, 1 checkpoints
strata serve: prompt 927 tokens = 0 reused + 927 read in 5095 ms (181.9 tok/s), 128 generated in 7430 ms (17.2 tok/s), drafts accepted 66 of 88, 1 checkpoints
strata serve: prompt 922 tokens = 0 reused + 922 read in 5005 ms (184.2 tok/s), 128 generated in 6736 ms (19.0 tok/s), drafts accepted 76 of 114, 1 checkpoints
strata serve: prompt 2328 tokens = 0 reused + 2328 read in 14706 ms (158.3 tok/s), 34 generated in 1925 ms (17.7 tok/s), drafts accepted 22 of 25, 1 checkpoints
strata serve: prompt 48436 tokens = 47998 reused + 438 read in 4600 ms (95.2 tok/s), 765 generated in 38714 ms (19.8 tok/s), 6 checkpointsCopy
So ~1k-token prompts read at 175-184 tok/s and a 2.3k-token prompt at 158 tok/s, with no per-chunk stall here: the reading the prompt: N of M tokens progress lines tick continuously and the GPU stays busy. At 48k context it still holds ~20 tok/s decode.
Decode: 14.6 / 17.2 / 19.0 / 20.7 / 22.8 tok/s across matched API-sized answers (median ~19), 18.1-24.3 on 300-320-token generations, MTP draft acceptance 52-81%, expert cache 56-79% hit.
v0.1.42 vs v0.1.40.3 at matched workload is a wash on xe for me — the old build did 17.5-18.2 tok/s on 128-token answers and 24-32 tok/s on 45-72-token prompts. What I actually got from the port is correctness: no >4 GiB flag needed, token 0 fine, JIT-stateless path works.
Two flags — the part I think matters for Arc defaults:
STRATA_VERIFY_STEPPED=1 is +3.0 tok/s for me on xe, and a 3.5x decode regression for the i915 A770 in this thread. It should stay opt-in, or at least be documented as xe-only.
STRATA_DOORBELL_CHECK=1 is decode-neutral for me (163.5/22.0 base vs 165.5/20.4 with it ). But our sycl_payload_pairs microbench on the A770 suggests it is a correctness switch rather than a perf knob:
On the #1710 / fast-router question: I would hold off. Our fast-path router dispatch is 124 us vs 401 us and 245 us vs 872 us for a single-token call — 3-4x on the router itself, but that is microseconds against a 36 s stall per 2048-token chunk. The i915 numbers above say the GPU is idle between chunks (ACTHD: 0, 19% util) with one thread in anon_pipe_read.cold and the rest in futex_wait — that is the host handoff waiting, not router cost. That shape looks like #1549 territory (prompt reading far slower when experts come from the host mirror), especially with an 8.89 GiB cache spilling past 4 GiB. Cheaper things to try first: STRATA_DOORBELL_CHECK=1 (already 40 to 49 tok/s there), and capping the expert cache to fit under 4 GiB — if the gaps shrink, the wait is payload/handoff and the router is a red herring.
One more knob for long contexts: PF_XMX is worth measuring on your side — for me it moves prefill 163.5 to 196.9 tok/s at =1 (+20%) and 209.7 at =2 (+28%), for about 3 tok/s of decode. Also router_fast variant 0 vs variant 1 in the test above is identical with A770_FAST off or on, so that flag is not touching router dispatch.
@Javalopes commented on GitHub (Oct 11, 2026):
Thanks for the xe A770 data point — this is the most useful comparison in this thread. 175-184 tok/s prefill vs my 49 on i915, same DGX. The 3 xe-side fixes you carry locally are exactly what I need: the ext_intel_free_memory issue was why I moved to i915 in the first place.
Could you post the diffs of those three fixes (or a branch)? I'll apply them to v0.1.42 and run the same 5.7k-token test on xe. If it holds, I can drop the i915 force_probe and stay on xe permanently.
Also confirming your findings:
Will report back with xe results once I have your diffs.
@flare04 commented on GitHub (Oct 11, 2026):
@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.