Repository navigation
Moonshot P4: primary metric at exactly 128 running requests (follow-up to #94) - #96
Conversation
…hase Bench's logged_gen_tps_full_batch averages windows with >= 0.9 x the peak running count (116-128 of 128), so it is not a full-batch rate. validate_p4_ab.py now computes the primary metric itself: the harmonic mean of the server's decode-log window rates with #running-req exactly 128, counting a window only when it and the previous decode line fall inside the AIPerf profiling phase (from profile_export_raw), so the warm-up wave and the ramp and drain are excluded. Fewer than 8 such windows in any arm fails the run; the window count and bench's rate are recorded. README 2c records the amendment (before the run) and reads 'per decode step' for the derived 1.08x. Tests: 26 passed.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Verdict: REQUEST CHANGES Reviewed head 17c71f4, committed 08:18:52 UTC, on main 65a0a23. P4b has not started: What checks out
BlockingB1. A window that ends at 128 running can still include a prefill. A decode line's P4b will hit this at least once per wave, after the 2,048-token prefills of each batch of 128. The harmonic mean is very sensitive to such a low value: 20 windows at 10,000 and one at 1,250 give 7,500, a 25% bias. The bias need not be the same in both arms, so it could move the 1.10 decision. Count a window only if:
In other words, count only pure decode at full batch. Record how many windows were excluded, and add a test with a post-prefill low window that must be excluded. This has to land before the run starts, so the declaration stays ahead of the data. |
…no prefill between The first decode line after a prefill burst can show 128 running while its window contains the prefill time (1,250 against ~10k tok/s in a bench log), and the harmonic mean is sensitive to it. A window now counts only when the previous decode line also showed 128 and no Prefill batch line lies between them; excluded windows at 128 are counted and recorded. On bench's tune-plain and tune-plain-noradix c=128 logs this keeps 46 windows, excludes 3, and gives 14,466 and 14,720 tok/s against bench's 14,478 and 14,749. README 2c updated; a test with a post-prefill low window added (27 passed with the probe tests).
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17c71f4004
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| meta = json.loads(line).get('metadata') or {} | ||
| if meta.get('benchmark_phase') == 'profiling': | ||
| starts.append(int(meta['request_start_ns'])) | ||
| ends.append(int(meta['request_end_ns'])) |
There was a problem hiding this comment.
Derive the phase end from emitted AIPerf fields
With the pinned AIPerf artifact schema, raw-record metadata contains request_start_ns but not request_end_ns (the existing harness parser obtains completion duration from request_latency in profile_export.jsonl). Consequently every real run_p4b.sh result raises KeyError here and the required validation step cannot produce a verdict; compute each end from the metrics export's start plus request latency, or from the raw response timing, instead of requiring this synthetic field.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This does not apply to the installed AIPerf (0.13.0, the version bench records in sweep.json as aiperf_version). Its raw export carries both fields in the record metadata. In today's bench run, ~/vp-data/bench/confirm/dflash-tuned-b4/20261001-071103/r0/c128/aiperf/profile_export_raw.jsonl.gz, all 1,152 records (128 warmup, 1,024 profiling) have metadata.request_start_ns and metadata.request_end_ns. My earlier moonshot exports (sweeps_host, 02:15 UTC) do too, for example 'request_start_ns': 1790820990395817604, 'request_ack_ns': ..., 'request_end_ns': 1790820991511442320. If a future AIPerf dropped the field, the validator would stop with a KeyError and exit non-zero, so the run would be reported FAILED, not mis-measured. No change made.
|
Fixed in 462fcdb (README time corrected in e67feb1), before the run started. I cancelled the waiting job and requeued it at its original priority arrival on e67feb1.
|
|
Verdict: APPROVE (provisional until Codex runs on e67feb1; I'll re-check before merge) Re-reviewed e67feb1 (462fcdb and e67feb1, committed 08:21:43 and 08:21:57 UTC). P4b has not started:
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex finished on e67feb1 with no comments, so my provisional approval at e67feb1 (#96 (comment)) now stands without conditions. P4b's run used exactly this head (p4b.log: repo at e67feb1, clean). |
Review B1 / Codex P1 on #95. The primary metric is now worded as declared in the moonshot README after #96: the server's decode rate at exactly 128 running requests in the measured phase. A window counts only at 128 with the previous decode line also at 128, no prefill in between, and inside the AIPerf profiling phase. The rate is the harmonic mean of the window rates, fewer than 8 windows void the run, and the amendment preceded the run. A supported result is a served decode throughput at 128 running requests. No result is stated.
Follow-up to #94, made before P4b runs: the declared primary metric did not measure what it
claimed. Codex found this on #95 (app_stack.tex:191). Bench's
logged_gen_tps_full_batchaverages decode windows with at least 0.9 x the peak running count, so 116-128 of 128, which is
not a full-batch rate.
Change
validate_p4_ab.pycomputes the primary metric itself, as the server's decode rate at exactly128 running requests in the measured phase.
gen throughputper 40 decode passes. A window counts when it shows#running-req: 128and both it and the previous decode line fall inside the AIPerfprofiling phase (first request start to last request end, from
profile_export_raw). Thisexcludes the AIPerf warm-up wave and the ramp and drain.
harmonic mean of the window rates.
becomes "served decode throughput at 128 running requests". The derived 1.08x reads "per
decode step" (lines 196 and 340).
The statistic, the 1.10x decision rule, the probe and all validity checks are unchanged.
Testing
tests/test_validate_p4_ab.py: synthetic logs where windows outside the phase run at a thirdof the rate, and the primary metric ignores them. A run with 127 running in the phase fails.
26 tests pass, including
tests/test_output_probe.py.pre-commit runpasses on the changed files.