Skip to content

Reduce OmniVoice generation copies and add streaming timings - #1013

Merged
0xShug0 merged 1 commit into
mainfrom
perf/omnivoice-optimizations
Oct 20, 2026
Merged

0xShug0 merged 1 commit into
mainfrom
perf/omnivoice-optimizations

Conversation

@0xShug0

@0xShug0 0xShug0 commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Summary

Remove redundant copies in OmniVoice generation and add streaming component timings.

  • Use the existing FlashPreserveViews lowering for CUDA flash attention. Keep the current repeated K/V heads, F32 accumulation, masking, and scaling.
  • Borrow the runtime logits vector instead of copying it on every diffusion step.
  • Emit streaming generation/decoder/component timings, first-audio timing, and session.wall_ms through the existing framework profiler.

These changes apply automatically; no new options are introduced. The existing omnivoice.perf_mode default remains unchanged. All changes are local to OmniVoice, with no framework or ggml edits.

CUDA streaming performance

Baseline: main 0bf4d155, default model settings with omnivoice.perf_mode=flash_attention. Both sides use text chunks of 120 characters, the default 32 diffusion steps, and four threads. Hardware: RTX 5090, CUDA 12.9; Debug build with -O3 -g, CUDA graphs and OpenMP enabled. The existing build cache was reused.

Five paired rounds per workload, alternating A/B order. Values below are median RTF; lower is better. RTF uses synthesis session.wall_ms divided by final WAV duration and excludes model loading.

Workload Main + flash RTF PR RTF Change
Clone, short 0.15285 0.14548 -4.82%
Clone, medium 0.15793 0.15132 -4.19%
Clone, long 0.13672 0.13075 -4.37%
Voice design, short 0.08276 0.08072 -2.47%
Voice design, medium 0.07892 0.07564 -4.16%
Voice design, long 0.07321 0.06996 -4.43%

Duration-weighted RTF across all rounds: 0.10294 -> 0.09866 (-4.15%). All 30 paired streaming measurements improved. The five round totals improved by 4.92%, 4.06%, 4.48%, 2.84%, and 4.45%.

Main did not emit streaming component/session timings, so the measured baseline includes only the same timing instrumentation used by the PR. Six stock-main vs timing-only baseline WAV comparisons were byte-identical.

Validation

  • 55/55 candidate/baseline WAV comparisons byte-identical, using the existing CLI path-test and comparison tools.
  • Coverage includes BF16, F16 and Q8 GGUFs; clone and voice design; multiple chunks and longer single-chunk requests; Spanish; offline non-flash; layerwise mem_saver=true; and nonzero class-temperature sampling.
  • All inference and measurements ran sequentially in conda qwen3-tts, with logging enabled.
  • No observed peak-VRAM regression. Three paired rounds of additional 1 ms per-process NVML sampling showed short flash clone peaks of 2620 -> 2618 MiB, non-flash 2640 -> 2640 MiB, and sampled flash clone 2620 -> 2618 MiB. Savings are only a few MiB. Coarser 20 ms sampling missed a transient allocation in some baseline runs, so those apparent 76–80 MiB differences are not treated as regressions or savings.
  • git diff --check passes.

CPU and Vulkan runtime performance were not measured. Their attention lowering is unchanged; the common logits change only removes a host-vector copy. This does not claim universal parity across all hardware or inputs.

Local reproducibility artifacts, binaries, case files, comparison logs, and the full report are retained under logs/omnivoice-optimizations/ (not included in the PR).

@0xShug0
0xShug0 merged commit e296562 into main Oct 20, 2026
7 checks passed
@0xShug0
0xShug0 deleted the perf/omnivoice-optimizations branch October 20, 2026 21:22
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