Breeze TTS: bf16 checkpoint runs ~3.4x slower because prompt embeddings are promoted to float32
Author: EdwardGongCreated Sep 30, 2026Updated Sep 30, 2026
Summary
_TextEmbedding.__call__ scales the prompt embeddings by mx.array(self.weight.shape[-1] ** 0.5):
mx.array(<python float>) is float32, so with the bf16 checkpoint (mlx-community/Breeze-TTS-2-mlx) every prompt embedding is promoted to float32. The promotion carries into the backbone activations and KV cache, so every later step runs in float32 too. It came in with 903903f ("Add Breeze architecture and checkpoint loader", #911).
Reproduce
import mlx.core as mx
from mlx_audio.tts import load
model = load("mlx-community/Breeze-TTS-2-mlx")
emb = model.text_encoder.embed_tokens
print(emb.weight.dtype, "->", emb(mx.array([[1, 2, 3]])).dtype)
# mlx.core.bfloat16 -> mlx.core.float32 (expected bfloat16)Impact
Measured on an M5 Max (mlx 0.32.2), voice-clone mode:
- backbone step: 29.1 ms -> 7.7 ms with the fix
- depth-decoder step: 9.0 ms -> 2.3 ms
- real-time factor: 2.1 -> 0.61, i.e. bf16 goes from slower than real time to faster
- the 8-bit checkpoint is unaffected (already quantized; unchanged within noise)
Fix
Multiply by the Python scalar, which MLX treats as weakly typed, so the weight dtype is kept:
embeds = self.weight[input_ids] * (self.weight.shape[-1] ** 0.5)I'll open a PR with this change and a regression test.
Source: Blaizzy/mlx-audio