Skip to content

fix: disable MPS device selection for ctranslate2 compatibility#3

Open
randroid88 wants to merge 2 commits into
DataAnts-AI:mainfrom
Randroids-Dojo:upstream/fix-mps-device
Open

fix: disable MPS device selection for ctranslate2 compatibility#3
randroid88 wants to merge 2 commits into
DataAnts-AI:mainfrom
Randroids-Dojo:upstream/fix-mps-device

Conversation

@randroid88

Copy link
Copy Markdown

Summary

  • Disable MPS (Apple Silicon) device selection in get_optimal_device() — ctranslate2 and faster-whisper only support CUDA and CPU backends
  • On Apple Silicon Macs, selecting MPS causes a runtime crash during transcription; this fix falls back to CPU instead

Details

ctranslate2 (used by faster-whisper, which powers WhisperX) does not support Apple's Metal Performance Shaders backend. When get_optimal_device() returns torch.device("mps"), the transcription pipeline crashes with an unsupported device error.

This removes the MPS branch and adds a comment explaining why it's intentionally skipped.

Files changed

  • backend/utils/gpu_utils.py — Remove MPS device selection in get_optimal_device()

Test plan

  • On an Apple Silicon Mac, run a transcription — should succeed using CPU instead of crashing on MPS
  • On a CUDA machine, behavior is unchanged (still selects CUDA)
  • On a CPU-only machine, behavior is unchanged (still selects CPU)

ctranslate2 and faster-whisper only support CUDA and CPU backends.
On Apple Silicon Macs, selecting MPS causes a runtime crash during
transcription. Skip MPS and fall back to CPU instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant