mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #5470] [Engine] DS4_PROF_WIN: the decode profile of the drafter's verify windows, and the attention by part #5444
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#5444
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/5470
Author: @R-Okauchi
Created: 11/7/2026
Status: 🔄 Open
Base:
main← Head:dsv41-prof-win📝 Commits (4)
2f195efDeepSeek engine: DS4_PROF's chunked prompt fits its sample array againd863038DeepSeek engine: DS4_PROF_WIN, the decode profile of the verify windowsd963470DeepSeek engine: DS4_PROF splits a decode layer's attention into its parts2850437DeepSeek engine: DS4_PROF_WIN splits a verify window's experts into their stages📊 Changes
5 files changed (+73 additions, -14 deletions)
View changed files
📝
include/strata/dsv41/exl3.hpp(+4 -0)📝
src/dsv41/ds4_gguf.cu(+3 -0)📝
src/dsv41/ds4_main.cpp(+21 -4)📝
src/dsv41/ds4_model.cu(+42 -9)📝
src/dsv41/ds4_model.hpp(+3 -1)📄 Description
Problem and result
DS4_PROF=1times a decoded token's GPU work by stage, but only for windows of one token. With the drafter on, most ofa decode is the drafter's verify windows, and those go untimed. The attention is also a single number: 36.8 of a
token's 110.9 ms of GPU time on a DGX Spark.
With this PR,
DS4_PROF_WIN=1(besideDS4_PROF=1) also times the verify windows and prints them on lines of theirown, and both profiles split the attention into its parts. Without the variables nothing changes. #5170's command with
the drafter, on a DGX Spark (GB10):
A window of four tokens spends half of its GPU time waiting for the CPU lane's experts, which the token line alone
does not show.
Related discussion
#5170, where I used these numbers. No issue for the profile itself: it is an opt-in diagnostic.
This PR is stacked on #5127. Its first commit is #5127's change, without which
DS4_PROF=1aborts on any prompt thattakes the chunked pass, as this command's prompt does. Once #5127 is in, only the last three commits remain.
Approach
DS4_PROF_WIN=1profiles the drafter's verify windows too (spec_win). A short prompt's windows of 16 stay out. Awindow of more than one token adds its sample to
Stats::prof_win_ms, with the number of windows and their tokens,instead of
prof_ms.DS4_PROF_SYNC's host-clock path keeps them apart the same way.the rope, the core, and wo_a / wo_b) as stages 6-10, so
prof_msgrows from 6 to 12 entries. The first line stillgives the attention as the sum of its parts.
WinArgs::mark, set only while a window is profiled, lets the GGUF form'swin_expertsmark thestream after the gate / up, the down (stage 11) and the wait for the CPU lane.
prof_event, the part ofprof_markafter the Mac'sDS4_TLOGhost phases, so thosephases see the same marks as before.
Off the profile, the decode path gains five calls a layer that return at once, as the existing marks do, and a null
check in
win_experts.Validation
On one DGX Spark (GB10, 128 GB, driver 580.178.04, CUDA 13.0.2 in an Ubuntu 24.04 container, nothing else on the GPU),
with #5170's IQ2_XS pack. The binary was built from source with
spark/build_engine.sh's flags (sm_121 plus PTX):Passed:
stage filled (#5127's part). The 1,308-token prompt read at 162.99 tok/s. The 256 tokens decoded at 13.07 tok/s with
2.49 tokens a round, against 13.94 and 14.77 tok/s for main without the profile in the same session.
this run reaches:
DS4_PROF_WINnow takes only the verify windows, where 02cb609c also took a short prompt's windows of 16. Thisprompt took the chunked pass.
DS4_PROF_SYNCnow sums a verify window apart from the tokens. It was off here.DS4_TLOG. That is a Metal-only diagnostic.121-real;121-virtual) withspark/build_engine.sh's flags, on the Spark:strata-dsv41builds. There are no warnings in the changed files apart from three that main has too.
tools/dsv41/build_hip_linux.sh strata-dsv41 ds4_iq_testbuilds both.metal/with metal-cpp, targetstrata_ds4, builds, with no warnings in thechanged files.
Failed: none observed.
Not run:
DS4_PROF_SYNC=1withDS4_PROF_WIN=1, and the head's change to it.DS4_PROF_WIN=1.win_experts(vendor/exl3.cu) marks nothing inside, so there the window'sexperts would count in "the sum + post".
--paralleldecode steps of several conversations. They are not profiled, as before.Limits
those of a slightly slower run.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.