mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1231] [CLOSED] kv-grow: a run that cannot lend cache slots maps the whole window up front instead of writing past its first 16K cells #3326
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#3326
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/1231
Author: @BlueKingMuch
Created: 10/6/2026
Status: ❌ Closed
Base:
main← Head:kv-grow-no-lend📝 Commits (1)
8845ff4Elastic K/V: a run that cannot lend cache slots maps the whole window up front; its table uploads wait for the copy📊 Changes
1 file changed (+17 additions, -3 deletions)
View changed files
📝
src/program/generate.cpp(+17 -3)📄 Description
With
--kv-growthe K/V is made elastic at session init and maps its first 16,384 cells (STRATA_KV_GROW_INIT).Growing needs more than that: a device residency table, cache slots and a loan above the floor of 128 slots.
When a run lacks one of them,
kvg_startleaves the growth off and nothing ever maps more, so a prompt past 16K writes K/V into unmapped memory.This is @sergqwer's fix from #378 (
d5ee0cc), which the port into 0.1.40 does not have, cherry-picked onto 0.1.40.1 with him as the author:cudaMemcpymay return before its DMA lands, and the streams that read the table are non-blocking).Reproduced
On 0.1.40.1 (
82f46a8): RTX 4080 SUPER 32 GB, Windows 11, IQ3_S, 262K context, int8 K/V,--kv-grow --expert-cache 80(102 cache slots, below the floor), one conversation of 30,000 tokens and then three turns of +2,300:prefill copy_i32: an illegal memory access was encounteredThe second part (the uploads) did not fail here; it is in the PR because it is part of the same fix in #378.
cc @sergqwer
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.