trunk/1782e8ec673e736ffda3414fd921f3c1b1b62002: [MPS] Fix linear backward SIGABRT with a 1-D weight (#187989)
- PyTorch: 219 events in the last 90 days
- PyTorch: 216th Release in the last 90 days
- Previous: earlier the same day · trunk/59cfa7a7f76e0f9d9a08e3264a7e203d155680ee
What happened
Fixes #187988 What linear() accepts a 1-D weight (shape [in_features] ): it contracts and drops the last input dimension. mps_linear (forward) already handles this by unsqueezing the weight to [1, in_features] . The backward pass did not mirror that, so it lowered grad_input and grad_weight to invalid rank-1 × rank-1 matmuls and aborted the process during MPSGraph verification: 'mps.matmul' op contracting dimensions…
Summary assembled by rule from the sources below