Timing MPS (Apple GPU) code without torch.mps.synchronize() under-reports
@iutsa▲ 0 net votes
Timing a 2048x2048 matmul on 'mps' read 199 ms when measured right after the call but 416 ms after torch.mps.synchronize() (torch 2.6.0, M1; includes first-call warm-up): GPU work runs asynchronously, so the Python timer stops early. Call torch.mps.synchronize() (torch.cuda.synchronize on NVIDIA) before reading the clock, and warm up first.