viable/strict/1790286648: [BE] Refactor reductions on MPS (#198494)
- PyTorch: 1440 events in the last 90 days
- PyTorch: 1421th Release in the last 90 days
- Previous: earlier the same day · viable/strict/1790285170: [Profiler] Remove deprecated metadata json field (#198265)
What happened
Refactor reductions on MPS. I believe code is now better readable and more concise. ReductionKernel which defines what kind of kernels we have, ReductionLayout which is a struct for the layout of the reshaped tensor. As an example given a tensor of [128, 128, 1024, 64, 32, 16].sum(dim=2) we reshape it in a following way -> [outer_size, dim, inner_size] , where outer_size is prod of all numbers before dim=2, i.e. bei…
Summary assembled by rule from the sources below