Fix Apple Silicon (MPS) watermarking crash & enable MPS device - #26
Open
Thearchitectoffire wants to merge 3 commits into
Open
Fix Apple Silicon (MPS) watermarking crash & enable MPS device#26Thearchitectoffire wants to merge 3 commits into
Thearchitectoffire wants to merge 3 commits into
Conversation
ded-furby
reviewed
Jun 6, 2026
ded-furby
left a comment
Contributor
There was a problem hiding this comment.
I think the fallback env var is currently set too late to fix the default run_misotts.py path. run_misotts.py imports torch before it imports generator, so by the time generator.py executes os.environ.setdefault("PYTORCH_ENABLE_MPS_FALLBACK", "1"), PyTorch has already initialized without the fallback flag.
That means users who run the documented entrypoint can still hit the same MPS crash even though the PR adds the env var. Moving the flag into run_misotts.py before import torch (or documenting an external env export) should make the fix effective for the common path.
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.
The MisoTTS watermark (silentcipher) relies on
aten::unfold_backwardduring its inverse STFT, which is not natively supported by the MPS backend on Apple Silicon Macs and causes the generation to crash at the very end. SettingPYTORCH_ENABLE_MPS_FALLBACK=1in the environment variables fixes this crash by allowing just that operation to fall back to the CPU while keeping the heavy generation on the GPU. I also enabled MPS by default inrun_misotts.pysince the float64 limitation doesn't seem to stop the generation from working with this fallback.