[GH-ISSUE #2807] [Feature]: SYCL: read prompts faster on Battlemage by attending over the union of neighbouring positions' selections #1128

Closed
opened 2026-11-04 01:48:44 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @hotschmoe on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2807

What do you want to do?

Read long prompts faster on the SYCL port on an Arc Pro B70 (Battlemage) with INT8 KV.

Today the QSA prompt attention on SYCL runs the FP32 decode kernel (qsa_decode_attn_batch), 32 prompt positions per
launch, and every position gathers its own ~2,051 selected K/V cells. The XMX port of the tensor-core kernel
(STRATA_PROMPT_ATTN_XMX=1) is correct but slower than that fallback: it is gather-bound and only 12 of its 16 matrix
rows are real heads (docs/INTEL.md, "XMX prompt attention v2"). docs/INTEL.md also measured that 8 consecutive
positions of an 80K prompt select 3.3x one position's cells between them, and left a kernel over that union "not
built" because it multiplies the arithmetic.

What I would like: an opt-in kernel that takes 8 neighbouring positions together, gathers the union of their selected
cells once, runs the products for all 8 x 12 heads on XMX (every matrix row a real head, the extra arithmetic on the
matrix units), and masks per position so each one still attends to exactly its own cells. The default path stays as
it is.

Workaround today: none; the default FP32 attention is the fastest prompt attention on this card.

I have a working version. On upstream main with 2x Arc Pro B70 (layer split, Qwen3.8-Flash-Next ISTA GSQ-RCO IQ3_XXS,
INT8 KV) it reads 4K and 32K prompts 15-16% faster (1,189 -> 1,382 and 1,956 -> 2,246 tok/s) and cuts the first token
of a turn with 40,796 tokens of context from 23.28 to 20.39 s; decode is unchanged. The output is not bitwise (FP16
inputs to the products, about 1e-3 of the output scale against FP64). Details and the parity test in the pull request.

Prepared with AI assistance (Claude Code): the code, the measurements and this text were produced by Claude on the submitter's two Arc Pro B70s, at the submitter's request.

Originally created by @hotschmoe on GitHub (Oct 16, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/2807 <!-- Feature request form (.github/ISSUE_TEMPLATE/feature_request.yml). Title: see ISSUE_TITLE.txt. --> ### What do you want to do? Read long prompts faster on the SYCL port on an Arc Pro B70 (Battlemage) with INT8 KV. Today the QSA prompt attention on SYCL runs the FP32 decode kernel (`qsa_decode_attn_batch`), 32 prompt positions per launch, and every position gathers its own ~2,051 selected K/V cells. The XMX port of the tensor-core kernel (`STRATA_PROMPT_ATTN_XMX=1`) is correct but slower than that fallback: it is gather-bound and only 12 of its 16 matrix rows are real heads (docs/INTEL.md, "XMX prompt attention v2"). docs/INTEL.md also measured that 8 consecutive positions of an 80K prompt select 3.3x one position's cells between them, and left a kernel over that union "not built" because it multiplies the arithmetic. What I would like: an opt-in kernel that takes 8 neighbouring positions together, gathers the union of their selected cells once, runs the products for all 8 x 12 heads on XMX (every matrix row a real head, the extra arithmetic on the matrix units), and masks per position so each one still attends to exactly its own cells. The default path stays as it is. Workaround today: none; the default FP32 attention is the fastest prompt attention on this card. I have a working version. On upstream main with 2x Arc Pro B70 (layer split, Qwen3.8-Flash-Next ISTA GSQ-RCO IQ3_XXS, INT8 KV) it reads 4K and 32K prompts 15-16% faster (1,189 -> 1,382 and 1,956 -> 2,246 tok/s) and cuts the first token of a turn with 40,796 tokens of context from 23.28 to 20.39 s; decode is unchanged. The output is not bitwise (FP16 inputs to the products, about 1e-3 of the output scale against FP64). Details and the parity test in the pull request. Prepared with AI assistance (Claude Code): the code, the measurements and this text were produced by Claude on the submitter's two Arc Pro B70s, at the submitter's request.
Author
Owner

@Niko1221 commented on GitHub (Oct 19, 2026):

Thanks for taking the time to report this.

We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6271275672 --> @Niko1221 commented on GitHub (Oct 19, 2026): Thanks for taking the time to report this. We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
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#1128
No description provided.