[PR #1864] [CLOSED] [Engine] Show adaptive waits in the serial decode timing sum #3725

Closed
opened 2026-11-07 15:30:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1864
Author: @SanghunYun
Created: 10/10/2026
Status: ❌ Closed

Base: main ← Head: decode-timing


📝 Commits (1)

  • 4f78949 Include adaptive waits in the serial decode timing sum

📊 Changes

2 files changed (+36 additions, -10 deletions)

View changed files

📝 docs/DETAILS.md (+9 -0)
📝 src/program/generate.cpp (+27 -10)

📄 Description

Problem and result

With STRATA_DECODE_TIMING=1, the serial decode line adds up verify + commit/emit + draft. Main already times the adaptive wait before verify and the join after draft, but those values come after the sum, so the named sections do not add up to ms/window. On v0.1.42 this gap was about 12 ms/window on a 4,489-token prompt.

After this change, the serial line lists the existing counters in the order they run, plus a remainder:

before: 100.00 ms/window = verify 60.00 (...) + commit/emit 1.00 + draft 15.00; per layer-window: ...; adapt wait 5.00 join 10.00, 4.0 swaps/window
after:  100.00 ms/window = adapt wait 5.00 + verify 60.00 (...) + commit/emit 1.00 + draft 15.00 + adapt join 10.00 + other 9.00; per layer-window: ...; 4.0 swaps/window

other is the total minus the named sections, not a separate timer.

#1863 reported this gap on 2026-10-11; 1aa0abf6 added the wait/join counters citing it. This PR puts them into the sum. You said in this thread on 2026-10-17 that a small rebased PR would be accepted.

Approach

Only the timing-report block and docs/DETAILS.md change. No new timers or clock reads are added, and the values are the same dt_adapt_wait / dt_adapt_join as before. The pipeline line (--pipeline-windows) keeps its current format. With timing off, nothing is printed, as before.

Compatibility: a script that parses the serial line from ms/window = verify must accept ms/window = adapt wait. No parser in this repository reads it.

Validation

Passed:

  • Rebased on v0.2.2 011c9e60 (= main today); applies without conflicts, the commit is unchanged (git range-diff).
  • CUDA sm_86 (CUDA 13.4) and HIP gfx1100 (ROCm 7.10.0) Release builds of strata on Linux, v0.2.2 + this commit, link; no warnings in the changed block.
  • The actual report block compiled with -Wformat=2 -Werror=format and run on fixtures: serial order, sum and swaps/window (4, including a negative remainder), pipeline output byte-identical to main (4), no output with timing off or zero windows (8).
  • The rest of generate.cpp is byte-identical to v0.2.2.
  • Default path (STRATA_DECODE_TIMING unset): the changed block is not entered (the fixtures above) and nothing outside it changes (the byte comparison), so the engine runs exactly as v0.2.2.

Failed: none observed.

Not run: model inference on this revision; SYCL (it builds its own copy of generate.cpp, which this PR does not touch); Windows; HIP on a GPU.

Limits

Batch slots are not covered. The times are host wall time, not GPU copy time.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1864 **Author:** [@SanghunYun](https://github.com/SanghunYun) **Created:** 10/10/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `decode-timing` --- ### 📝 Commits (1) - [`4f78949`](https://github.com/Niko1221/Strata/commit/4f78949653df7a4660a3b2392c530ec328e28d1d) Include adaptive waits in the serial decode timing sum ### 📊 Changes **2 files changed** (+36 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `docs/DETAILS.md` (+9 -0) 📝 `src/program/generate.cpp` (+27 -10) </details> ### 📄 Description ## Problem and result With `STRATA_DECODE_TIMING=1`, the serial decode line adds up `verify + commit/emit + draft`. Main already times the adaptive wait before verify and the join after draft, but those values come after the sum, so the named sections do not add up to `ms/window`. On v0.1.42 this gap was about 12 ms/window on a 4,489-token prompt. After this change, the serial line lists the existing counters in the order they run, plus a remainder: ```text before: 100.00 ms/window = verify 60.00 (...) + commit/emit 1.00 + draft 15.00; per layer-window: ...; adapt wait 5.00 join 10.00, 4.0 swaps/window after: 100.00 ms/window = adapt wait 5.00 + verify 60.00 (...) + commit/emit 1.00 + draft 15.00 + adapt join 10.00 + other 9.00; per layer-window: ...; 4.0 swaps/window ``` `other` is the total minus the named sections, not a separate timer. ## Related discussion #1863 reported this gap on 2026-10-11; `1aa0abf6` added the wait/join counters citing it. This PR puts them into the sum. You said in this thread on 2026-10-17 that a small rebased PR would be accepted. ## Approach Only the timing-report block and `docs/DETAILS.md` change. No new timers or clock reads are added, and the values are the same `dt_adapt_wait` / `dt_adapt_join` as before. The pipeline line (`--pipeline-windows`) keeps its current format. With timing off, nothing is printed, as before. Compatibility: a script that parses the serial line from `ms/window = verify` must accept `ms/window = adapt wait`. No parser in this repository reads it. ## Validation **Passed:** - Rebased on v0.2.2 `011c9e60` (= main today); applies without conflicts, the commit is unchanged (`git range-diff`). - CUDA sm_86 (CUDA 13.4) and HIP gfx1100 (ROCm 7.10.0) Release builds of `strata` on Linux, v0.2.2 + this commit, link; no warnings in the changed block. - The actual report block compiled with `-Wformat=2 -Werror=format` and run on fixtures: serial order, sum and swaps/window (4, including a negative remainder), pipeline output byte-identical to main (4), no output with timing off or zero windows (8). - The rest of `generate.cpp` is byte-identical to v0.2.2. - Default path (`STRATA_DECODE_TIMING` unset): the changed block is not entered (the fixtures above) and nothing outside it changes (the byte comparison), so the engine runs exactly as v0.2.2. **Failed:** none observed. **Not run:** model inference on this revision; SYCL (it builds its own copy of `generate.cpp`, which this PR does not touch); Windows; HIP on a GPU. ## Limits Batch slots are not covered. The times are host wall time, not GPU copy time. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:30:20 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3725
No description provided.