File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 2222 torch .set_default_tensor_type (torch .cuda .FloatTensor )
2323elif torch .backends .mps .is_available ():
2424 fallback_device = torch .get_default_device ()
25- torch .set_default_device ("mps" )
2625
2726 # As of March 2025, the macOS X-based GitHub Actions building environment sees
2827 # the MPS GPU, but cannot access it. So, a try-except workaround is applied.
2928 try :
3029 # A temporary trick to evade the Pytorch optimizer bug on MPS GPUs
3130 # See https://github.com/pytorch/pytorch/issues/149184
31+ # As for May 2025, it must go before the default device change
3232 torch ._dynamo .disable ()
3333
34+ torch .set_default_device ("mps" )
35+
3436 # If the Pytorch optimizer bug is fixed and the line above is removed,
3537 # the following code will perform a simple check of the MPS GPU
3638 test_nn = torch .nn .Sequential (
You can’t perform that action at this time.
0 commit comments