Michael Chen

mlx-audio decoder fix

I found five differences between the MLX iSTFTNet decoders (Kokoro, KittenTTS) and their PyTorch reference. I compared intermediate tensors layer by layer using identical phoneme and style inputs. The fixes merged upstream.

Two differences affected the audio. Every Kokoro render was 2.5 dB quiet, because MLX's istft divides the overlap-add by Σw and torch.istft divides by Σw². And the upsample path in the pitch and energy predictor was misaligned by one frame against its own shortcut: F0 relative RMSE 0.134 → 0.0000.

MCD
7.29 → 4.09 dB
F0 RMSE
11.5 → 5.1 Hz

Checked against frozen fp32 reference audio over 55 utterances, with the thresholds calibrated to the reference model's own render-to-render noise floor, since the decoder is stochastic. I hit this while building Kestrel.

Project source

Back to ML & Research