MPS is so unloved by the ML community, even ChatGPT, when asked to write code using MPS, switches me to CUDA instead. Set MPS as the device device = torch.device("cpu") if cudnn.benchmark = True device = torch.device("cuda")