mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#2904
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/903
Author: @Zauberio
Created: 10/5/2026
Status: ❌ Closed
Base:
main← Head:prefill/equal-chunks📝 Commits (1)
0bf4603prefill: a prompt reads in equal chunks; a short streaming tail stays📊 Changes
6 files changed (+720 additions, -3 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)📝
include/strata/prefill/prefill.hpp(+3 -0)📝
src/prefill/prefill.cpp(+1 -0)📝
src/program/generate.cpp(+16 -3)📄 Description
Rebased variant of @architectds's equal-chunk idea from #693 — the idea and the original data are theirs; the
auto:16384sweep part of the original is superseded by #583's bisection, so this keeps only the chunk-splitting change. q8atnight asked for a fresh PR against main before adding a 3090 row (#693), so here it is.What this does
request_chunkcurrently returnsmax_chunkfor every full chunk and lets the tail be whatever is left. This splits a segment into equal chunks instead:n = ceil(tokens / max_chunk)chunks ofceil(tokens / n), rounded to 256 — with one exception kept from the current behavior: when the last piece would fall belowPrefill::stream_all_min_tokens(), full chunks + short tail stay, because a sub-threshold tail moves only the experts its own tokens route to, while equal chunks would all stream every expert (measured: 16,402 tokens in 3 equal chunks read 22% slower than 2 × 8,192 + 18).The cost model is the streaming threshold: a chunk at or above
stream_all_min_tokens()streams every expert the GPU does not hold (~1.7 s each on PCIe 3.0, whatever its length), so a long prompt's cost is its number of such chunks — a bigger chunk pays only where it saves one, and equal chunks borrow no more slots than that count needs.Measured (RTX 5070 Ti 16 GB, Windows, IQ3_S,
--prefill auto:32768, engine built frommainat6f32ec0)Two binaries — stock main (
97E3A38E…) and this patch (4088639E…), same toolchain, same base commit. ABBA swap-boot legs (cross-boot variance here is ~5%, single boots prove nothing), 3 greedy probes per leg, steady-state runs averaged:The 40K row is a built-in null control: bisection's tail rule keeps the layout identical there, so its +1.1% is pure build-pair drift — call the real gain ≈ +3% at 22.6K, marginal at 26.6K, zero where the layout doesn't change. Consistent with the original 5070 Ti claim (+2.2% at 20,036).
bench/results/2026-10-03-prompt-chunks/carries the raw ABBA JSON and needle probes.For @q8atnight
--prefill 6144this never fires (the rule only re-splits totals above the threshold), so nothing changes there.Honest caveat: not bit-identical
Different chunk boundaries shift accumulation order, so a fixed prompt's greedy continuation differs between builds (both coherent, needles retrieve). Anything asserting exact tokens across prefill layouts will need updating — per your gate rule this needs a fresh long-gate reference before adoption, which is exactly what we're not claiming here.
Safety on constrained boxes
This never raises a chunk above what bisection picked — it only splits an already-chosen total into equal pieces (22,588: 20,224+2,364 → 11,520+11,068). On layer-split / low-RAM boxes the chunks get smaller, not bigger.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.