[GH-ISSUE #5406] [Engine] Arc A770 (Alchemist): scope for Alchemist-only kernel defaults (+18% decode at 8K, +16% at 32K on 0.2.11) #3229

Open
opened 2026-11-07 14:39:01 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @aslater3 on GitHub (Nov 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5406

Problem

On an Arc A770 16 GB, 0.2.11 decodes at 32.6 tok/s on an 8K prompt and 28.1 tok/s on a 32K prompt. With the A770
changes from our closed PRs ported onto 0.2.11, the same runs decode at 38.6 and 32.6 tok/s. Most of those changes
switch on a kernel variant only on Alchemist: the default stays unchanged on every other card, but on the A770 it
changes. CONTRIBUTING asks for scope agreement before changing a default, so I'm asking here before reopening or
resubmitting any of them.

These PRs were closed in the 0.2.0-beta tracker reset. They have all been rebased onto 0.2.11:
https://github.com/aslater3/Strata/commits/a770/port-0.2.11 (main 9f7d977d has the same engine code as 0.2.11).

The bug fix this work found goes separately as #5405.

Measurements

Arc A770 16 GB (xe, Linux 7.0), oneAPI 2026.1, Ryzen 7 3800X, 30 GB RAM, no swap. Qwen3.8-Flash-Next IQ1_M,
--resident-experts --expert-cache auto --max-context 131072 --kv int8 --kv-resident 20480 --spec 4 --mtp,
--prefill auto, greedy, 256 new tokens (8K) / 128 (32K). Same day, alternating builds, a discarded JIT warm-up
per build.

tok/s 0.2.11 0.2.11 + the A770 commits
decode, 8K 32.6 (33.38 / 32.39 / 31.99) 38.6 (39.62 / 37.28 / 38.83)
decode, 32K 28.1 (27.39 / 28.78) 32.6 (33.14 / 31.96)
prompt, 8K 466 (467.7 / 468.9 / 462.3) 480 (474.9 / 485.6 / 479.9)
prompt, 32K 594 (589.7 / 597.9) 623 (620.8 / 624.4)

The output tokens vary from run to run on every build, 0.2.11 included, because MTP drafting and the adaptive
tier make the run non-deterministic. So these runs are not a token-for-token comparison. The kernel changes were
checked with their parity tests, which pass on the A770, and the commits marked "bitwise" give identical results.
11 of the parity tests need OverrideDefaultFP64Settings=1 IGC_EnableDPEmulation=1 on Alchemist, because their
references use fp64.

Switching one change off at a time (8K, 2 runs each, against 38.58 with all four on): router/QSA top-k large GRF
37.81, split GDN 37.92, expert large GRF 38.07, STRATA_POOL_FUSED 38.16. Each one is inside the run-to-run noise of
about ±1 tok/s. Together they are +2.7 tok/s (35.88 → 38.58).

The changes, and what I'd propose

Change Old PR Gate Proposal
Expert cache arena in segments, so the prompt path's borrowed operands are not staged #2486 Alchemist default on Alchemist
QSA prompt attention, 128 queries per launch (bitwise) #2756 Alchemist default on Alchemist
Faster hyper-connection read + norm-folded 256-column down kernel #2488 Alchemist default on Alchemist
Decode GDN recurrence in large GRF, and the split recurrence (bitwise) #2586 Alchemist default on Alchemist
Grouped expert kernels in large GRF (bitwise) #2487 Alchemist default on Alchemist
Router top-10 and QSA block top-k in large GRF (bitwise) none Alchemist default on Alchemist
CPU pool: fused gate/up → down per expert #2751 all backends opt-in, as in #2751 (a CUDA test there was neutral)
Pin the resident copy in 2 GiB chunks when one pinned allocation is refused #2485 only after the refusal needs a decision, see below
MTP drafting, resident keeper, Q4_K/Q5_K/Q6_K GEMV fixes #2752–#2755, #2757 mixed I'll split these into one PR each

The Alchemist gate is intel_gpu_gen(dev) == IntelGpuGen::Alchemist. Each change has its own switch to turn it off: STRATA_ARENA_SEGMENTED, STRATA_ATTN_BATCH, STRATA_GR_*, STRATA_GDN_LARGE_GRF / STRATA_GDN_SPLIT, STRATA_EXPERT_LARGE_GRF, STRATA_SMALL_LARGE_GRF.

Two findings for the maintainers

1. Chunked pinning works as intended but has a mixed end-to-end effect today. On the A770 one pinned allocation
of 4 GiB or more is refused, so the resident copy falls back to mlock. Same day on main, 8K, 5 runs without it
and 4 with it:

without with
pinned 0 GiB 13.7–14.2 GiB
experts streamed by DMA 0 ~7,300
host staging 3.2–3.4 s 0.87–1.27 s
adaptive tier swaps 4.4–4.6 ms/round 1.5–1.6 ms/round
prompt 467.5 tok/s (464–470) 452.5 tok/s (441–460)
decode 32.0 tok/s (30.9–33.6) 32.9 tok/s (32.3–33.6)

The prompt is 3% slower in every run. In October, with more free RAM, the same change measured +1.6% on the prompt.
So I'm not proposing it as a default without a maintainer's view.

2. When RAM is short, the prompt loan is refilled from the files. If the RAM budget can't hold the whole
complement, pin_cache_complement drops the lend region (lend_from_slot = -1). Every lent slot is then re-read from
the GGUF after every prompt: 1,737 slots (3.29 GiB) in 5.0–5.5 s on this machine, which is a third of an 8K prompt's
time. It is the cause of a 35% drop in our prompt speed after we turned swap off, because the RAM available fell
below the complement plus the loan. I tried an opt-in reserve
(6fa6b26c, STRATA_RESIDENT_LEND_FIRST=1, with
STRATA_RESIDENT_LEND_GIB as a cap). It trades prompt speed for decode speed almost linearly:

8K prompt decode
off 477 tok/s 37.7 tok/s
1 GiB 519 34.9
2 GiB 578 33.7
the whole loan (3.29 GiB) 694 30.7

At 32K, with the whole loan reserved, the prompt goes 627 → 692 and decode 30.2 → 29.1. I don't think this should
change a default. It may be worth an opt-in for prompt-heavy workloads, or a line in the docs next to the existing
#1389 warning. Your call.

Questions

  1. Are Alchemist-only defaults acceptable for the six kernel changes, given the numbers above? Or should they all
    be opt-in?
  2. Should they come back as the original PRs (#2486, #2756, #2488, #2586, #2487) rebased, or as one Alchemist PR?
  3. Do you want the chunked pinning and the lend reserve at all?

Not tested: Battlemage, i915, Windows. CUDA and HIP are not affected, except by the CPU pool change, which would stay
opt-in.

Originally created by @aslater3 on GitHub (Nov 6, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5406 ## Problem On an Arc A770 16 GB, 0.2.11 decodes at 32.6 tok/s on an 8K prompt and 28.1 tok/s on a 32K prompt. With the A770 changes from our closed PRs ported onto 0.2.11, the same runs decode at 38.6 and 32.6 tok/s. Most of those changes switch on a kernel variant only on Alchemist: the default stays unchanged on every other card, but on the A770 it changes. CONTRIBUTING asks for scope agreement before changing a default, so I'm asking here before reopening or resubmitting any of them. These PRs were closed in the 0.2.0-beta tracker reset. They have all been rebased onto 0.2.11: https://github.com/aslater3/Strata/commits/a770/port-0.2.11 (`main` 9f7d977d has the same engine code as 0.2.11). The bug fix this work found goes separately as #5405. ## Measurements Arc A770 16 GB (xe, Linux 7.0), oneAPI 2026.1, Ryzen 7 3800X, 30 GB RAM, no swap. Qwen3.8-Flash-Next IQ1_M, `--resident-experts --expert-cache auto --max-context 131072 --kv int8 --kv-resident 20480 --spec 4 --mtp`, `--prefill auto`, greedy, 256 new tokens (8K) / 128 (32K). Same day, alternating builds, a discarded JIT warm-up per build. | tok/s | 0.2.11 | 0.2.11 + the A770 commits | |---|---|---| | decode, 8K | 32.6 (33.38 / 32.39 / 31.99) | 38.6 (39.62 / 37.28 / 38.83) | | decode, 32K | 28.1 (27.39 / 28.78) | 32.6 (33.14 / 31.96) | | prompt, 8K | 466 (467.7 / 468.9 / 462.3) | 480 (474.9 / 485.6 / 479.9) | | prompt, 32K | 594 (589.7 / 597.9) | 623 (620.8 / 624.4) | The output tokens vary from run to run on every build, 0.2.11 included, because MTP drafting and the adaptive tier make the run non-deterministic. So these runs are not a token-for-token comparison. The kernel changes were checked with their parity tests, which pass on the A770, and the commits marked "bitwise" give identical results. 11 of the parity tests need `OverrideDefaultFP64Settings=1 IGC_EnableDPEmulation=1` on Alchemist, because their references use fp64. **Switching one change off at a time** (8K, 2 runs each, against 38.58 with all four on): router/QSA top-k large GRF 37.81, split GDN 37.92, expert large GRF 38.07, `STRATA_POOL_FUSED` 38.16. Each one is inside the run-to-run noise of about ±1 tok/s. Together they are +2.7 tok/s (35.88 → 38.58). ## The changes, and what I'd propose | Change | Old PR | Gate | Proposal | |---|---|---|---| | Expert cache arena in segments, so the prompt path's borrowed operands are not staged | #2486 | Alchemist | default on Alchemist | | QSA prompt attention, 128 queries per launch (bitwise) | #2756 | Alchemist | default on Alchemist | | Faster hyper-connection read + norm-folded 256-column down kernel | #2488 | Alchemist | default on Alchemist | | Decode GDN recurrence in large GRF, and the split recurrence (bitwise) | #2586 | Alchemist | default on Alchemist | | Grouped expert kernels in large GRF (bitwise) | #2487 | Alchemist | default on Alchemist | | Router top-10 and QSA block top-k in large GRF (bitwise) | none | Alchemist | default on Alchemist | | CPU pool: fused gate/up → down per expert | #2751 | all backends | opt-in, as in #2751 (a CUDA test there was neutral) | | Pin the resident copy in 2 GiB chunks when one pinned allocation is refused | #2485 | only after the refusal | needs a decision, see below | | MTP drafting, resident keeper, Q4_K/Q5_K/Q6_K GEMV fixes | #2752–#2755, #2757 | mixed | I'll split these into one PR each | The Alchemist gate is `intel_gpu_gen(dev) == IntelGpuGen::Alchemist`. Each change has its own switch to turn it off: `STRATA_ARENA_SEGMENTED`, `STRATA_ATTN_BATCH`, `STRATA_GR_*`, `STRATA_GDN_LARGE_GRF` / `STRATA_GDN_SPLIT`, `STRATA_EXPERT_LARGE_GRF`, `STRATA_SMALL_LARGE_GRF`. ## Two findings for the maintainers **1. Chunked pinning works as intended but has a mixed end-to-end effect today.** On the A770 one pinned allocation of 4 GiB or more is refused, so the resident copy falls back to `mlock`. Same day on `main`, 8K, 5 runs without it and 4 with it: | | without | with | |---|---|---| | pinned | 0 GiB | 13.7–14.2 GiB | | experts streamed by DMA | 0 | ~7,300 | | host staging | 3.2–3.4 s | 0.87–1.27 s | | adaptive tier swaps | 4.4–4.6 ms/round | 1.5–1.6 ms/round | | prompt | 467.5 tok/s (464–470) | 452.5 tok/s (441–460) | | decode | 32.0 tok/s (30.9–33.6) | 32.9 tok/s (32.3–33.6) | The prompt is 3% slower in every run. In October, with more free RAM, the same change measured +1.6% on the prompt. So I'm not proposing it as a default without a maintainer's view. **2. When RAM is short, the prompt loan is refilled from the files.** If the RAM budget can't hold the whole complement, `pin_cache_complement` drops the lend region (`lend_from_slot = -1`). Every lent slot is then re-read from the GGUF after every prompt: 1,737 slots (3.29 GiB) in 5.0–5.5 s on this machine, which is a third of an 8K prompt's time. It is the cause of a 35% drop in our prompt speed after we turned swap off, because the RAM available fell below the complement plus the loan. I tried an opt-in reserve ([6fa6b26c](https://github.com/aslater3/Strata/commit/6fa6b26c34fb), `STRATA_RESIDENT_LEND_FIRST=1`, with `STRATA_RESIDENT_LEND_GIB` as a cap). It trades prompt speed for decode speed almost linearly: | 8K | prompt | decode | |---|---|---| | off | 477 tok/s | 37.7 tok/s | | 1 GiB | 519 | 34.9 | | 2 GiB | 578 | 33.7 | | the whole loan (3.29 GiB) | 694 | 30.7 | At 32K, with the whole loan reserved, the prompt goes 627 → 692 and decode 30.2 → 29.1. I don't think this should change a default. It may be worth an opt-in for prompt-heavy workloads, or a line in the docs next to the existing #1389 warning. Your call. ## Questions 1. Are Alchemist-only defaults acceptable for the six kernel changes, given the numbers above? Or should they all be opt-in? 2. Should they come back as the original PRs (#2486, #2756, #2488, #2586, #2487) rebased, or as one Alchemist PR? 3. Do you want the chunked pinning and the lend reserve at all? Not tested: Battlemage, i915, Windows. CUDA and HIP are not affected, except by the CPU pool change, which would stay opt-in.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3229
No description provided.