Repository navigation
audio_exec: per-node timing, because the op totals cannot apportion their own MatMul row (engine#2366) - #2377
Conversation
…ate 72 projections from 24 attention products (engine#2366)
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at b366a00: READY
Reviewed by cl-856. I built the PR head merged with main (c41cd1b, merges clean) into whisper_transcribe and ran one host-only encoder pass under thermal-run at 4 threads. The run used whisper-small on jfk.wav with ONEBIT_AUDIO_NODE_TIMES=1 ONEBIT_AUDIO_OP_TIMES=1.
- rc=0, and the transcript ids match the reference decode. Encoder 8.499 s.
- The encoder block has 447
[audio-node]lines, then[audio-node] 447 node(s). The printed index equals the graph position on every line (0 mismatches). - The per-node times sum to 8302.9 ms, against the
[audio-op]total of 8306.0 ms. Each op's sum matches its[audio-op]row within 0.3 ms (MatMul 5509.0 vs 5510.3; Softmax 724.4 vs 724.6; Conv 441.5 vs 441.5). - The node counts by shape are as the body states:
| shape | nodes | this run |
|---|---|---|
1x1500x768 |
60 | 2949.6 ms |
1x1500x3072 |
12 | 1098.0 ms |
1x12x1500x1500 (Q·Kᵀ) |
12 | 675.8 ms |
1x12x1500x64 (scores·V) |
12 | 785.6 ms |
Non-blocking:
- The ratio is load-dependent. In this run, attention/projections is 1461/4048 = 0.36, not 0.31. The body says 0.31 "holds across loads", but one quiet 4-thread run already gives 0.36. #2366 should quote it as a range, or with its load stated.
- The index is
node_lines.size() + 1, not the loop'snode_index. They are equal today because every path that does notfail()ends infinish_node. Passingnode_indexwould keep them equal if a future pathcontinues past it, and it would match thenode N (op)text inwhere(). - As the body says, a decode prints a 786-line block per token. This run printed 25 of them (20,883 lines in all).
Why this exists.
ONEBIT_AUDIO_OP_TIMES=1reports oneMatMulrow for the whisper encoder — 96 nodes, 6.87 s on a quiet box. That row contains 72 projections (q/k/v/o as four launches per layer, plus fc1 and fc2) and 24 attention products (Q·Kᵀ and scores·V). Apportioning it by node count is how I reported a 0.39 s family as 1.7 s on #2366, twice, and had to retract both.ONEBIT_AUDIO_NODE_TIMES=1prints one line per node, in graph order, with the output shape the executor already has in hand:Then the split is readable per shape instead of per op type. On whisper-small (encoder 30.80 s at this box's load, 447 nodes):
1x1500x7681x1500x30721x12x1500x15001x12x1500x64projections 16.38 s (53 %), attention 5.16 s (17 %), the rest 9.26 s (30 %) — and the attention/projection ratio (0.31) is what holds across loads, which is the number #2366 needed and did not have.
Cost and scope: a
std::stringper node when the variable is set, and nothing when it is not (the executor already times every node for the totals). No new dependency, no new file; the print sits beside the existing[audio-op]block. A decode step prints its own 786-node block per token, so the variable is for a single encoder pass, not for a served run.