You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title: MPS Backend Not Working – CPU is Slow on Apple Silicon
Description:
While trying to run Insanely Fast Whisper on a Mac with Apple Silicon (using the MPS backend), I encountered a NotImplementedError related to sparse tensor operations. The error suggested that the operation aten::_sparse_coo_tensor_with_dims_and_tensors is not implemented for MPS.
I resolved the issue by forcing the --device-id to cpu, but it seems that MPS compatibility is either incomplete or not gracefully handled in this tool.
Error Details:
The specific error message when using MPS was:
NotImplementedError: Could not run 'aten::_sparse_coo_tensor_with_dims_and_tensors' with arguments from the 'SparseMPS' backend. This could be because the operator doesn't exist for this backend, or was omitted during the selective/custom build process (if using custom build). 'aten::_sparse_coo_tensor_with_dims_and_tensors' is only available for these backends: [MPS, Meta, SparseCPU, SparseMeta, BackendSelect, Python, ...]
Environment Details:
OS: macOS (e.g., Ventura 13.6 / Sonoma, whichever you have)
Chip: Apple Silicon (e.g., M1 Pro/M2 Max)
Python Version: 3.12.x
PyTorch Version: 2.5.1
Insanely Fast Whisper Version: [latest version installed]
Execute the command with the --device-id mps flag on a Mac with Apple Silicon.
Observe the NotImplementedError related to sparse tensors.
Steps Taken to Fix:
Switched --device-id to cpu, and the tool successfully ran in real-time transcription mode.
Edited cli.py to force device = "cpu" for all runs. This resolved the issue.
Expected Behavior:
The MPS backend should be supported, as it’s designed for Apple Silicon acceleration. Alternatively, if sparse tensor operations are unsupported on MPS, the tool should gracefully handle the error by defaulting to cpu.
Suggestions:
Add a fallback mechanism to gracefully default to cpu if MPS backend raises errors.
Consider a warning message if MPS is detected but incompatible operations are being requested.
Verify MPS compatibility with PyTorch and address sparse tensor limitations, if feasible.
Performance Context:
The tool works as expected on CPU, but the performance is slower than ideal. For example, transcribing a 60-minute audio file with three participants took approximately 75 minutes on the CPU.
MPS support would likely improve transcription speeds significantly for Mac users on Apple Silicon, reducing time-to-completion.
Additional Context:
Sparse tensor operations are known to have limited support on MPS (per PyTorch documentation). This may require specific implementation changes.
The tool itself is fantastic and very user-friendly—just needs better MPS compatibility for Apple Silicon users.
Feel free to reach out if you need further details or additional testing logs. I’d be happy to assist!
The text was updated successfully, but these errors were encountered:
Hey, thanks for raising this issue :) !
We've had indeed an MPS compatibility issue with the 4.47.0 release of Transformers. Nevertheless you should have run in this issue (#255) before this one. Installing from the patch (huggingface/transformers#35295) to solve the former cited isssue, I am then unable to reproduce yours. Maybe I am not using to correct audio input. Could you please provide it ?
Title: MPS Backend Not Working – CPU is Slow on Apple Silicon
Description:
While trying to run Insanely Fast Whisper on a Mac with Apple Silicon (using the MPS backend), I encountered a
NotImplementedError
related to sparse tensor operations. The error suggested that the operationaten::_sparse_coo_tensor_with_dims_and_tensors
is not implemented for MPS.I resolved the issue by forcing the
--device-id
tocpu
, but it seems that MPS compatibility is either incomplete or not gracefully handled in this tool.Error Details:
The specific error message when using MPS was:
Environment Details:
Steps to Reproduce:
insanely-fast-whisper
using pip.--device-id mps
flag on a Mac with Apple Silicon.NotImplementedError
related to sparse tensors.Steps Taken to Fix:
--device-id
tocpu
, and the tool successfully ran in real-time transcription mode.cli.py
to forcedevice = "cpu"
for all runs. This resolved the issue.Expected Behavior:
The MPS backend should be supported, as it’s designed for Apple Silicon acceleration. Alternatively, if sparse tensor operations are unsupported on MPS, the tool should gracefully handle the error by defaulting to
cpu
.Suggestions:
cpu
if MPS backend raises errors.Performance Context:
Additional Context:
Feel free to reach out if you need further details or additional testing logs. I’d be happy to assist!
The text was updated successfully, but these errors were encountered: