mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4740] [Engine] expose per-request decode pipeline diagnostics #5156
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#5156
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/4740
Author: @marshr00m
Created: 10/30/2026
Status: 🔄 Open
Base:
main← Head:codex/pipeline-decode-diagnostics-refresh📝 Commits (3)
23de4bd[Engine] expose per-request decode pipeline diagnosticsa805764[Engine] validate decode diagnostic reports and clarify scopeaa7bd3aMerge remote-tracking branch 'origin/main' into codex/pipeline-decode-diagnostics-refresh📊 Changes
4 files changed (+261 additions, -4 deletions)
View changed files
📝
docs/MULTI_GPU.md(+28 -0)📝
serve/server.py(+20 -1)➕
serve/test_decode_diagnostics.py(+185 -0)📝
src/program/generate.cpp(+28 -3)📄 Description
Problem and result
With
--pipeline-windows 2, a request can still decode serially when repetition penalties or coupled draftsampling are active. The existing warning is printed once per reason, so an API client cannot associate the
chosen path with each response or tell whether two timing measurements used the same decode loop.
With the opt-in
STRATA_DECODE_DIAGNOSTICS=1, the Flash-Next solo serve path reports the selected loop and itsreason in
timings.decode_segments. For example:Without the option, the engine emits no new fields. No sampling defaults or pipeline eligibility rules change.
Related discussion
No issue is claimed as resolved. Checked related open and closed PRs again on October 31; no equivalent
request-level loop/reason API was found. #3631 traces serial decode windows and excludes the pipeline loop;
#2697 adds request tracing;
#4334 adds a host timeline and draft-profiler output; #4197 preserves native error logs. These measure or preserve
other information. #3760 proposes a third pipeline window; this patch targets current main's zero-to-two range.
Approach
Append optional key/value fields to the existing DONE statistics and parse them in the server. The server does
not infer execution from requested settings. Keep native segments in order across continuations rather than
presenting the final segment's path as the entire request. A missing report next to reported segments is unknown.
modeidentifies the dedicated decode loop, not GPU utilization or measured overlap.nonemeans neither loopran; the prompt tail may still emit tokens. Engines started with
--batchomit this diagnostic even for requestsprocessed on their solo path, because admission statistics are not the whole slot request. Old engines keep
their existing response shape. Unknown or contradictory window/reason combinations are ignored.
Validation
Base:
870aedd9e1ebe1c91f94da93b59af17729f6c5c0(Strata 0.2.8 / engine 0.1.54).Candidate:
aa7bd3a159e95ad0330d622dc0ddbb79040775d1; tracked tree0922b168226e4c5d7a842dfcd2ce80475f36a3c0.Windows 11 10.0.26200, Python 3.14.2; MSVC 19.44 for the host-only native fixture.
Passed:
serve.test_decode_diagnostics,serve.test_request_accounting,serve.test_answer_speed,serve.test_serverandserve.test_responses: 429 tests, no failures, 4 existing skips, 132.803 s. These ranon an isolated main-plus-patch tree before integration; the integrated candidate's complete tracked Git tree
matches that tested tree exactly. The runner uses a writable temporary directory and periodic stack dumps.
HTTP, thinking-budget continuations, cancellation, legacy DONE lines, mixed/missing reports, and 14 contradictory
serial window/reason combinations without retaining the previous request's report.
MSVC
/std:c++17 /EHsc /W4 /WX; 17 cases and their corrected-Python parser round trips passed. The reportingblock is unchanged from the earlier candidate. Inputs simulate startup/loop facts; this is not GPU failure-path
execution or a complete native-engine build.
serial / windows=2 / not_requested; the corrected parser omitsthat diagnostic while preserving the existing numerical statistics.
git diff --check, patch applicability checks, clean checkout, and GitHub comparison: main is fully includedand the PR diff is limited to the four intended files.
Captured output from the API regression run:
Historical native reference: on October 30, source
23de4bd24c6eb2a1bfb2c349835e7aad1c8fdb36against base46c152a1310f77cd2f0ce2c7cd213962df14fe83built and linked all 169 CUDA steps for sm_86/sm_120. Real RTX 3070 +RTX 5070 Ti requests checked pipeline/penalty/coupled paths and cancellation recovery, with 22 controlled output/count
comparisons matching baseline. Those runs used IQ3_S, 8/40 split, 128K, int8 KV, MTP, 20 GiB expert RAM and direct I/O.
They are retained as earlier-version evidence, not a full native validation of the newly integrated source.
Failed:
in their dated validation records and are not presented as candidate failures or successes.
Not run:
covers the old source only; HIP and Metal have no matching local toolchains. Keep this PR in draft until the
affected-backend checks can be completed; targeted help is needed. SYCL uses its own unchanged generator and
no SYCL engine-side diagnostic support is claimed.
fixture inputs do not reproduce device/startup failures.
Limits
Unbatched Flash-Next serving only; a
--batchengine and the separate SYCL generator do not report this field.Thinking-budget continuations use mock HTTP, not a real-model thinking-loop test. Historical output equality
was demonstrated only under documented fixed controls, not every setting or the newly integrated engine.
These checks do not tightly bound overhead or establish a speedup. No performance change is claimed.
Individual runs, configurations, output hashes and exact commands are retained with the validation records.
Local reproduction entry points include
verify_tests.pyandverify_native_reporting.py; the standalonenative-reporting-fixture.cppcontains the compiled reporting fixture.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.