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#4052
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/2458
Author: @MrKop-git
Created: 10/14/2026
Status: ❌ Closed
Base:
main← Head:pr/dump-kv-select📝 Commits (1)
5781936engine: --dump-kv-select, the decode windows' KV block selections as a trace for the policy bench (#2415)📊 Changes
5 files changed (+156 additions, -4 deletions)
View changed files
📝
docs/DETAILS.md(+7 -0)📝
include/strata/core/layer.hpp(+15 -1)📝
src/core/layer.cpp(+100 -1)📝
src/core/verify.cpp(+17 -2)📝
src/program/generate.cpp(+17 -0)📄 Description
Summary
The engine-side half of #2415 (the bench is #2434):
--dump-kv-select PATHrecords what the KV streaming page pool is actually asked for - one record per resolve call of the decode windows,int32 layer, int32 k, k int32 block ids, k float32 weights, the shapetools/replay_kv_stream_policy.pyreads.cudaStreamSynchronizeappends the records. Weights are 1.0 (the indexer's scores are not copied).kv_select_dump_open, before any window is captured - the first build died on exactly that (an allocation inside a capture poisons its stream).What it changes and what it leaves alone
The resolve wrapper gains a
dump_slotargument (the two verify call sites pass the QSA ordinal; the prompt path passes nothing), a small dump block in layer.cpp, a flush in verify.cpp after the window sync, and--dump-kv-selectplumbing in generate.cpp. Without the flag nothing runs and every answer is unchanged - the copies are the only new work, and they exist only when the flag is given.How it was checked
kv_stream_parityPASS (q4_0 and k8v4: 0 failures, ring restore identical) on a GTX 1080 Ti (sm_61,STRATA_EXPERIMENTAL_SM60=ON), CUDA build with g++-14.--dump-kv-select): a 127-token prompt → a 115 KB trace (348 calls), a 4095-token prompt → a 3.5 MB trace (684 calls, 441,848 block lookups, 12,586 distinct blocks). The engine ran unchanged otherwise (prefill 276 tok/s, decode 20.7 tok/s on this card).(misses; lower is better). So on real QSA selections LRFU beats the kernel's CLOCK by 3-4% of misses, LRU is worse than both, and Belady says more is on the table - the numbers #2415 asked for before anyone changes the default.
Not tested
HIP (no toolchain on this box; the .cu sources are shared with the HIP build) and SYCL (a separate engine tree with no dump). The
--batchwindow path keeps each layer's last call per window (documented in DETAILS.md). No wall-time claim from the miss counts - that is the live A/B #2415's next step, using the engine's ownKV streaming:line.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.