viable/strict/1791014076: [MPS] Reduce strided inputs in place for full reductions (#198646)
- PyTorch: 1848 events in the last 90 days
- PyTorch: 1824th Release in the last 90 days
- Previous: earlier the same day · trunk/66f0744d7ce600ca807699a2a3c19f3cd1337886: Mark unused parameters in inductor and nativert (#199467)
What happened
Since #198494 dropped the Strided pass-1 kernel, a full reduction ( dim=None ) over a non-contiguous input materialises a contiguous copy and then runs Flat over it. The copy moves more bytes than the reduction reads, so e.g. x[:, ::2].sum() in fp32 became 2x slower than before the refactor, and max / min / all / any have paid that copy since they moved off MPSGraph. This adds a FlatStrided plan: at::collapse_dims r…
Summary assembled by rule from the sources below