mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #5273] [Engine] guard KVA stream-plan access for short prefill chunks #5371
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#5371
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/5273
Author: @zapabob
Created: 11/5/2026
Status: 🔄 Open
Base:
main← Head:codex/fix-kva-small-chunk📝 Commits (1)
8f7470afix(engine): avoid absent KVA stream plans for short chunks📊 Changes
1 file changed (+12 additions, -6 deletions)
View changed files
📝
src/prefill/prefill.cpp(+12 -6)📄 Description
KVA's MoE, GDN state-only and QSA state-only exits index
seq_start[l + 1]even whenstream_allis false. The vector is populated only for the full streaming path. With--prefill 512below the 1024-token streaming threshold, an approximated chunk can therefore dereference an empty vector.Guard only the three stream-plan consumption/release pairs with
if (stream_all). State advancement, QSA indexing, KV prefetch and the early exits stay where they were. The active streaming path executes the same release operations. No defaults, arithmetic or KVA approximation settings change.This is a draft because exact upstream-tree compilation and the other affected backends have not been verified.
Validation performed:
kva_testpassed in the Windows fork. Hardware: RTX 5060 Ti 16 GB, Ryzen 5 4500, 32 GB RAM, CUDA 13.3, sm_120.STRATA_KVA=1,STRATA_KVA_SPLIT=1,STRATA_KVA_MIN_PROMPT=512,STRATA_KVA_SUFFIX=64, withSTRATA_KVA_SKIP=stateand thenmoe. These are branch/crash checks, not retrieval-quality measurements.83959903089c536a16a85cb14261070b05d1cb892f42d6b059bab61b238b21e7, containing these same guards. They were not runs of this exact upstream PR tree.git diff --check HEAD~1 HEADpassed for this branch.Failure and limits:
The original fork executable crashed with Windows
0xc0000005on the first approximated chunk of a 98,016-token request. Its crash dump resolved a null-vector read inPrefill::run_impl. After repair, a separate full-input rerun reached 96,256 processed tokens, but the PC became unresponsive and the user manually restarted it. There is no completed answer from that run; the cause of the host hang is unresolved. No 98K completion or speed improvement is claimed.Not run: exact upstream-tree CUDA build/execution, HIP, SYCL, and a complete streaming/non-streaming regression matrix. Targeted backend verification is needed before review readiness.
The patch is based on upstream
ffa80d73133ea5c548aefe57889a16e8085a938f. Open and closed discussions were searched forseq_startandKVA crash; the returned HIP/long-prompt discussions concern different paths.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.