[GH-ISSUE #4731] 0.1.54: attn_batch defaults to 128 while bytes_needed_impl still budgets 32 (fixed after the v0.2.8 tag, not in the shipped engine) #2167

Closed
opened 2026-11-04 01:57:11 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @fogliaye91-cmd on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4731

What I think is going on

The engine binary shipped with v0.2.8 reports version 0.1.54, which corresponds to source at 36f6663c. At that commit:

  • sycl/src/prefill/prefill.cpp:737 — Prefill::Impl::attn_batch defaults to 128 (from 09524eb4)
  • sycl/src/prefill/prefill.cpp:2169 — bytes_needed_impl calls qsa_set_bytes(T, cap, max_blocks, 256, **32**, s)

So the allocator in carve() sizes the attention scratch from the actual value (128) while the estimate that sizes the expert cache and the prompt-path loan still counts 32.

870aedd9 ("the prompt attention batch is budgeted where it is allocated, and stays 32 by default") unifies both through attn_batch_for() and moves the default back to 32 — but it lands one commit after the v0.2.8 tag, so it is not in the 0.1.54 binary that users download.

Why it matters to someone running the shipped build

Your own commit message describes the symptom on a single 32 GB Arc Pro B65 with the config setup writes:

device buffers for a chunk of 512 tokens do not fit (2098 of 32656 MiB free)

That is a first-request failure on a stock install of the released engine. Users who only consume the binary get 0.1.54, not main, so they get the mismatch and not the fix.

What I observed on my side (two cards, so it stays hidden)

Two Arc Pro B65, layer split 25, --pipeline-windows 2, 128 K context, Qwen3.8-Flash-Next-IQ3_S. Measured prefill at STRATA_ATTN_BATCH = 32 / 64 / 128, each with its own restart and warm-up:

| batch | prefill (20 K cold, steady) | decode | VRAM card 0 / card 1 |
|||||
| 32 | 1,336.4 tok/s | 57.3 / 57.7 | 30.77 / 29.69 GiB |
| 64 | 1,338.4 tok/s | 57.1 / 57.7 | 30.77 / 29.69 GiB |
| 128 | 1,356.4 tok/s | 57.2 / 57.8 | 30.77 / 29.69 GiB |

On two cards the extra scratch is absorbed — VRAM is identical at all three values, because max({gdn_set_bytes, qsa_set_bytes, moe_set_bytes}) is dominated by the MoE term here, so the under-estimate never surfaces. The 1.5 % prefill difference between 32 and 128 matches the 1.1–1.3 % you reported. I could not reproduce the failure with two cards; I am reporting the mismatch, not a reproduction of your single-card case.

Question

Is a rebuild of the SYCL engine planned so that 0.1.54-level users get attn_batch_for() and the 32 default, or should the docs recommend setting STRATA_ATTN_BATCH=32 explicitly for single-card setups until then? I have been telling people the latter and would like to know whether that is the intended guidance.

Originally created by @fogliaye91-cmd on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4731 **What I think is going on** The engine binary shipped with v0.2.8 reports version **0.1.54**, which corresponds to source at `36f6663c`. At that commit: - `sycl/src/prefill/prefill.cpp:737` — `Prefill::Impl::attn_batch` defaults to **128** (from `09524eb4`) - `sycl/src/prefill/prefill.cpp:2169` — `bytes_needed_impl` calls `qsa_set_bytes(T, cap, max_blocks, 256, **32**, s)` So the allocator in `carve()` sizes the attention scratch from the actual value (128) while the estimate that sizes the expert cache and the prompt-path loan still counts 32. `870aedd9` ("the prompt attention batch is budgeted where it is allocated, and stays 32 by default") unifies both through `attn_batch_for()` and moves the default back to 32 — but it lands **one commit after the v0.2.8 tag**, so it is not in the 0.1.54 binary that users download. **Why it matters to someone running the shipped build** Your own commit message describes the symptom on a single 32 GB Arc Pro B65 with the config setup writes: ``` device buffers for a chunk of 512 tokens do not fit (2098 of 32656 MiB free) ``` That is a first-request failure on a stock install of the released engine. Users who only consume the binary get 0.1.54, not `main`, so they get the mismatch and not the fix. **What I observed on my side (two cards, so it stays hidden)** Two Arc Pro B65, layer split 25, `--pipeline-windows 2`, 128 K context, Qwen3.8-Flash-Next-IQ3_S. Measured prefill at `STRATA_ATTN_BATCH` = 32 / 64 / 128, each with its own restart and warm-up: | batch | prefill (20 K cold, steady) | decode | VRAM card 0 / card 1 | ||||| | 32 | 1,336.4 tok/s | 57.3 / 57.7 | 30.77 / 29.69 GiB | | 64 | 1,338.4 tok/s | 57.1 / 57.7 | 30.77 / 29.69 GiB | | 128 | 1,356.4 tok/s | 57.2 / 57.8 | 30.77 / 29.69 GiB | On two cards the extra scratch is absorbed — VRAM is identical at all three values, because `max({gdn_set_bytes, qsa_set_bytes, moe_set_bytes})` is dominated by the MoE term here, so the under-estimate never surfaces. The 1.5 % prefill difference between 32 and 128 matches the 1.1–1.3 % you reported. I could not reproduce the failure with two cards; I am reporting the mismatch, not a reproduction of your single-card case. **Question** Is a rebuild of the SYCL engine planned so that 0.1.54-level users get `attn_batch_for()` and the 32 default, or should the docs recommend setting `STRATA_ATTN_BATCH=32` explicitly for single-card setups until then? I have been telling people the latter and would like to know whether that is the intended guidance.
bsakaguchi 2026-11-04 01:57:11 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 30, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6529117122 --> @github-actions[bot] commented on GitHub (Oct 30, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes". Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@udqe commented on GitHub (Oct 30, 2026):

Second data point, from the CUDA side: the mismatch is SYCL-only structurally, and a CUDA user on the shipped 0.1.54 binary is not exposed. Static reading of the installed tree plus one machine's experience, not a reproduction.

What the CUDA prefill does instead (src/prefill/prefill.cpp, our tree):

  • attn_batch is a fixed 32 (int64_t attn_batch = 32, cap = 0;, 1024) - there is no setter and STRATA_ATTN_BATCH does not appear anywhere in the CUDA file, so the 128 default that 09524eb4 introduced in sycl/src/prefill/prefill.cpp:737 has no CUDA counterpart.
  • Both sides of the CUDA pair use the same 32: carve() sizes the real scratch from m.attn_batch (1811) and the estimate that sizes the expert cache and the prompt-path loan passes the literal 32 (qsa_set_bytes(T, cap, max_blocks, 256, 32, s), 2573). So the CUDA tree cannot grow the 128-vs-32 gap even in principle - the allocator and the estimate move together.

Experience from one CUDA box: engine 0.1.54 as shipped by v0.2.8, 2x RTX 4090 layer split, 95 engine starts since mid-October, first-request-allocation failures never observed at contexts up to 307 K. Consistent with your framing that the failure is single-card + stock-config + SYCL.

One thing that supports your "source readers do not notice" point from our side: the main-branch zip a source reader downloads today already contains attn_batch_for() (with the qsa_set_bytes(..., attn_batch_for(T), ...) unification), while the binary v0.2.8 ships is 36f6663c-level. Reading current source makes the released bug invisible the same way reading it made the SYCL default look like 32 in your report before you pinned the commit. For binary users the release note, not main, is the truth about what is in the engine - worth one line somewhere for people chasing a first-request failure on a stock install. On the question itself: for SYCL users the env is the only lever the shipped binary offers, and pinning it to the value the estimate hard-codes is the right choice of number (a value above it would widen the gap, not close it) - we cannot confirm from the CUDA side whether the shipped SYCL binary still reads that setting, so that half stays with people who run it.

(AI-assisted: the model served by this repo's engine read the tree and drafted this; the line numbers are ours from the installed sources, the 95-starts figure is our engine's own session log.)

<!-- gh-comment-id:6529510389 --> @udqe commented on GitHub (Oct 30, 2026): Second data point, from the CUDA side: the mismatch is SYCL-only structurally, and a CUDA user on the shipped 0.1.54 binary is not exposed. Static reading of the installed tree plus one machine's experience, not a reproduction. What the CUDA prefill does instead (`src/prefill/prefill.cpp`, our tree): - `attn_batch` is a fixed 32 (`int64_t attn_batch = 32, cap = 0;`, 1024) - there is no setter and `STRATA_ATTN_BATCH` does not appear anywhere in the CUDA file, so the 128 default that `09524eb4` introduced in `sycl/src/prefill/prefill.cpp:737` has no CUDA counterpart. - Both sides of the CUDA pair use the same 32: `carve()` sizes the real scratch from `m.attn_batch` (1811) and the estimate that sizes the expert cache and the prompt-path loan passes the literal 32 (`qsa_set_bytes(T, cap, max_blocks, 256, 32, s)`, 2573). So the CUDA tree cannot grow the 128-vs-32 gap even in principle - the allocator and the estimate move together. Experience from one CUDA box: engine 0.1.54 as shipped by v0.2.8, 2x RTX 4090 layer split, 95 engine starts since mid-October, first-request-allocation failures never observed at contexts up to 307 K. Consistent with your framing that the failure is single-card + stock-config + SYCL. One thing that supports your "source readers do not notice" point from our side: the main-branch zip a source reader downloads today already contains `attn_batch_for()` (with the `qsa_set_bytes(..., attn_batch_for(T), ...)` unification), while the binary v0.2.8 ships is `36f6663c`-level. Reading current source makes the released bug invisible the same way reading it made the SYCL default look like 32 in your report before you pinned the commit. For binary users the release note, not `main`, is the truth about what is in the engine - worth one line somewhere for people chasing a first-request failure on a stock install. On the question itself: for SYCL users the env is the only lever the shipped binary offers, and pinning it to the value the estimate hard-codes is the right choice of number (a value above it would widen the gap, not close it) - we cannot confirm from the CUDA side whether the shipped SYCL binary still reads that setting, so that half stays with people who run it. (AI-assisted: the model served by this repo's engine read the tree and drafted this; the line numbers are ours from the installed sources, the 95-starts figure is our engine's own session log.)
Author
Owner

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

The fix is in the 0.2.9 Intel engine: the prompt attention batch stays at 32 by default, and the budget and the allocation now use the same number (870aedd9e). The 0.1.54 engine in 0.2.8 was built before that commit, as you found. We ran the 0.2.9 Intel engine on two Arc Pro B65 cards, but we didn't measure this mismatch on its own, so comment here if you still see it.

<!-- gh-comment-id:6541135623 --> @Niko1221 commented on GitHub (Oct 31, 2026): The fix is in the [0.2.9](https://github.com/Niko1221/Strata/releases/tag/v0.2.9) Intel engine: the prompt attention batch stays at 32 by default, and the budget and the allocation now use the same number (870aedd9e). The 0.1.54 engine in 0.2.8 was built before that commit, as you found. We ran the 0.2.9 Intel engine on two Arc Pro B65 cards, but we didn't measure this mismatch on its own, so comment here if you still see it.
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#2167
No description provided.