mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #693] [CLOSED] prefill: auto:16384 tries every 1024 tokens above 8192, and equal chunks - prompts 21-38% faster from 20K on a 16 GB card #2769
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#2769
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/693
Author: @architectds
Created: 10/3/2026
Status: ❌ Closed
Base:
main← Head:pr/prompt-chunks📝 Commits (1)
107e34dprefill: auto:16384 tries every 1024 tokens above 8192, and a prompt reads in equal chunks📊 Changes
7 files changed (+762 additions, -15 deletions)
View changed files
➕
bench/results/2026-10-03-prompt-chunks/README.md(+65 -0)➕
bench/results/2026-10-03-prompt-chunks/ab.json(+552 -0)➕
bench/results/2026-10-03-prompt-chunks/needles.json(+83 -0)📝
docs/DETAILS.md(+25 -0)📝
include/strata/prefill/prefill.hpp(+3 -0)📝
src/prefill/prefill.cpp(+1 -0)📝
src/program/generate.cpp(+33 -15)📄 Description
The problem.
stream_all_min()) streams nearly every expert the GPU does not hold,whatever its length. So a long prompt's cost is its number of such chunks.
--prefill auto:16384(#282), auto tries only 16,384 and then falls back to 8,192. A card whose cache can lend13,312 but not 16,384 reads every prompt in 8,192-token chunks.
The change.
auto:limit, and takes the largestchunk whose buffers fit under the same lend cap as before.
auto:16384, a card where 16,384 fits sees no change.auto:32768, the sizes between 16,384 and 32,768 become candidates too.to 256). For example, 20,036 tokens read as 3 × 6,912, not 2 × 8,192 + 3,652.
stream_all_min(). That chunk moves only the experts itsown tokens route to, so 16,402 tokens still read as 2 × 8,192 + 18. Equal chunks there measured 22% slower.
Prefill::stream_all_min_tokens()exposes the threshold, so the rule followsSTRATA_PREFILL_STREAM_MIN.Scope.
generate.cpp:request_chunk, the auto size list inplan_lend, and the layer split'spick, which uses the same list.--prefill auto, which setup writes, keeps its 8,192 limit; only (2) applies there.--prefill Nis unchanged, apart from (2).Correctness.
4,171 and 4,163 expert slots: the answer can change with which experts the cache holds.
--prefill auto:16384.Measured.
KV.
prompt speed.
bench/results/2026-10-03-prompt-chunks.--prefill auto--prefill auto:16384Not measured: AMD, multi-GPU, and
auto:32768on cards where 16,384 fits but 32,768 does not.Overlap: #547 changes the byte count behind
lend_slots, on the lines just aboverequest_chunk. The two editdifferent lines, and with #547 a larger chunk can fit more often.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.