fix: support Intel Macs (torch pin + MPS STFT probe) - #9
Open
dooburt wants to merge 1 commit into
Open
Conversation
Setup failed outright on macOS x86_64, and would have failed again later on Intel Macs that do have a Metal-capable GPU. torch pin: PyTorch shipped its last macOS x86_64 wheels in 2.2.2, so the 2.5.1 pin cannot resolve on an Intel Mac and the whole engine install aborts: ERROR: Could not find a version that satisfies the requirement torch==2.5.1 (from versions: 2.0.0 ... 2.2.2) torchPins() now selects 2.2.2 on macOS x86_64 and keeps 2.5.1 everywhere else. It probes the interpreter's platform.machine() rather than process.arch, since a system python can be a different architecture to Electron (and to Rosetta). GPU probe: hasGpuAcceleration() asked whether a GPU exists, but what it means is whether the roformer engine can run. Intel Macs with AMD graphics report MPS as available while lacking aten::_fft_r2c, and roformer runs its STFT on-device -- so the probe returned true, the 913MB vocals checkpoint downloaded, and the split then died with NotImplementedError. The probe now attempts a torch.stft on the chosen device, so such machines fall through to the existing demucs path. demucs is unaffected either way: its spectro() already moves the STFT to the CPU when the tensor is on MPS. Apple Silicon and Windows behaviour is unchanged. Verified on a 2019 Intel MacBook Pro (macOS 15.7.5, Radeon Pro 560X): engine installs clean on torch 2.2.2, probe returns 0, and splits run through demucs on MPS. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Owner
|
Thanks for the PR! Sorry about the merge conflicts, get those resolved and we can merge this! |
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.
Setup failed outright on macOS x86_64, and would have failed again later on Intel Macs that do have a Metal-capable GPU.
torch pin: PyTorch shipped its last macOS x86_64 wheels in 2.2.2, so the 2.5.1 pin cannot resolve on an Intel Mac and the whole engine install aborts:
ERROR: Could not find a version that satisfies the requirement
torch==2.5.1 (from versions: 2.0.0 ... 2.2.2)
torchPins() now selects 2.2.2 on macOS x86_64 and keeps 2.5.1 everywhere else. It probes the interpreter's platform.machine() rather than process.arch, since a system python can be a different architecture to Electron (and to Rosetta).
GPU probe: hasGpuAcceleration() asked whether a GPU exists, but what it means is whether the roformer engine can run. Intel Macs with AMD graphics report MPS as available while lacking aten::_fft_r2c, and roformer runs its STFT on-device -- so the probe returned true, the 913MB vocals checkpoint downloaded, and the split then died with NotImplementedError. The probe now attempts a torch.stft on the chosen device, so such machines fall through to the existing demucs path. demucs is unaffected either way: its spectro() already moves the STFT to the CPU when the tensor is on MPS.
Apple Silicon and Windows behaviour is unchanged.
Verified on a 2019 Intel MacBook Pro (macOS 15.7.5, Radeon Pro 560X): engine installs clean on torch 2.2.2, probe returns 0, and splits run through demucs on MPS.