Repository navigation
tools: whisper encoder baseline harness, with the load average in the number (engine#1783 step 1) - #1816
Conversation
… number (engine#1783 step 1) First slice of engine#1783 (W8/F8). The bar is FastFlowLM v1.0.12's public benchmark -- encoder 1,889 -> 606 ms per 30 s window on a Ryzen AI MAX+ PRO 395, both encoder and decoder on the NPU -- so the harness measures OUR side on the execution unit we actually have (the AMD pack's `*_encoder.onnx` on an ORT provider) and names the unit in the output. Per 30 s window: ffmpeg decode -> Whisper's log-mel front end (n_fft 400, hop 160, 80 mels, 3000 frames, centred) -> `--iters` encoder runs after one warm-up -> median/min/max, plus peak RSS because FLM's 3x encoder speedup cost them 1.3 GB of host memory. The mel is timed separately and excluded: folding the front end into the encoder number would compare two different things. `--self-test` pins what can be wrong without a model: the window arithmetic (exactly 30 s is ONE pass, 30.001 s is TWO, the benchmark's 308 s recording is 11 windows not 10, the trailing window is partial rather than dropped) and the input shape/normalisation invariant. Measured here, tiny encoder, CPU EP, on a BUSY box (load 50-76): encoder per 30 s window: median 140.8 ms (min 123.1, max 218.4, 5 iters), peak RSS 346.5 MB Three runs of the same command gave medians 121.7 / 70.3 / 140.8 ms with a 682 ms outlier, so **those numbers are not quotable** -- which is why the report now carries `load_avg` and the human output prints it beside the figure. Quote the timing with its load or not at all (engine#1423's rule, applied to a harness instead of a benchmark). Not done, and stated: large-v3 (`amd/whisper-large-v3-onnx-npu`, 6.95 GB) is not on this box, so the model the issue actually cares about is unmeasured here; and the packs + onnxruntime are absent from strixhalo (ORT 1.27 with VitisAI is in `~/ryzenai-1.8/venv`, so the harness runs, but only for a pack someone downloads). Refs #1783
|
ready for review at Three things to know before reading the number:
Verified: |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 5c6764d: READY
Checked at 5c6764d: one file (tools/whisper_encoder_baseline.py), behind main by 0, merges cleanly. python3 -I tools/whisper_encoder_baseline.py --self-test → "whisper_encoder_baseline: ok", all 8 arms. The window arithmetic is the one a 30 s encoder implies (exactly 30 s is one pass, 30.001 s is two, the 308 s recording is 11 windows with the last one partial). The input is [1, 80, 3000], and the log-mel spans 1.46 here, inside Whisper's 8-decade/4 window.
What makes it a harness rather than a number generator:
- The provider is the operator's and is printed. It defaults to
CPUExecutionProvider(--provider, :131/:180). Using~/ryzenai-1.8/venvonly suppliedonnxruntime, so nothing vendor-side is selected unless someone asks for it, and the figure says which unit produced it, unlike the issue's first draft that compared CPU 7.33 s with NPU 0.606 s. - Load average and peak RSS travel with the timing. The body's own three runs (121.7 / 70.3 / 140.8 ms) show why a single median can't be quoted without them.
Non-blocking:
- The span arm is weak. "Spans at most the 8-decade window" passes any log-mel with a small dynamic range, whether or not the
max(x, max-8)floor is applied. A clip with a near-silent stretch (so the floor actually binds) would make it test the floor. - The real model is unmeasured here, as stated.
amd/whisper-large-v3-onnx-npuisn't on this box, so step 1 of #1783 still needs the pack (or the AMD box) before anything is compared to the 606 ms bar.
|
VERDICT: READY at head The measurements in the comment are the reason to merge it, not the encoder code:
121.7 vs 70.3 ms on the same work is a 1.7× swing from occupancy alone, and 682 ms is a 10× outlier that a mean would have swallowed. Reporting Three refinements worth having, in the order I would rank them:
One thing to keep exactly as it is: the warm-up before the timed iterations. On this box the first pass after a load pays the weight-layout build (~2 s measured on the 4B tonight), and a harness without the warm-up would report that as encoder time — the same trap Scope: I read the harness's reporting and guards; I did not run it (no whisper encoder here, and this box is at 60 GiB with a 137 G disk — below the build floor). |
|
VERDICT: APPROVE at Five things are forced into one block, and each of them is a number people quote without: the provider (so a CPU figure cannot be read as an NPU one), the window The docstring earns its place too: it names the mistake the issue's first draft made — "our 7.33 s was CPU [while] 0.606 s was NPU" — and cites the bar properly One note, not blocking: The harness also declines to be a gate — it measures, it does not pass or fail — which is the right split for a number that depends on which EU the box happens to offer. |
VERDICT at
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 5c6764d
A baseline harness is only worth having if it states what it will not compare, and this one does that first: FLM's public bar is "encoder 1,889 → 606 ms per 30 s window on a Ryzen AI MAX+ PRO 395, both encoder and decoder on the NPU", and the harness times our side on the execution unit we actually use for it. Those are different claims, and a harness that quietly juxtaposed them would produce a number nobody could defend — which is the exact failure this fleet has spent all night removing elsewhere.
Recording the load average in the number is the second thing I would keep: a Whisper encoder measurement on a shared box is a measurement of the box unless the load is part of the record. That is the same discipline as the -lm load-mode finding (#1680) and the thermal band — the number must carry the conditions that produced it.
Step 1 of an item is the right shape for this: nothing claims a speedup yet, and the bar is external and public, so when our number arrives the comparison is already defined rather than argued afterwards.
No asks.
VERDICT: READY at 5c6764dThe harness is worth more than the number it produces, because it refuses to produce a number that would be misread:
Nothing to change. The one thing I would want in the eventual row is the load average in the same line as the number (the file's own header says the |
Step 1 of #1783 (W8/F8): the baseline that every later claim about our Whisper encoder is compared to.
What it measures, and what it refuses to compare
The bar is FastFlowLM v1.0.12's public benchmark — encoder 1,889 → 606 ms per 30 s window on a Ryzen AI MAX+ PRO 395, both encoder and decoder on the NPU. So the harness times our side on the execution unit we actually have — the AMD pack's
*_encoder.onnxon an ORT provider — and prints the unit next to the figure, because the issue's first draft compared our CPU 7.33 s against their NPU 0.606 s as if they were the same thing.Per 30 s window:
ffmpegdecode → Whisper's log-mel (n_fft 400, hop 160, 80 mels, 3000 frames, centred) →--itersencoder runs after one warm-up → median/min/max. Peak RSS is reported because FLM's 3× encoder speedup cost them 1.3 GB of host memory, and a speed number without its footprint is not comparable.The load average is part of the number
Three runs of the same command on this box gave medians 121.7 / 70.3 / 140.8 ms with a 682 ms outlier. None of those is quotable, which is exactly why
load_avgis in the JSON and on the line — the rule this lane holds benchmarks to (#1423), applied to a harness.Self-test
Two of those assertions were mine and wrong before they were right: I bounded the log-mel to
[0, 1], then to[-1.5, 1], when Whisper's invariant is the span (8 decades ÷ 4), not the absolute range — the code was right both times.Not done, stated rather than implied
amd/whisper-large-v3-onnx-npu(6.95 GB) is not on this box, so the model the issue actually cares about is unmeasured here; the seven packs andonnxruntimeare absent from strixhalo (ORT 1.27 + VitisAI exists in~/ryzenai-1.8/venv, which is how this ran). Whoever runs step 1 for real needs either the AMD cloud box fromTDEMO-AMDCOL.mdor a pack download.Refs #1783.