trunk/1776b988238f9978a57690ad7e9b37bff539555c: [MPS] Replace MPSGraph max_pool2d forward with Metal kernels (#201756)
- PyTorch: 2703 events in the last 90 days
- PyTorch: 2660th Release in the last 90 days
- Previous: earlier the same day · trunk/76bb73d4599d7fde5957268de00fcaacebadbec7
What happened
The generic max_pool Metal kernel decomposes the thread id with per-dim div/mod by runtime sizes and is ~8x slower than memory bandwidth allows. That is why stride-1 max_pool2d was routed to MPSGraph, which silently drops NaNs. The Metal kernel dropped them too, unless a NaN was the first element of the window, as it compared with a plain > . Add two specializations of it for 2D pooling of dense tensors, both reusin…
Summary assembled by rule from the sources below