Commit 7cfa6b8
committed
fix: enable MPS for the PyTorch Qwen3-TTS/CustomVoice engines on Apple Silicon
get_torch_device() already supports allow_mps, and other engines
(luxtts_backend.py, qwen_llm_backend.py) already pass allow_mps=True —
but PyTorchTTSBackend, PyTorchSTTBackend, and QwenCustomVoiceBackend
never did, so any Apple Silicon install that ends up on the PyTorch
backend (e.g. MLX unavailable, or before this PR's justfile fix)
silently ran these three on plain CPU instead of falling back to
PyTorch+MPS.
This turned out to matter more than expected: benchmarking on M4
hardware, PyTorch+MPS generation (RTF ~1.7x) was faster than this
same PR's MLX thread-fix (RTF ~3.4-4.3x) for the same qwen engine and
model size, and faster than a CUDA RTX 2080 Ti (RTF ~2.3-3.1x) too.
I'm not proposing changing the default backend selection here — one
engine, one model size, one machine is not enough data for that, and
MLX-Whisper is reportedly faster than PyTorch-CPU for STT — but MPS
should clearly be an option rather than silently absent.
Verified on M4: PyTorchTTSBackend()._get_device() and
QwenCustomVoiceBackend()._get_device() both now return "mps" (were
"cpu").1 parent c82185f commit 7cfa6b8
2 files changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
0 commit comments