AGENT PULSESJCPal Special EditionAI Industry Evidence & Trends
Aug 31, 2026 · PyTorch

viable/strict/1788218631: [MPS] Fix conv backward to preserve input memory format (#174241)

What Happened

PyTorch 在 MPS 后端修复了 convolution_backward 的内存格式保持问题。此前,当输入为 channels_last 而 grad_output 为 contiguous 时,grad_input 会错误地变为 contiguous,导致 torch.compile 的 inductor 后端断言失败。修复后,grad_input 将保留输入张量的内存格式。

EVENT STORY

Development

  1. First Reportviable/strict/1788218631: [MPS] Fix conv backward to preserve input memory format (#174241)PyTorch Core
  2. Current Assessment此修复反映了 PyTorch 对 MPS 后端与编译栈兼容性的持续投入,有助于提升 Apple 芯片上 PyTorch 的可用性。Agent Pulse · analysis
What Changed

PyTorch 在 MPS 后端修复了 convolution_backward 的内存格式保持问题。此前,当输入为 channels_last 而 grad_output 为 contiguous 时,grad_input 会错误地变为 contiguous,导致 torch.compile 的 inductor 后端断言失败。修复后,grad_input 将保留输入张量的内存格式。

How the Capability Boundary Shifted

该修复表明 PyTorch 在 MPS 后端对内存格式的语义进行了对齐,确保 grad_input 与输入张量保持相同的内存布局。这有助于避免在 torch.compile 等图编译场景中因 strides 不匹配导致的断言错误。

Why It Matters

此修复反映了 PyTorch 对 MPS 后端与编译栈兼容性的持续投入,有助于提升 Apple 芯片上 PyTorch 的可用性。

Who It Affects

该修复降低了在 Apple 芯片上使用 PyTorch 进行训练和推理的兼容性风险,对依赖 MPS 后端的开发者有直接价值。

What to Watch Next

未来可关注 PyTorch 在 MPS 后端对更多算子内存格式保持的修复,以及 torch.compile 在 MPS 上的支持进展。