Skip to content

mtmd: support pocket-tts - #26871

Merged
ngxson merged 18 commits into
masterfrom
xsn/pocket-tts
Aug 11, 2026
Merged

mtmd: support pocket-tts#26871
ngxson merged 18 commits into
masterfrom
xsn/pocket-tts

Conversation

@ngxson

@ngxson ngxson commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Overview

Most of the discussions happen here: ngxson#108

We decide to support this model after initial Qwen3-TTS support, because it starts to move away from discrete audio codes to passing continuous embd. Supporting continuous embd between stages will be important for future models like chatterbox.

Some decisions / trade-off are taken to make sure the impl isn't too invasive and doesn't add too much complexity for future models:

  • Most of the hparams are hard-coded on C++ side --> less single-use-case model-specific GGUF metadata added, and fixes can be deployed in the future without reconverting GGUF
  • mtmd_helper_gen_audio manages the stop condition based on pipeline type. This is because models based on continuous embd doesn't use sampling
  • Default generation params (top k/p, temp) are supplied per-model

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: yes with human supervision (see the updated README-dev)

ngxson and others added 13 commits August 5, 2026 02:00
ggml_conv_transpose_1d has no grouped mode, so the depthwise upsample
was built as one convolution and one concat per channel, which floods
the graph with small nodes and makes kernel launches dominate the
decoder.

Fold both cases into the column form the seanet decoder already needs:
the general case reshapes the kernel to [IC, K * OC] and matmuls it
with the input, the depthwise case batches a matmul over the channels
so a step scales its own kernel. A single col2im_1d then scatter-adds
the columns back to the signal, with the same shape as before, so the
overlap-add tail, the streaming state and the bias are untouched.

Generation time per frame drops by 80% on CUDA and by 50% on CPU. The
output matches the previous implementation sample for sample, with a
correlation of 0.999994 and identical frame counts.
The language packs also tune the end-of-speech padding and the padding
of short prompts, next to the temperature already carried in the
mmproj: french_24l asks for 8 tail frames instead of the guessed 3,
english_2026-01 asks for short prompts to be padded with spaces.

Write both in the mmproj as clip.gen.audio.frames_after_eos and
clip.gen.audio.pad_short_text, keyed on the pack in the conversion
script like the temperature. The loader keeps them optional, so a
mmproj without them behaves as before. Map semicolons to commas for
every pack instead, the reference only asks for it on three of them and
it costs nothing elsewhere.

Existing mmproj files must be converted again to carry the two keys.

On a long french text the port now lands within 2% of the reference:
22.96s against 23.44s, with the same peak level and the same amount of
silence.
@ngxson
ngxson requested review from a team, CISC and ggerganov as code owners August 10, 2026 22:03
@ngxson
ngxson requested a review from ServeurpersoCom August 10, 2026 22:03
@github-actions github-actions Bot added documentation Improvements or additions to documentation model Model specific mtmd Related to multimodal functionality (video/image/audio) conversion labels Aug 10, 2026
@ServeurpersoCom

Copy link
Copy Markdown
Contributor

Cool! I am rerunning the same tests on this more up-to-date branch

Comment thread conversion/pockettts.py

@ServeurpersoCom ServeurpersoCom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ngxson
ngxson merged commit 6e62ba5 into master Aug 11, 2026
25 of 30 checks passed
mlogix added a commit to SynoriAI/llama.cpp that referenced this pull request Aug 11, 2026
…, multi-output backend sampling, pocket-tts

Merges 45 upstream commits (0865990..ebb546b, b10362-16-gebb546b7e) into
synori/llama-update-mtp-fit. Zero conflicts; all vendored patches carried over
untouched.

Primary motivation — new Meta architecture:
  * 62bf73d model: Muse Glimmer Support (ggml-org#26841)
    LLM_ARCH_MUSE_GLIMMER + src/models/muse-glimmer.cpp + the mtmd vision tower
    in tools/mtmd/models/muse-glimmer.cpp and conversion/muse_glimmer.py.

Other notable changes that touch our public API surface:
  * dd1ea52 llama : support multi-output backend sampling (ggml-org#25532)
    llama_context_params gains n_outputs_max_per_seq; llama_sampler_i.backend_init
    takes it as a third argument; new backend_reset / copy_state vtable slots and
    llama_sampler_copy().
  * 153d324 llama : default load-mode auto, avoids mmap on iGPUs (ggml-org#26081)
    llama_load_mode gains LLAMA_LOAD_MODE_AUTO = -1 (enum is now signed).
  * 6e62ba5 mtmd: support pocket-tts (ggml-org#26871)
    mtmd_gen_inp/mtmd_gen_out gain seed/temp/feats/is_eos; new
    mtmd_gen_inp_default(); mtmd_helper_gen_audio_step_gen() takes out_stop.
  * 157b81f model : Granite-Switch Architecture (ggml-org#25107)
  * 7a20b41 model: MTP support for Nemotron (ggml-org#26725) and
    cc078b4 Dflash support for nemotron-3.5 (ggml-org#26905)
  * e23e944 vendor : cpp-httplib 0.53.0, 4c6766f vendor : subprocess.h sync

Vendored patches preserved:
  * 919fde3 feat(rpc): thread-local last_error accessor — intact, upstream
    touched ggml-rpc.cpp by one unrelated line.
  * 3679b23 Fixes (RPC) — intact.
  * 2aa76c7 fix(metal): drop stray kernel_pad_f32 — still applies; upstream has
    since refactored pad into a templated kernel_pad_impl<T>, so the duplicate
    definition that referenced the nonexistent kargs_pad.s0..s3 is gone on both
    sides and nothing had to be re-applied.
huaxel pushed a commit to huaxel/CachyLLama that referenced this pull request Aug 12, 2026
* adapt the api

* text model ok

* working impl, need verify and clean up

* mtmd: build the pocket-tts transposed convolutions as GEMM + col2im

ggml_conv_transpose_1d has no grouped mode, so the depthwise upsample
was built as one convolution and one concat per channel, which floods
the graph with small nodes and makes kernel launches dominate the
decoder.

Fold both cases into the column form the seanet decoder already needs:
the general case reshapes the kernel to [IC, K * OC] and matmuls it
with the input, the depthwise case batches a matmul over the channels
so a step scales its own kernel. A single col2im_1d then scatter-adds
the columns back to the signal, with the same shape as before, so the
overlap-add tail, the streaming state and the bias are untouched.

Generation time per frame drops by 80% on CUDA and by 50% on CPU. The
output matches the previous implementation sample for sample, with a
correlation of 0.999994 and identical frame counts.

* flow_temp +  frames_after_eos

* chunking

* mtmd: carry the remaining pocket-tts per-pack settings

The language packs also tune the end-of-speech padding and the padding
of short prompts, next to the temperature already carried in the
mmproj: french_24l asks for 8 tail frames instead of the guessed 3,
english_2026-01 asks for short prompts to be padded with spaces.

Write both in the mmproj as clip.gen.audio.frames_after_eos and
clip.gen.audio.pad_short_text, keyed on the pack in the conversion
script like the temperature. The loader keeps them optional, so a
mmproj without them behaves as before. Map semicolons to commas for
every pack instead, the reference only asks for it on three of them and
it costs nothing elsewhere.

Existing mmproj files must be converted again to carry the two keys.

On a long french text the port now lands within 2% of the reference:
22.96s against 23.44s, with the same peak level and the same amount of
silence.

* clip.gen.audio.model_variant

* clean up code comments

* nit: drop the dead flow_temp hparam, the pack table holds the default

* update docs

* address security problems

* less invasive base.py

* lint

* add mtmd_gen_inp_default

* add docs

* rm gen_flow_temp

---------

Co-authored-by: Pascal <admin@serveurperso.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conversion documentation Improvements or additions to documentation model Model specific mtmd Related to multimodal functionality (video/image/audio)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants