Skip to content

Conversation

@kyouma
Copy link
Contributor

@kyouma kyouma commented May 14, 2025

Hello.

This is a fix for setting the default PyTorch device to be MPS.
Before: first torch.set_default_device("mps"), then torch._dynamo.disable().
Now: vice versa.

Some tensor operations occur during "torch._dynamo.disable()" (which is used to cope with the PyTorch optimizer bug), which may lead to crash if the default device has already been set to MPS.

I apologize: for the previous MPS pull request I could not test the code well enough. I had no Apple Silicon device, so I asked one person to check the code sequence for me, and probably a misunderstanding happened. This time I received an M4 MacBook and tested everything by myself.

Some tensor operations occur during "torch._dynamo.disable()", which may lead to crash if the default device has already been set to MPS.
@lululxvi lululxvi merged commit e99a95b into lululxvi:master May 14, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants