#4334 [Engine] STRATA_HOST_TIMELINE host-timeline split + summary-time draft-profiler flush (opt-in, measurement only)
open · @xyzzing · 0 评论 · 去 GitHub 看
Server & APIAMD / HIPNVIDIA / CUDADocumentation
说明
**2026-11-21:** rebased onto current main (3142b66b, v0.2.17-era, engine 0.1.63) — the branch had gone CONFLICTING after the 0.2.16 layout move (`src/`/`include/` → `engine/src/`/`engine/include/`) and the 0.2.17 release. All 3 commits replayed with 0 conflicts; per-commit diffstat identical to the previous head; the `STRATA_HOST_TIMELINE` markers verified at the new paths (`engine/src/core/verify.cpp`, `engine/include/strata/core/verify.hpp`, `engine/src/program/generate.cpp`); the settings-register commit regenerated on the new layout (`terminal/data/settings-register.json`, register tests 8/8 + docs check green); 723-target gfx1100 HIP build rc=0. ## Problem and result Two measurement gaps on the decode path, both hit during a real investigation of "where do 24 ms/round of ring waits go" on gfx1100: 1. The MTP draft profilers (`STRATA_DRAFT_TIMING`, `STRATA_MTP_PROFILE`) auto-report only every 300 rounds, so a one-shot run (one workload, ~100 rounds) never prints them — the per-round draft cost was invisible in every one-shot cell. 2. The host's per-round timeline was unsplit: the verify-window block showed a single "rings" share, which we and others read as "GPU idle 87-91%" — a misread that sent us down a dead optimization path for a day. The host timeline split shows what the rings actually are: 48 handoff slices of ~0.51 ms each, with the GPU ~87% *busy* executing layer work during them. After: with `STRATA_HOST_TIMELINE=1` the verify-window block carries a per-layer host-phase split (adapt/slot/pool/remote/flags/bal), window-level capture/stage/launch times, and a ring-spin count + histogram + max. With the summary-time flush, the draft profilers print on every run that ends, not just every 300th round. Both are opt-in and zero-cost when off. ## Related discussion none — no existing issue covers the one-shot profiler visibility or the host-timeline split; the numbers below come from our measurement campaign. ## Approach - `STRATA_HOST_TIMELINE=1` (default off): static `getenv`, branch-guarded `Clock::now()` calls around the host phases and the window stages; the report prints under the existing verify-window block. Measured cost when ON against the production binary on our lineage: −0.6% (inside the ±6% single-run noise floor), i.e. the instrument does not move what it measures. - Summary-time flush: the two draft profilers' report moves to a `profile_flush()` called at the one-shot summary site, next to the existing GPU stage report; the 300-round auto-report stays for long runs. - No default-path change: all env off = no clocks taken (the guard reads the env once at start). Compatibility: opt-in diagnostics only; no flag, config, or output changes when the env vars are unset. ## Validation **Passed:** - `ninja -C build-pr -k 0 -j 6` on this branch (HIP, gfx1100, ROCm 10.2 nightly SDK, upstream main `5e8a4cca` + the three commits): builds clean, binary links. - Smoke on the built binary, production config one-shot: with `STRATA_HOST_TIMELINE=1 STRATA_DRAFT_TIMING=1 STRATA_MTP_PROFILE=1` the run prints the host-timeline block under the verify-window report and flushes both draft profilers at summary (exact lines in the run log); with the env unset the same binary prints none of them and the output matches the pre-branch binary's sections. - On our production lineage (0.1.48.1 fork, the same three commits): three paired instrument-on/off/production-binary cells (instrumentation −0.6% vs the production binary), then the full step-0 split measured with it: rings = 4,992 spins, 99.7% under 1 ms, max 1.5 ms, mean 0.51 ms/layer; host work 3.8 ms/round, all of it the remote-expert serve; the GPU-side confirmation came from the existing per-stage report. **Failed:** none observed. **Not run:** SYCL and Metal builds — no SYCL toolchain on this AMD-only box and Metal is macOS-only (per-PR CI here builds neither; our fork CI compiles CUDA and HIP in vendor containers, see the run linked in the thread). CUDA is now compile-validated on this branch head (run 40592368748, both containers green). The paired zero-cost measurement was rerun on our lineage, not on upstream main (the smoke above covers function, not the cost number). ## Limits - The host-timeline report names the host's phases only; the GPU-side stage table (existing `STRATA_VERIFY_PROFILE`) is what confirms what the GPU does during the spins. The two together are the complete picture. - The ring-spin histogram is per-window granularity (count + max + a coarse histogram), not a full distribution dump. - `STRATA_HOST_TIMELINE` stays opt-in default-off by design; we offer it as a measurement instrument, not a default. --- **2026-11-06:** rebased onto main (9f7d977d2) — force-pushed. Three keep-both conflict resolutions (upstream's STRIX-TDR probe block and dispatch-stats call, and the prompt-room API block in mtp.hpp, all retained; the timeline additions re-anchored beside them). The rebased tree builds fully on main: 549 targets, rc=0, gfx1100 HIP. Series note: the middle commit's tree alone does not compile (the `profile_flush` declaration rides in the third commit, completing it) — the tip is the reviewable state. The CUDA compile-validation run cited below was on the previous head; the fork CI re-runs on this push. The smoke and zero-cost measurement remain from the 0.1.48-era lineage as stated. **2026-11-17:** rebased onto current main (c77572806, v0.2.15-era, 1261 commits since the 11-06 base) — 3 commits replayed with 0 conflicts this time (upstream moved the regions again; per-commit diffstat identical to the previous head, `mtp.hpp` byte-identical at the tip, the STRATA_HOST_TIMELINE blocks verified present in `verify.cpp`/`verify.hpp`/`generate.cpp`); 668-target gfx1100 HIP build rc=0. The series note from 11-06 still holds (the middle commit does not stand alone). **2026-11-17, later the same day:** upstream's new settings register (data/settings-register.json + tools/test_settings_register.py, added between 0.2.9 and v0.2.15) flagged the PR's knob: first CI run failed tools on all three OSes with `test_engine_reads_nothing_unregistered`. A fourth commit registers STRATA_HOST_TIMELINE (status research, owner core — the same class as STRATA_VERIFY_PROFILE/STRATA_DRAFT_TIMING) and re-scans the register on this base so the recorded read-site line numbers follow the branch. `tools/test_settings_register.py` 8/8 and `tools/check --only docs` 6/6 green locally on the new head.
本站相关内容
相关页面的快捷入口。