mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3308] [Engine] an optional line showing where each prompt chunk's time goes #4559
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#4559
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/3308
Author: @gopinath87607
Created: 10/20/2026
Status: 🔄 Open
Base:
main← Head:prefill-stages-trace📝 Commits (1)
782433fprefill: STRATA_PREFILL_STAGES (opt-in) prints where a prompt chunk's wall went📊 Changes
2 files changed (+176 additions, -1 deletions)
View changed files
📝
docs/DETAILS.md(+9 -0)📝
src/prefill/prefill.cpp(+167 -1)📄 Description
Problem and result
Without a stage line, a prefill change can only be judged by the prompt's ms/token, which mixes the chunk size, the copy lane, the host and the GPU's phases. After this change,
STRATA_PREFILL_STAGES=1(opt-in; unset is off) prints one line a stage a chunk showing where the chunk's wall went, so those parts can be told apart. It also turns the phase timer on. It is a diagnostic and claims no speedup.Related discussion
The original pull request and its discussion: #2831 (closed when its fork was deleted; this PR replaces it). The work comes from the Maya checkout (
project-maya), local commita34f57c, with its fixes04b8d65(the line's events are destroyed with the prompt path) and63b3690(the line reads only the events its chunk recorded). Its spellingSTRATA_GLM_PREFILL_STAGESis accepted as the same knob, so a config written for that checkout runs unchanged.Approach
STRATA_PREFILL_STAGES=1turns on the chunk's stage line: one line a stage a chunk with where the chunk's wall went - the chunk's wall, the copy lane's own span split into what ran before it (lead), the lane itself and what ran behind it (tail), the bytes it moved and the bytes the chunk's consumers waited on (the difference is the ring's read-ahead), the hand-off a later stage of a layer split paid, the GPU's own phases over the chunk, and the experts and host time it spent. It also turns the phase timer on.Unset (the default),
stages_on()is false: no line is printed, the phase timer is not read for it, and no extra sync is taken for it. The syncs the line does add when on wait only on copies the compute stream has already waited for (the issuer is joined when the chunk ends), soSTRATA_PREFILL_STAGES=0beside a--benchA/B is how you check it costs nothing. The default path is unchanged by construction.Validation
Tested revision:
782433f6(one commit on477ac13c; not rebased, and GitHub reports it merges cleanly with currentmaine88ee39d). Environment: Linux, CUDA 13.2; the development branch carriessm_86+sm_120builds.Passed:
-fsyntax-onlyonsrc/prefill/prefill.cppwith the build's own flags - clean.Failed:
Not run:
ninja -C build strataat this exact head: only the syntax check above was run at782433f6; the full build was of the development branch carrying the same change.STRATA_PREFILL_STAGES=1at this head: the line has not been observed here, so its output and its cost are unverified.--benchA/B that prices the line. The design keeps the cost at zero by waiting only on work already joined, but that is reasoning, not a measurement.Limits
--benchis the check.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.