Skip to content

MTMD: Fix qwen3-tts on Vulkan (get_rows index rows) - #28240

Closed
ServeurpersoCom wants to merge 1 commit into
ggml-org:masterfrom
ServeurpersoCom:mtmd/qwen3-tts-vulkan
Closed

ServeurpersoCom wants to merge 1 commit into
ggml-org:masterfrom
ServeurpersoCom:mtmd/qwen3-tts-vulkan

Conversation

@ServeurpersoCom

@ServeurpersoCom ServeurpersoCom commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Replaced with #28253: All backends now behave the same, which is much better than patching our graphs for a single one.

Fixes the Vulkan crash in the Qwen3-TTS generator: the gen graph handed GET_ROWS an index tensor that was a view at a few bytes offset, which the Vulkan path rejects.

Additional information

GET_ROWS on Vulkan requires its tensors at an aligned offset, and the gen graph passed a one element or T element view of the code cache at a byte offset of a few units. Three sites, all in the gen graph: the step index, the codebook sum, and the code2wav group ids. The embedding table views are fine, their offsets are multiples of a full table. CPU and CUDA read the row where it lies and never noticed, so this hits both model sizes and predates the 0.6B work. Materializing those three index views costs three tiny nodes, and the output is bit for bit identical on CPU at a fixed seed, before and after.

Follow-up #26254 and #28231

Testing

Every clip below was generated on a Vulkan build, which aborted on all of them before this change.

Short sample: "the quick brown fox jumped over the lazy dog".

qwen3tts-0.6B-clone-short.wav
qwen3tts-0.6B-tts-short.wav
qwen3tts-1.7B-clone-short.wav
qwen3tts-1.7B-tts-short.wav

Long sample: "There was one more problem, this time only on Vulkan. The generator was handing the row gather an index that pointed a few bytes into a larger buffer, and the Vulkan path insists that such offsets line up on a boundary, so it stopped the program outright. Processors and CUDA cards simply read the row where it lies, and never noticed. The fix copies those three index rows into tensors of their own. It costs three tiny operations, and it leaves the audio identical, bit for bit, on every backend."

qwen3tts-0.6B-clone-long.wav
qwen3tts-0.6B-tts-long.wav
qwen3tts-1.7B-clone-long.wav
qwen3tts-1.7B-tts-long.wav

The plain TTS clips use the model's own default voice, the cloned ones are conditioned on a 17 s reference recording of a real speaker.

Requirements

The gen graph passed a one element or T element view as the get_rows
index, at a byte offset of a few units. The Vulkan path requires an
aligned offset on that operator and aborts, while CPU and CUDA read
the row where it lies. A cont on the three index views costs three
tiny nodes and keeps every backend on the same graph.
@ServeurpersoCom
ServeurpersoCom requested a review from a team as a code owner September 2, 2026 11:01
@github-actions github-actions Bot added the mtmd Related to multimodal functionality (video/image/audio) label Sep 2, 2026
@ServeurpersoCom ServeurpersoCom changed the title mtmd: materialize the qwen3-tts get_rows index rows MTMD: Fix qwen3-tts on Vulkan (get_rows index rows) Sep 2, 2026
@jeffbolznv

Copy link
Copy Markdown
Contributor

I don't think we should add more CONT ops, we should just fix the vulkan backend. I thought we added support for this recently, but I was thinking of #26854 which has stalled out. Let me see if I can finish that.

It would help to post a command line and/or log so I can make sure it actually gets fixed.

@ServeurpersoCom

Copy link
Copy Markdown
Contributor Author

I don't think we should add more CONT ops, we should just fix the vulkan backend. I thought we added support for this recently, but I was thinking of #26854 which has stalled out. Let me see if I can finish that.

It would help to post a command line and/or log so I can make sure it actually gets fixed.

Just ping me and I'll test it for you. Otherwise:

huggingface-cli download Qwen/Qwen3-TTS-12Hz-1.7B-Base --local-dir Qwen3-TTS-12Hz-1.7B-Base
python3 convert_hf_to_gguf.py Qwen3-TTS-12Hz-1.7B-Base --mmproj --outtype f16
python3 convert_hf_to_gguf.py Qwen3-TTS-12Hz-1.7B-Base --outtype f16

cmake -B build -DGGML_VULKAN=ON && cmake --build build -j --target llama-tts

build/bin/llama-tts -m Qwen3-TTS-12Hz-1.7B-Base/Qwen3-TTS-1.7B-12Hz-Base-F16.gguf -mm Qwen3-TTS-12Hz-1.7B-Base/mmproj-Qwen3-TTS-12Hz-1.7b-Base-F16.gguf -p "the quick brown fox jumped over the lazy dog" --tts-lang english -o out.wav

Aborts on the first frame, no reference audio needed:

ggml/src/ggml-vulkan/ggml-vulkan.cpp:12105: GGML_ASSERT(dst->op != GGML_OP_GET_ROWS || (a_offset == 0 && b_offset == 0 && d_offset == 0)) failed

@ServeurpersoCom
ServeurpersoCom marked this pull request as draft September 2, 2026 14:00
@jeffbolznv

Copy link
Copy Markdown
Contributor

Thanks, please try #28253.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mtmd Related to multimodal functionality (video/image/audio)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants