[Whisper] patch float type on mps#35295
Merged
ArthurZucker merged 2 commits intohuggingface:mainfrom Dec 16, 2024
Merged
Conversation
ArthurZucker
approved these changes
Dec 16, 2024
Collaborator
ArthurZucker
left a comment
There was a problem hiding this comment.
Thank you including in the patch!
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
ArthurZucker
pushed a commit
that referenced
this pull request
Dec 16, 2024
* fix float type on mps * make
hnshah
added a commit
to hnshah/insanely-fast-whisper
that referenced
this pull request
Mar 26, 2026
…4.48.0 Fixes Vaibhavs10#255 Problem: Mac users with Apple Silicon (M1/M2/M3) encounter TypeError when transformers tries to use float64 dtype, which MPS backend doesn't support: TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead. Root cause: Older versions of transformers (<4.48.0) didn't have MPS-aware dtype selection in Whisper's timestamp generation code. Solution: 1. Added FAQ entry documenting the fix and upgrade path 2. Pinned transformers>=4.48.0 to prevent users from hitting this issue The upstream fix was merged in huggingface/transformers#35295 (Dec 2024), which added device-aware dtype selection: torch.float32 if device.type == "mps" else torch.float64 This ensures Mac users automatically get float32 timestamps while other platforms continue using float64 for precision. Impact: - Unblocks all Mac M1/M2/M3 users - Prevents new users from encountering the bug - Documents upgrade path for existing users - Standard dependency management practice
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes Vaibhavs10/insanely-fast-whisper#255
#34537 introduced casting to float64, which is not supported on the MPS backend.