Skip to content

feat(bench): per-backend RTFx with per-stage runtime breakdown - #34

Merged
ekhodzitsky merged 1 commit into
masterfrom
feat/rtfx-per-backend
Jul 10, 2026
Merged

ekhodzitsky merged 1 commit into
masterfrom
feat/rtfx-per-backend

Conversation

@ekhodzitsky

Copy link
Copy Markdown
Owner

Completes the measurement leg of the execution-provider track: the EP work (CoreML today, XNNPACK/NNAPI/CUDA later) is only provably valuable if realtime factor is reproducibly measurable per backend.

What changed

  • polyvoice-bench --execution-provider <auto|cpu|coreml|nnapi|cuda|xnnpack>. Omitted = each pipeline's shipped default (legacy embedder cpu, v2 auto), so committed DER baselines stay reproducible; an explicit value applies to the selected pipeline. Every report is labeled with resolved_execution_provider and host_cpus.
  • Per-stage runtime breakdown for v2. New pipeline_v2::StageTimings and Pipeline::run_with_timings(...) -> (DiarizationResult, StageTimings) — four Instant reads; run() delegates to it, public signature unchanged. Bench reports stage_timings per file + stage_totals aggregate (segmentation / embedding / clustering / resegmentation; VAD lives inside the powerset segmenter in v2, so no fake zero field).
  • scripts/bench-backends.sh — one dataset, one run per backend, one comparison table (RTFx, micro DER, runtime); extra bench flags via BENCH_ARGS. This reproducibility is the task's deliverable.
  • Report schema bumped polyvoice-bench-v0.8 → polyvoice-bench-v0.10, strictly additive (all existing fields unchanged). Workflow documented in src/bin/README.md.

Measured (deliverable proof, VoxConverse 3 files, M1)

requested resolved RTFx der_micro% runtime_s
cpu Cpu 11.17 11.78 56.45
auto CoreMl 11.15 11.78 56.54

Identical DER across backends (numerics unaffected), directly comparable RTFx, and the breakdown surfaces embedding as the dominant stage (33.9s vs 22.6s segmentation) — exactly the signal the EP track needs.

Verification

  • cargo nextest run --all-features: 425 passed (bench proptests included); clippy -D warnings + fmt clean.
  • End-to-end script run above; stage_totals / resolved_execution_provider / schema verified in the emitted JSON.

🤖 Generated with Claude Code

The EP work is only provably valuable if realtime factor is reproducibly
measurable per backend. polyvoice-bench recorded rt_factor but could not
select an execution provider, attributed nothing to a backend, and gave
no per-stage picture.

- polyvoice-bench: --execution-provider auto|cpu|coreml|nnapi|cuda|xnnpack.
  Omitted keeps each pipeline's shipped default (legacy embedder cpu,
  v2 auto) so committed DER baselines stay reproducible; an explicit value
  applies to the selected pipeline. Reports carry
  resolved_execution_provider and host_cpus.
- pipeline_v2: new StageTimings + Pipeline::run_with_timings (four Instant
  reads; run() delegates — public signature unchanged). The bench records
  stage_timings per file and a stage_totals aggregate for v2 runs; VAD has
  no separate stage in v2 (it lives inside the powerset segmenter).
- scripts/bench-backends.sh: one dataset, one run per backend, one RTFx
  comparison table; extra bench flags via BENCH_ARGS. Verified on
  VoxConverse (3 files): cpu and CoreML rows are directly comparable
  (identical 11.78% micro DER, RTFx 11.17 vs 11.15) and the breakdown
  shows embedding as the dominant stage (33.9s vs 22.6s segmentation).
- Report schema bumped to polyvoice-bench-v0.10, strictly additive over
  v0.8; src/bin/README.md documents the workflow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ekhodzitsky
ekhodzitsky merged commit 5473674 into master Jul 10, 2026
13 checks passed
@ekhodzitsky
ekhodzitsky deleted the feat/rtfx-per-backend branch July 10, 2026 14:50
ekhodzitsky added a commit that referenced this pull request Jul 31, 2026
The EP work is only provably valuable if realtime factor is reproducibly
measurable per backend. polyvoice-bench recorded rt_factor but could not
select an execution provider, attributed nothing to a backend, and gave
no per-stage picture.

- polyvoice-bench: --execution-provider auto|cpu|coreml|nnapi|cuda|xnnpack.
  Omitted keeps each pipeline's shipped default (legacy embedder cpu,
  v2 auto) so committed DER baselines stay reproducible; an explicit value
  applies to the selected pipeline. Reports carry
  resolved_execution_provider and host_cpus.
- pipeline_v2: new StageTimings + Pipeline::run_with_timings (four Instant
  reads; run() delegates — public signature unchanged). The bench records
  stage_timings per file and a stage_totals aggregate for v2 runs; VAD has
  no separate stage in v2 (it lives inside the powerset segmenter).
- scripts/bench-backends.sh: one dataset, one run per backend, one RTFx
  comparison table; extra bench flags via BENCH_ARGS. Verified on
  VoxConverse (3 files): cpu and CoreML rows are directly comparable
  (identical 11.78% micro DER, RTFx 11.17 vs 11.15) and the breakdown
  shows embedding as the dominant stage (33.9s vs 22.6s segmentation).
- Report schema bumped to polyvoice-bench-v0.10, strictly additive over
  v0.8; src/bin/README.md documents the workflow.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ekhodzitsky added a commit that referenced this pull request Jul 31, 2026
The EP work is only provably valuable if realtime factor is reproducibly
measurable per backend. polyvoice-bench recorded rt_factor but could not
select an execution provider, attributed nothing to a backend, and gave
no per-stage picture.

- polyvoice-bench: --execution-provider auto|cpu|coreml|nnapi|cuda|xnnpack.
  Omitted keeps each pipeline's shipped default (legacy embedder cpu,
  v2 auto) so committed DER baselines stay reproducible; an explicit value
  applies to the selected pipeline. Reports carry
  resolved_execution_provider and host_cpus.
- pipeline_v2: new StageTimings + Pipeline::run_with_timings (four Instant
  reads; run() delegates — public signature unchanged). The bench records
  stage_timings per file and a stage_totals aggregate for v2 runs; VAD has
  no separate stage in v2 (it lives inside the powerset segmenter).
- scripts/bench-backends.sh: one dataset, one run per backend, one RTFx
  comparison table; extra bench flags via BENCH_ARGS. Verified on
  VoxConverse (3 files): cpu and CoreML rows are directly comparable
  (identical 11.78% micro DER, RTFx 11.17 vs 11.15) and the breakdown
  shows embedding as the dominant stage (33.9s vs 22.6s segmentation).
- Report schema bumped to polyvoice-bench-v0.10, strictly additive over
  v0.8; src/bin/README.md documents the workflow.
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