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#2519
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/235
Author: @enkynakamura
Created: 9/30/2026
Status: ❌ Closed
Base:
main← Head:window-logprobs-hook📝 Commits (1)
92e64c2verify: STRATA_LOGPOS hook for per-position teacher-forced log-probabilities📊 Changes
3 files changed (+64 additions, -0 deletions)
View changed files
📝
include/strata/core/verify.hpp(+9 -0)📝
src/core/verify.cpp(+41 -0)📝
src/program/generate.cpp(+14 -0)📄 Description
Adds Verifier::window_logprobs and a call to it in read_windows, enabled only when STRATA_LOGPOS= is set. Every token read through the verify windows gets one tab-separated line: pos target logprob top top_logprob hit extra_logprob target_logprob_without_extra, where row t is the head's distribution at pos0 + t and the target is the prompt's own token at pos0 + t + 1. STRATA_LOGPOS_EXTRA (default 248046, <|im_end|>) is reported separately and taken out of the last column, because on raw text in a user turn a chat model puts much of its mass on the end-of-turn token.
Checked:
Built on v0.1.29 (
d6708a4), CUDA 13.3, RTX 5080, Windows. A 32k probe dump (2931 rows) from this branch is byte-identical (md5 3e97790a…) to the dumps from v0.1.26, v0.1.28 and v0.1.29 built with the earlier revision of the hook.Earlier, on the revision in #84: rows are aligned (top-1 equals the target only at shift 0), no periodicity per window, and a cross-check against llama.cpp on the same token ids (same top token in 9 of 11 positions, close log-probabilities).
Cost when enabled: 10.4 ms per token read from the windows, measured on 631c3d8. When disabled: one null check per window.
Not checked: the HIP build (the hook only uses cudaMemcpy/cudaMemcpyDeviceToHost, as the existing STRATA_DBG_NAN block does), and the layer-split path (forwarding plus OnDevice; I have a single GPU).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.