[GH-ISSUE #136] Support for Apple's MPS [?] #53

Open
opened 2026-10-20 09:54:35 +00:00 by bsakaguchi · 38 comments
Owner

Originally created by @escoolioinglesias on GitHub (Apr 23, 2023).
Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/136

Originally assigned to: @Tps-F on GitHub.

Will MPS be supported in the future and will it be possible to train models on Apple Silicon chips? 🙏

Thank you! 🙌

Originally created by @escoolioinglesias on GitHub (Apr 23, 2023). Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/136 Originally assigned to: @Tps-F on GitHub. Will MPS be supported in the future and will it be possible to train models on Apple Silicon chips? 🙏 Thank you! 🙌
Author
Owner

@Tps-F commented on GitHub (Apr 23, 2023):

Now I'm doing-

<!-- gh-comment-id:1519197992 --> @Tps-F commented on GitHub (Apr 23, 2023): Now I'm doing-
Author
Owner

@IIIIIIIllllllllIIIII commented on GitHub (Apr 25, 2023):

cant wait!!!!!

<!-- gh-comment-id:1521394207 --> @IIIIIIIllllllllIIIII commented on GitHub (Apr 25, 2023): cant wait!!!!!
Author
Owner

@ricardo410 commented on GitHub (Jun 5, 2023):

hello any update on this?

<!-- gh-comment-id:1576877591 --> @ricardo410 commented on GitHub (Jun 5, 2023): hello any update on this?
Author
Owner

@Naozumi520 commented on GitHub (Jun 7, 2023):

hello any update on this?

Isn't it supported?

<!-- gh-comment-id:1579956925 --> @Naozumi520 commented on GitHub (Jun 7, 2023): > hello any update on this? Isn't it supported?
Author
Owner

@ricardo410 commented on GitHub (Jun 7, 2023):

@Naozumi520 only for infer, not for training.

<!-- gh-comment-id:1580847864 --> @ricardo410 commented on GitHub (Jun 7, 2023): @Naozumi520 only for infer, not for training.
Author
Owner

@Tps-F commented on GitHub (Jun 7, 2023):

Train fixed bf11700125

<!-- gh-comment-id:1580873076 --> @Tps-F commented on GitHub (Jun 7, 2023): Train fixed bf1170012564463e9b9f13e7174b1eb499bdcbd2
Author
Owner

@Naozumi520 commented on GitHub (Jun 7, 2023):

Yep forgot to mentioned. They haven't released in the package. I do it by copying train_nsf_sim_cache_sid_load_pretrain.py and train/process_ckpt.py from repo to my folder and replace them.

<!-- gh-comment-id:1580888749 --> @Naozumi520 commented on GitHub (Jun 7, 2023): Yep forgot to mentioned. They haven't released in the package. I do it by copying `train_nsf_sim_cache_sid_load_pretrain.py` and `train/process_ckpt.py` from repo to my folder and replace them.
Author
Owner

@ricardo410 commented on GitHub (Jun 7, 2023):

@Naozumi520 can you train? it gives me an error.
Retrieval-based-Voice-Conversion-WebUI-main/train/utils.py", line 206, in latest_checkpoint_path
x = f_list[-1]
IndexError: list index out of range

<!-- gh-comment-id:1581395470 --> @ricardo410 commented on GitHub (Jun 7, 2023): @Naozumi520 can you train? it gives me an error. Retrieval-based-Voice-Conversion-WebUI-main/train/utils.py", line 206, in latest_checkpoint_path x = f_list[-1] IndexError: list index out of range
Author
Owner

@Naozumi520 commented on GitHub (Jun 8, 2023):

That's weird. Yes I'm able to train.

Screenshot 2023-06-08 at 1 13 39 PM
<!-- gh-comment-id:1581902840 --> @Naozumi520 commented on GitHub (Jun 8, 2023): That's weird. Yes I'm able to train. <img width="678" alt="Screenshot 2023-06-08 at 1 13 39 PM" src="https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/assets/52615455/d31664d1-85fa-448e-be55-75e846ebb81e">
Author
Owner

@escoolioinglesias commented on GitHub (Jun 8, 2023):

@Naozumi520 Have you been able to use your trained models to successfully infer? What version of RVC do you have?

<!-- gh-comment-id:1583015018 --> @escoolioinglesias commented on GitHub (Jun 8, 2023): @Naozumi520 Have you been able to use your trained models to successfully infer? What version of RVC do you have?
Author
Owner

@Naozumi520 commented on GitHub (Jun 8, 2023):

Yes. I'm using the version updated0528v2

<!-- gh-comment-id:1583016788 --> @Naozumi520 commented on GitHub (Jun 8, 2023): Yes. I'm using the version [updated0528v2](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/releases/tag/updated0528v2)
Author
Owner

@ricardo410 commented on GitHub (Jun 8, 2023):

Eso es raro. Sí, puedo entrenar.

Captura de pantalla 2023-06-08 a las 1 13 39 p. m.

it is already working, but I thought that the training would be faster, because of the characteristics of my mac, but in reality it is slower than training online.

<!-- gh-comment-id:1583033035 --> @ricardo410 commented on GitHub (Jun 8, 2023): > Eso es raro. Sí, puedo entrenar. > > <img alt="Captura de pantalla 2023-06-08 a las 1 13 39 p. m." width="678" src="https://user-images.githubusercontent.com/52615455/244271019-d31664d1-85fa-448e-be55-75e846ebb81e.png"> it is already working, but I thought that the training would be faster, because of the characteristics of my mac, but in reality it is slower than training online.
Author
Owner

@Naozumi520 commented on GitHub (Jun 8, 2023):

it is already working, but I thought that the training would be faster, because of the characteristics of my mac, but in reality it is slower than training online.

Yeah so do I! I was wondering was mps running on my graphic card or cpu. Cuz I'm intel cpu.

<!-- gh-comment-id:1583040690 --> @Naozumi520 commented on GitHub (Jun 8, 2023): > it is already working, but I thought that the training would be faster, because of the characteristics of my mac, but in reality it is slower than training online. Yeah so do I! I was wondering was mps running on my graphic card or cpu. Cuz I'm intel cpu.
Author
Owner

@ricardo410 commented on GitHub (Jun 9, 2023):

it is already working, but I thought that the training would be faster, because of the characteristics of my mac, but in reality it is slower than training online.

Yeah so do I! I was wondering was mps running on my graphic card or cpu. Cuz I'm intel cpu.

Any idea how to solve this?

<!-- gh-comment-id:1583636421 --> @ricardo410 commented on GitHub (Jun 9, 2023): > > it is already working, but I thought that the training would be faster, because of the characteristics of my mac, but in reality it is slower than training online. > > Yeah so do I! I was wondering was mps running on my graphic card or cpu. Cuz I'm intel cpu. Any idea how to solve this?
Author
Owner

@Tps-F commented on GitHub (Jun 12, 2023):

I think one of the reasons is that some functions in Pytorch do not support mps.
and I am rewriting the code and will let you know if I find anything.

<!-- gh-comment-id:1587554592 --> @Tps-F commented on GitHub (Jun 12, 2023): I think one of the reasons is that some functions in Pytorch do not support mps. and I am rewriting the code and will let you know if I find anything.
Author
Owner

@ricardo410 commented on GitHub (Jun 12, 2023):

I think one of the reasons is that some functions in Pytorch do not support mps. and I am rewriting the code and will let you know if I find anything.

ok thank you!!!

<!-- gh-comment-id:1587592247 --> @ricardo410 commented on GitHub (Jun 12, 2023): > I think one of the reasons is that some functions in Pytorch do not support mps. and I am rewriting the code and will let you know if I find anything. ok thank you!!!
Author
Owner

@Naozumi520 commented on GitHub (Jun 12, 2023):

Yes! Like we have to set PYTORCH_ENABLE_MPS_FALLBACK to 1 and it might actually use the cpu for some functions?

And I'm not sure is MPS really using my AMD graphic card? I put 0-1 in every options.

<!-- gh-comment-id:1587620675 --> @Naozumi520 commented on GitHub (Jun 12, 2023): Yes! Like we have to set `PYTORCH_ENABLE_MPS_FALLBACK` to 1 and it might actually use the cpu for some functions? And I'm not sure is MPS really using my AMD graphic card? I put `0-1` in every options.
Author
Owner

@Tps-F commented on GitHub (Jun 12, 2023):

Sorry, AMD graphics cards are not supported.(from #272 )

<!-- gh-comment-id:1588247788 --> @Tps-F commented on GitHub (Jun 12, 2023): Sorry, AMD graphics cards are not supported.(from #272 )
Author
Owner

@Naozumi520 commented on GitHub (Jun 13, 2023):

Wait no I'm talking about on a Mac, which supported by MPS.

https://developer.apple.com/metal/pytorch/

<!-- gh-comment-id:1588485949 --> @Naozumi520 commented on GitHub (Jun 13, 2023): Wait no I'm talking about on a Mac, which supported by MPS. https://developer.apple.com/metal/pytorch/
Author
Owner

@ricardo410 commented on GitHub (Jun 13, 2023):

Wait no I'm talking about on a Mac, which supported by MPS.

https://developer.apple.com/metal/pytorch/

did it work for you?

<!-- gh-comment-id:1589458067 --> @ricardo410 commented on GitHub (Jun 13, 2023): > Wait no I'm talking about on a Mac, which supported by MPS. > > https://developer.apple.com/metal/pytorch/ did it work for you?
Author
Owner

@Naozumi520 commented on GitHub (Jun 13, 2023):

did it work for you?

Yep as I said before I'm able to do train and inference.
However, the speed is slower than I thought as you mentioned.

<!-- gh-comment-id:1589514215 --> @Naozumi520 commented on GitHub (Jun 13, 2023): > did it work for you? Yep as I said before I'm able to do train and inference. However, the speed is slower than I thought as you mentioned.
Author
Owner

@ricardo410 commented on GitHub (Jun 13, 2023):

https://developer.apple.com/metal/pytorch/

I was referring to this https://developer.apple.com/metal/pytorch/

<!-- gh-comment-id:1589524075 --> @ricardo410 commented on GitHub (Jun 13, 2023): > https://developer.apple.com/metal/pytorch/ I was referring to this https://developer.apple.com/metal/pytorch/
Author
Owner

@Naozumi520 commented on GitHub (Jun 13, 2023):

I was referring to this https://developer.apple.com/metal/pytorch/

No and we don't have to follow this. PyTorch have builtin support for MPS already.

<!-- gh-comment-id:1589657954 --> @Naozumi520 commented on GitHub (Jun 13, 2023): > I was referring to this https://developer.apple.com/metal/pytorch/ No and we don't have to follow this. PyTorch have builtin support for MPS already.
Author
Owner

@ricardo410 commented on GitHub (Jun 13, 2023):

I was referring to this https://developer.apple.com/metal/pytorch/

No and we don't have to follow this. PyTorch have builtin support for MPS already.

if you have it, why is the training so slow? it took me 19 hours to train a 12 minute dataset with 300 epochs.

<!-- gh-comment-id:1589665226 --> @ricardo410 commented on GitHub (Jun 13, 2023): > > I was referring to this https://developer.apple.com/metal/pytorch/ > > No and we don't have to follow this. PyTorch have builtin support for MPS already. if you have it, why is the training so slow? it took me 19 hours to train a 12 minute dataset with 300 epochs.
Author
Owner

@Naozumi520 commented on GitHub (Jun 13, 2023):

If you have it, why is the training so slow? it took me 19 hours to train a 12 minute dataset with 300 epochs.

If we have no MPS then we won't even be able to train the model. It's likely as @Tps-F mentioned, some functions in torch required cuda are not supported by MPS yet. Like I mentioned I was required to put the flag PYTORCH_ENABLE_MPS_FALLBACK to 1. This make those unsupported function use cpu as a fallback when MPS is not supported.

<!-- gh-comment-id:1589679577 --> @Naozumi520 commented on GitHub (Jun 13, 2023): > If you have it, why is the training so slow? it took me 19 hours to train a 12 minute dataset with 300 epochs. If we have no MPS then we won't even be able to train the model. It's likely as @Tps-F mentioned, some functions in torch required cuda are not supported by MPS yet. Like I mentioned I was required to put the flag `PYTORCH_ENABLE_MPS_FALLBACK` to `1`. This make those unsupported function use cpu as a fallback when MPS is not supported.
Author
Owner

@an-internet-user001 commented on GitHub (Sep 2, 2023):

Is anyone training successfully on an Apple Silicone system AND utilizing the GPUs?

<!-- gh-comment-id:1703693208 --> @an-internet-user001 commented on GitHub (Sep 2, 2023): Is anyone training successfully on an Apple Silicone system AND utilizing the GPUs?
Author
Owner

@Tps-F commented on GitHub (Sep 2, 2023):

Is anyone training successfully on an Apple Silicone system AND utilizing the GPUs?

What device configuration do you have?

<!-- gh-comment-id:1703704323 --> @Tps-F commented on GitHub (Sep 2, 2023): > Is anyone training successfully on an Apple Silicone system AND utilizing the GPUs? What device configuration do you have?
Author
Owner

@an-internet-user001 commented on GitHub (Sep 2, 2023):

I have an M2 Max Mac Studio.

<!-- gh-comment-id:1703721582 --> @an-internet-user001 commented on GitHub (Sep 2, 2023): I have an M2 Max Mac Studio.
Author
Owner

@an-internet-user001 commented on GitHub (Sep 2, 2023):

Apologies if I am behind on this issue, but it seems as though PyTorch supports MPS now, or is this not the case? Would you need to essentially "swap" this out for the currently implemented CUDA? (sorry if I sound a little ignorant on the topic as I am purely a hobbyist.

MPS BACKEND

mps device enables high-performance training on GPU for MacOS devices with Metal programming framework. It introduces a new device to map Machine Learning computational graphs and primitives on highly efficient Metal Performance Shaders Graph framework and tuned kernels provided by Metal Performance Shaders framework respectively.

The new MPS backend extends the PyTorch ecosystem and provides existing scripts capabilities to setup and run operations on GPU.

To get started, simply move your Tensor and Module to the mps device:

Check that MPS is available

if not torch.backends.mps.is_available():
if not torch.backends.mps.is_built():
print("MPS not available because the current PyTorch install was not "
"built with MPS enabled.")
else:
print("MPS not available because the current MacOS version is not 12.3+ "
"and/or you do not have an MPS-enabled device on this machine.")

else:
mps_device = torch.device("mps")

# Create a Tensor directly on the mps device
x = torch.ones(5, device=mps_device)
# Or
x = torch.ones(5, device="mps")

# Any operation happens on the GPU
y = x * 2

# Move your model to mps just like any other device
model = YourFavoriteNet()
model.to(mps_device)

# Now every call runs on the GPU
pred = model(x)
<!-- gh-comment-id:1703878665 --> @an-internet-user001 commented on GitHub (Sep 2, 2023): Apologies if I am behind on this issue, but it seems as though PyTorch supports MPS now, or is this not the case? Would you need to essentially "swap" this out for the currently implemented CUDA? (sorry if I sound a little ignorant on the topic as I am purely a hobbyist. MPS BACKEND mps device enables high-performance training on GPU for MacOS devices with Metal programming framework. It introduces a new device to map Machine Learning computational graphs and primitives on highly efficient Metal Performance Shaders Graph framework and tuned kernels provided by Metal Performance Shaders framework respectively. The new MPS backend extends the PyTorch ecosystem and provides existing scripts capabilities to setup and run operations on GPU. To get started, simply move your Tensor and Module to the mps device: # Check that MPS is available if not torch.backends.mps.is_available(): if not torch.backends.mps.is_built(): print("MPS not available because the current PyTorch install was not " "built with MPS enabled.") else: print("MPS not available because the current MacOS version is not 12.3+ " "and/or you do not have an MPS-enabled device on this machine.") else: mps_device = torch.device("mps") # Create a Tensor directly on the mps device x = torch.ones(5, device=mps_device) # Or x = torch.ones(5, device="mps") # Any operation happens on the GPU y = x * 2 # Move your model to mps just like any other device model = YourFavoriteNet() model.to(mps_device) # Now every call runs on the GPU pred = model(x)
Author
Owner

@Tps-F commented on GitHub (Sep 2, 2023):

PyTorchpartially supports mps.
Unfortunately, not all operations can be done in mps.

<!-- gh-comment-id:1703880567 --> @Tps-F commented on GitHub (Sep 2, 2023): PyTorchpartially supports mps. Unfortunately, not all operations can be done in mps.
Author
Owner

@an-internet-user001 commented on GitHub (Sep 4, 2023):

So my understanding then is it's not possible to leverage GPUs on Apple Silicone Mac for training. Is this correct or is it possible?

<!-- gh-comment-id:1704517771 --> @an-internet-user001 commented on GitHub (Sep 4, 2023): So my understanding then is it's not possible to leverage GPUs on Apple Silicone Mac for training. Is this correct or is it possible?
Author
Owner

@an-internet-user001 commented on GitHub (Oct 30, 2023):

Was curious if there had been any update to this, or if GPU acceleration on Apple Silicon is still not possible. Hope all are well!

<!-- gh-comment-id:1784896901 --> @an-internet-user001 commented on GitHub (Oct 30, 2023): Was curious if there had been any update to this, or if GPU acceleration on Apple Silicon is still not possible. Hope all are well!
Author
Owner

@maxamly commented on GitHub (Dec 24, 2023):

Hey guys! Are there any updates on this?

<!-- gh-comment-id:1868553318 --> @maxamly commented on GitHub (Dec 24, 2023): Hey guys! Are there any updates on this?
Author
Owner

@Amusesmile commented on GitHub (Feb 26, 2024):

How fast is inference when using MPS compared to real time? I've seen CPU inference at about 2x real time.

<!-- gh-comment-id:1963479877 --> @Amusesmile commented on GitHub (Feb 26, 2024): How fast is inference when using MPS compared to real time? I've seen CPU inference at about 2x real time.
Author
Owner

@Excurl commented on GitHub (Apr 8, 2024):

any update?

<!-- gh-comment-id:2043447420 --> @Excurl commented on GitHub (Apr 8, 2024): any update?
Author
Owner

@an-internet-user001 commented on GitHub (Apr 8, 2024):

I don’t think this GitHub is actively monitored or worked on any more sadly.

On Mon, Apr 8, 2024 at 1:50 PM Excurl @.***> wrote:

any update?

—
Reply to this email directly, view it on GitHub
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/136#issuecomment-2043447420,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AUUKVP6NFGPNSWCAQZFVQUTY4LRGLAVCNFSM6AAAAAAXIWKSDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBTGQ2DONBSGA
.
You are receiving this because you commented.Message ID:
<RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/136/2043447420@
github.com>

<!-- gh-comment-id:2043589109 --> @an-internet-user001 commented on GitHub (Apr 8, 2024): I don’t think this GitHub is actively monitored or worked on any more sadly. On Mon, Apr 8, 2024 at 1:50 PM Excurl ***@***.***> wrote: > any update? > > — > Reply to this email directly, view it on GitHub > <https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/136#issuecomment-2043447420>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AUUKVP6NFGPNSWCAQZFVQUTY4LRGLAVCNFSM6AAAAAAXIWKSDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBTGQ2DONBSGA> > . > You are receiving this because you commented.Message ID: > <RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/136/2043447420@ > github.com> >
Author
Owner

@rponeawa commented on GitHub (Nov 22, 2024):

Any update?

<!-- gh-comment-id:2494948442 --> @rponeawa commented on GitHub (Nov 22, 2024): Any update?
Author
Owner

@saiisa commented on GitHub (Jun 13, 2025):

Training successfully with M4 max, but failed for inference, because failed for feature extraction, because the program cannot recognize Mac GPU ...

<!-- gh-comment-id:2969831546 --> @saiisa commented on GitHub (Jun 13, 2025): Training successfully with M4 max, but failed for inference, because failed for feature extraction, because the program cannot recognize Mac GPU ...
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
RVC-Project/Retrieval-based-Voice-Conversion-WebUI#53
No description provided.