Skip to content

test: add gemv per-dispatch overhead micro-bench#23

Merged
TheTom merged 1 commit into
devfrom
tom/test/dispatch-overhead-bench
Jun 23, 2026
Merged

test: add gemv per-dispatch overhead micro-bench#23
TheTom merged 1 commit into
devfrom
tom/test/dispatch-overhead-bench

Conversation

@TheTom

@TheTom TheTom commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

What

Adds a single micro-bench test (the last functional leftover from the combined backends branch #20) measuring gemv dispatch overhead two ways on the same Apple GPU:

  • per-commit: one command buffer per op (~275 us/dispatch at 2048x2048)
  • batched: many ops in a single command buffer (~22 us/op)

This quantifies what the batched-on-command-buffer Ops.gemv(weight:input:on:) API saves on the decode hot path. No correctness threshold, prints the numbers and passes in under a second, so it is CI-safe.

Context

The bulk of #20 already landed via #15-#22. The remaining unique source was already on dev under relocated paths (e.g. Stats/Perplexity.swift is the same as the merged Telemetry/Perplexity.swift); this bench was the one genuinely new functional file. Per scoping, docs and Nemotron research notes are intentionally left out, and the stale IndirectDispatchTests (which targeted a kernel variant removed in the reorg) is dropped.

Test

swift test --filter DispatchOverheadBench passes locally (M5, 0.88s).

Measures the gemv dispatch overhead two ways on the same Apple GPU: one
command buffer per op (per-commit) versus many ops batched into a single
command buffer. Quantifies the cost the batched-on-command-buffer Ops API
saves on the decode hot path (per-commit ~275 us/dispatch vs batched
~22 us/op at 2048x2048). No correctness threshold, prints the numbers and
passes; runs in under a second.
@github-actions github-actions Bot added the test Tests only — no behavior change label Jun 23, 2026
@TheTom
TheTom merged commit bcc5bd6 into dev Jun 23, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Tests only — no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant