Skip to content

Improve Qwen3 and Breeze TTS streaming and Breeze longform voice consistency - #858

Merged
0xShug0 merged 3 commits into
mainfrom
feature/streaming-improvement
Oct 10, 2026
Merged

0xShug0 merged 3 commits into
mainfrom
feature/streaming-improvement

Conversation

@0xShug0

@0xShug0 0xShug0 commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Resolves #856

Changes

  • Add Qwen3 TTS incremental audio streaming and shared TTS streaming lifecycle/chunk-policy helpers. Growing chunks start at one frame and reach the configured limit.
  • Improve Breeze streaming latency through graph reuse and direct KV-cache prefill; use one depth-decoder lane when CFG=1, including offline generation.
  • Preserve Breeze longform voices by using the first generated text chunk as a fixed reference for later chunks. Supplied-reference cloning and single-chunk requests retain their behavior.

Validation

  • CUDA longform: Nemotron diarization identifies one speaker after conditioning, versus eight labels across 13 text chunks before. ASR found no missing-word deletions in the tested outputs.
  • Voice-consistency change: streaming RTF 0.2495 -> 0.2494; peak VRAM 7472 -> 7644 MiB. Offline RTF 0.2513 -> 0.2547 in a single comparison.
  • Supplied-reference longform cloning and single-chunk checks remain byte-identical; repeated requests remain deterministic. Vulkan multi-chunk generation passes ASR and diarization checks.

CFG=1 single-lane decoding changes sampling trajectories, so its outputs are not byte-identical to the previous two-lane path. Framework changes are opt-in; LFM, PocketTTS and Irodori are unchanged.

@0xShug0
0xShug0 merged commit f3279c7 into main Oct 10, 2026
6 checks passed
@0xShug0
0xShug0 deleted the feature/streaming-improvement branch October 10, 2026 05:31
0xShug0 pushed a commit that referenced this pull request Oct 10, 2026
* webui: load only the entry a panel's request is for

A review of the LFM2.5-Audio conversation panel after it merged found
three things to fix in the page's hook for a panel with requestMode
'panel'.

With UI management, the function that loads the entry for a panel read
the selection again after each wait. Press Run on an S2S entry that is
not loaded, then pick another entry in the Model select while it loads:
the page unloaded the entry it had just loaded and loaded the newly
selected one in streaming mode. The function now gets the entry of the
request. After each wait it checks that this entry is still selected;
if not, it stops with "The model changed while it loaded; press Run
again." instead of loading the other one. The panel had this message
for after the load; it now comes from the page. One short wait is left
as it is: the page's doLoad, which every model's Run uses, reads the
selection again after it unloads another loaded model.

On a server with a config file the panel did not call the page's
ensureLoaded. So after the user imported settings that differ from the
configured model, the panel still ran a turn, where the page refuses
other requests with "The imported model settings require a reload
through the server configuration." The run context's function, now
named ensureLoaded, calls the page's ensureLoaded on such a server, and
the panel calls it on both kinds of server. For an entry that the
server does not list, the panel now shows the page's message too.

The hook was described as general, but it checked the speech-to-speech
inputs itself: that source audio is chosen and that no recording is
running. The panel makes these checks now, from the sourceFile and
sourceRecording props the page already passes to panels. It throws the
error that the context's new warning() makes, and the page shows it as
a warning like its own. The run context no longer carries the question.

The warnings read as before, and nothing changes for the other panels.

* webui: fix issues in the LFM2.5-Audio conversation panel

Fixes from a review of the conversation panel after it merged. They
are all in the panel's own files.

- The conversation is a Svelte store. It was a module object, and only
  the panel that ran a turn drew it again. With UI management, press
  Run on an entry that is not loaded, open the Models tab and come back
  before the load ends: the panel mounted on the way back kept showing
  "loading the model" after the run bar said "Cancelled.", until the
  next Run. Every mounted panel now sees each change, and the refresh
  calls are gone.
- A Run with another entry, such as JP after EN, cleared the
  conversation before anything was checked. So a turn that failed at
  once lost it: the model did not load, the question did not decode,
  or the user pressed Cancel. The turns now stay until the new turn is
  done, and that turn then starts the new conversation.
- For an S2S entry under an id that is not the catalog's, the panel
  takes the family's ASR options out of the request. It decided this
  from the parameter props after the load and the upload, when they
  can be those of another entry the user selected meanwhile. Then the
  ASR options went out and the server rejected the turn. The options
  are now made when Run is pressed.
- Starting a turn stopped only the live player. A player of an earlier
  turn, or the Result column's, went on under the new reply, and the
  Result column's player did not stop a reply that played live. When
  the reply is to play as it streams in, Run now pauses the page's
  audio and video players, and any player that starts stops the live
  reply.
- A stream event whose audio the live player could not use failed the
  turn, though the result has the whole reply. Live playback now stops
  for that turn and the turn finishes. With live playback on, the
  Runtime log says why, and the panel's note says that live playback
  is not available. The note used to say that the browser cannot play
  the stream.
- With turns of one entry listed and another entry selected, the
  header said they go with the next question, while the note said Run
  starts a new conversation. The header does not count them now, and
  their Leave out and Include buttons are disabled until their entry
  is selected again.
- Each stream event updated the turn list, read its layout and set the
  status line: about 50 times a second in a test on an M3 Ultra. The
  list is now updated when text arrives, when the first audio comes
  and when the turn's state changes. The status line changes with each
  whole second of the reply, as in "Streaming the reply: 12 s".
- Three checks that could not fire are removed: for a stream that ends
  without a result (taskStreamEvents throws then), for a conversation
  reset during a turn (it cannot be while the page is busy), and the
  try around source.stop() (each source is started before it is kept).

* webui: rebuild the page

Rebuilt from this branch's source with the lockfile (node 24.19.0,
npm 11.17.0):

  cd webui/native
  npm ci
  npm run build

#858 and #859 changed the Qwen3 TTS, Breeze TTS and Higgs Audio TTS
model specs without rebuilding the page, so this rebuild also brings
those changes into the page.
0xShug0 added a commit that referenced this pull request Oct 26, 2026
…1090)

* BreezeTTS: decode each depth frame in one CUDA graph

On CUDA, the 15 depth-decoder codebook steps of a frame now run as a
single ggml graph with an in-graph KV state and on-device top-k/top-p
Gumbel-max sampling, instead of one graph launch and host round trip
per codebook. The semantic sampler's torch RNG offsets are advanced as
the per-step path would, so the semantic stream is unchanged.

The offline path now prefills the backbone straight into the decode
cache, as the streaming path already does since #858, which removes
the per-request KV export/import. On CUDA the backbone and depth
graphs are also kept between requests, and the whole-cache bf16
re-rounding after each cache update is skipped when the K/V rows are
already bf16-rounded, the cache is F16 and flash attention is used
(an identity there; output is bit-identical).

Other backends keep the per-codebook depth path, the reference
rounding and the per-request graph release.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* BreezeTTS: make the fused depth graph opt-in via perf_mode

Add breeze_tts.perf_mode=off|cuda_perf with breeze_tts.fused_depth and
breeze_tts.keep_decode_graphs, following the fish_drama3 and minimax_music3
controls. Both default to off, so CUDA keeps the per-codebook depth path and
releases decode graphs after each request unless the preset or an explicit
option enables them.

The fused graph now uses flash attention for the codebooks that attend over
its in-graph K/V, like the per-codebook path's cached decode, and embeds from
the device token embedding when it holds the f32 table's exact values instead
of uploading a second f32 copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* BreezeTTS: sample the fused depth graph from the torch RNG stream

Feed the fused graph the per-codebook sampler's own torch exponential draws,
indexed by token, so cuda_perf picks the same tokens as the per-codebook path
for the same seed. Skip the per-codebook depth runtimes when the fused graph
replaces them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* BreezeTTS: release decode graphs after each request again

Drop keep_decode_graphs. Keeping the backbone and depth graphs resident
between requests held the largest request's buffers and raised peak VRAM
by about 7% for at most a few percent of speed, so cuda_perf now enables
only the fused depth graph and frees the graphs like main does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* BreezeTTS: put direct prefill and cache-round skipping behind perf_mode

Offline direct prefill and skipping the identity bf16 re-rounding of the
F16 KV cache were always on. They do not change output, but they change
the default execution path, so make them opt-in like fused_depth:
breeze_tts.direct_prefill and breeze_tts.skip_cache_round, both false by
default and enabled by perf_mode=cuda_perf, CUDA only. With them off,
offline prefill goes through the same export/import path as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Use configured arena budget for Breeze fused depth graphs

---------

Co-authored-by: Fishballllllll <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: 0xShug0 <[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.

fix seed and/or voice using audiocpp_server

1 participant