viable/strict/1792432248: [MPS] Migrate mse forward to metal (#201351)
- PyTorch: 2583 events in the last 90 days
- PyTorch: 2548th Release in the last 90 days
- Previous: earlier the same day · viable/strict/1792428192: [MPS] Migrate std_mean to metal (#201310)
What happened
Replace MPSGraph MSE forward with Metal. While perf isn't the best on eager, it matches CPU/CUDA in implementation: an elementwise kernel followed by a separate reduction, this change doesn't affect torch compile which stays the same for perf. Perf: Shape Layout Dtype Reduction Before (µs) After (µs) Speedup 1 × 16 × 8 × 8 channels-last bf16 none 40.72 3.30 12.35× 1 × 16 × 8 × 8 strided (transpose H/W) fp32 none 36.…
Summary assembled by rule from the sources below