Skip to content

Batch Drama3 streaming codec frames and overlap decoding with AR generation - #1065

Merged
0xShug0 merged 1 commit into
mainfrom
perf/drama3-batching-b8dc1580
Oct 23, 2026
Merged

0xShug0 merged 1 commit into
mainfrom
perf/drama3-batching-b8dc1580

Conversation

@0xShug0

@0xShug0 0xShug0 commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Changes

  • Batch Drama3 streaming codec frames and overlap codec decoding with AR generation on the dedicated codec backend. The queue is bounded, worker errors propagate, and generation waits for all audio before completing.
  • Default to fish_drama3.codec_batch_frames=4 and fish_drama3.codec_async_decode=true. Batching starts with one frame and flushes the final partial batch. Set these options to 1 and false to select one-frame synchronous decoding.
  • Extend the Fish DAC codec to retain causal state across different batch sizes, with session-owned cached graphs and a bounded graph cache.
  • Add optional prepacked transposed-convolution matrices, enabled for Drama3 streaming batches on supported GPU backends. Other callers retain the existing path unless they explicitly request prepacking.
  • Update the spec, model documentation, and model-local acceptance for existing GGUFs. Offline decoding, AR sampling, weight formats, and expert-offload policy are unchanged. No GGML changes.

Performance

RTX 5090, Debug C++17 builds, eight threads, the same Q4-expert/F16-tower GGUF and reference voice. Two fresh sessions per version/backend/mode, each with one warmup and three distinct 262–266-character clone requests, run sequentially. Settings: seed 42, temperature 1, top-k 4097, top-p 0.9, context 4096, text chunk size 2000. All outputs stopped naturally.

The comparison is main d19c748b versus this branch with only the codec batching/overlap commit applied. Both use their default codec scheduling. Warm RTF uses summed session.wall_ms divided by summed generated duration, excluding warmup; peak VRAM includes startup and warmup.

Backend / mode Main warm RTF PR warm RTF Main peak VRAM PR peak VRAM
Full CUDA 0.222 0.183 24,280 MiB 24,368 MiB
CUDA CPU-weight offload, eight slots, pinned host weights 0.514 0.473 7,462 MiB 7,560 MiB
Full Vulkan 0.360 0.259 23,660 MiB 23,746 MiB
Vulkan CPU-weight offload, eight slots, pinned host weights 0.706 0.618 6,818 MiB 6,908 MiB

RTF reductions are approximately 17.4%, 7.9%, 28.2%, and 12.5%, respectively. Peak VRAM increases by approximately 86–98 MiB. The codec remains on the GPU in both offload configurations.

Validation And Limits

  • All four requests per session, including warmup, produced matching frame counts and durations before/after within each backend/mode. All waveform samples were finite.
  • WAVs are not byte-identical. Minimum before/after waveform cosine was 0.9999917 for full CUDA, 0.9999932 for CUDA offload, 0.9999963 for full Vulkan, and 0.9999948 for Vulkan offload.
  • These measurements validate the combined default batching/overlap change; they do not isolate the contribution of each optimization.
  • The patch adds codec batch/state-transition coverage and prepacked transposed-convolution coverage. The measurements above are end-to-end server runs, not a claim that the full test suite was run.
  • No ASR quality evaluation, long-form stress validation, or full-model CPU/Metal/HIP execution was performed in this pass.

@0xShug0
0xShug0 merged commit 2f6c70b into main Oct 23, 2026
7 checks passed
@0xShug0
0xShug0 deleted the perf/drama3-batching-b8dc1580 branch October 23, 2026 22:13
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