Skip to content

bench: HRX batched decode on Qwen3-Coder-30B-A3B at the current pin (engine#612 item 2) - #643

Merged
bong-water-water-bong merged 2 commits into
mainfrom
i612-hrx-batch
Oct 30, 2026
Merged

bong-water-water-bong merged 2 commits into
mainfrom
i612-hrx-batch

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Item 2 of engine#612: every batched HRX row in the issue was measured at an older pin, so this
re-measures 1bit serve --parallel N on the model the issue names, at this one, and commits both the
records and the harness that produced them.

The rows

Qwen3-Coder-30B-A3B-Instruct-Q4_K_M.gguf (18 556 689 568 B, sha256 fadc3e5f…), ctx 8192,
engine 38e29a2 + this branch's item-1 commit (b78868c), HRX llama-server 40c4ccb76.
Wall clock per request, tokens from usage.completion_tokens, greedy, n_predict=128, distinct
prompts, 5 repeats, median with min/max. Every run inside
~/.local/bin/gpu-hold -l "pi i612" -t 20 (it queued 184–1048 s behind other agents; nothing else
was on the GPU while it held).

--parallel solo, 1 stream N streams: aggregate per stream N / solo
1 84.2 tok/s (loads: 81.75–88.34) — — 1.00x
2 84.22 62.96 31.49 0.75x
4 84.46 91.11 22.81 1.08x
8 84.02 112.89 (100.10–116.02) 14.32 1.34x

Reproduced across two independent runs (REPS=3: 62.51 / 86.35; REPS=5: 62.96 / 91.11 / 112.89).
llama-server's own counters agree that the streams really are one batch — identical per-token times
on every slot (tg = 34.95 t/s on both slots at np=2, 24.88 on all four at np=4) — so this is not
a measurement artifact.

Why --parallel 2 is a loss, as far as the evidence goes

A two-row decode batch costs 29.0 ms/token per stream against 11.9 ms for one row: the per-row cost
rises when the second row arrives. The obvious suspect is the vectorised decode-split pass
(engine#124), and the control supports it: with ONEBIT_HRX_DECODE_SPLIT=0 the same --parallel 2
server gives 57.59 tok/s aggregate from a 45 tok/s solo (1.18x), i.e. without the split the
second row still helps; with it, per-stream drops to the non-split rate and the aggregate lands below
solo. I am not claiming the mechanism as settled — that is a follow-up, not this row.

What this says about the issue's numbers

The on-record 138.1 tok/s / 1.64x at N=8 does not reproduce at this pin; the 2026-10-29 pass's
121.27 / 1.39x is close to what I see (112.89 / 1.34x, with a wide spread across repeats). The
solo baseline itself does reproduce (~84–88 tok/s here, 86.96 on record), so the batching ratio, not
the raw decode rate, is what moved.

Files

  • bench/npu-leaderboard/coder30b-hrx-{solo,parallel2,parallel4,parallel8}-20261030.json — the four
    records (tools/npu_leaderboard.py validates and ranks them).
  • docs/npu-leaderboard.md — regenerated by tools/npu_leaderboard.py, not edited by hand.
  • tools/showcase-612-hrx.sh — the harness: one server load per N, each load measuring one stream
    and N streams at once, servers killed by pid, GPU work documented to run under gpu-hold.

Verified: tools/npu_leaderboard.py --check → 13 records valid; the script re-run end to end on
np=8 (solo 81.75, 8 streams 107.60, 1.32x) before committing it.

Refs #612.

…engine#612 item 2)

`1bit serve --parallel N` measured again, because every batched row in #612 was
from an older pin. Four leaderboard records (solo, parallel 2, 4, 8) from one
harness run at engine 38e29a2 + i612-npu-streams (b78868c) and llama.cpp
40c4ccb76, plus tools/showcase-612-hrx.sh, the script that produced them: one
server load per N, each load measuring one stream and N streams at once, wall
clock per request with usage.completion_tokens, greedy, 128 tokens, five
repeats as a median with min and max.

What it says, and it is not the on-record story: at this pin two streams leave
the engine slower in aggregate than one (62.96 tok/s against 84.22, 0.75x) --
a two-row decode batch costs 29.0 ms/token per stream where one row costs 11.9
-- four streams only recover the baseline (91.11, 1.08x), and eight reach
112.89 tok/s (1.34x). The on-record 138.1 tok/s / 1.64x does not reproduce;
with ONEBIT_HRX_DECODE_SPLIT=0 the same --parallel 2 server gives 57.59 from a
45 tok/s solo, so the split path stops paying once a second row is in the batch.

Refs #612.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY (posted as a comment: GitHub refuses --request-changes/--approve on a PR owned by the same account).

Records, generator and script all check out against the raw run on this box.

The four records are the run's numbers, not rounded or re-typed. ~/lb/612-hrx-20261030T064957Z/run.log:

streams=1 ... aggregate_tps=84.22 (min 77.09 max 84.34) per_stream_tps=84.27 wall_s=1.52   # --parallel 2
streams=2 ... aggregate_tps=62.96 (min 60.06 max 65.55) per_stream_tps=31.49 wall_s=4.07
streams=1 ... aggregate_tps=84.46 (min 78.26 max 84.85) per_stream_tps=84.50 wall_s=1.52   # --parallel 4
streams=4 ... aggregate_tps=91.11 (min 82.74 max 94.17) per_stream_tps=22.81 wall_s=5.62
streams=1 ... aggregate_tps=84.02 (min 78.03 max 84.25) per_stream_tps=84.07 wall_s=1.52   # --parallel 8
streams=8 ... aggregate_tps=112.89 (min 100.10 max 116.02) per_stream_tps=14.32 wall_s=9.07

every metric.value and solo_same_server_tok_s in bench/npu-leaderboard/coder30b-hrx-{solo,parallel2,parallel4,parallel8}-20261030.json is one of those, and the ratios re-derive: 112.89/84.02 = 1.343 (record says 1.34x), 91.11/84.46 = 1.079 (1.08x), 62.96/84.22 = 0.748 (slower than one stream, as the record says). The solo row's 84.2 is the mean of 84.22/84.46/84.02.

docs/npu-leaderboard.md is what the generator produces, not a hand edit. tools/npu_leaderboard.py regenerates it and the file is byte-identical to the committed one (diff empty), and tools/npu_leaderboard.py --check -> 13 record(s) valid. New rows sit in the file's existing order (Qwen3-4B, then Qwen3-Coder-30B, values descending): 112.89, 91.11, 84.2, 62.96.

The script: bash -n clean, no pkill, servers killed by pid (srv=$! ... kill "$srv"; wait), a failed arm is reported as a failed row rather than divided (arm() raises SystemExit on any dead stream), and the median with min/max is what the records quote. One nit, not a blocker: there is no trap, so Ctrl-C during a run leaves the server on :18081 up; the NPU script in #640 has a trap (though see my note there about it never firing).

The batched-4 row says 1.08x aggregate and the 8-stream row admits its own spread (100.10-116.02) and that the on-record 138.1 tok/s / 1.64x does not reproduce at this pin — that is the kind of record that stays honest after the pin moves.

@bong-water-water-bong
bong-water-water-bong merged commit 86a6979 into main Oct 30, 2026
7 of 8 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the i612-hrx-batch branch October 30, 2026 14:05
bong-water-water-bong added a commit that referenced this pull request Oct 30, 2026
The demo is three rows with three builds and two devices, so the reproducible
thing is one command per row plus a table of what each row proves. This drives
them: `rows` prints the table, and each row execs the script that measured it
(tools/showcase-612-npu-streams.sh from #640, tools/showcase-612-hrx.sh from
#643) so a row is one command and its output carries its own pin, repeat count
and timestamp. The hybrid row has no script of its own and says why.

Refs #612.

Co-authored-by: bong-water-water-bong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant