torch.compile with dynamic shapes causes crashes, recompilations, and incorrect results
8/10 HighUsing `torch.compile` with dynamic shapes leads to crashes (OverflowError from float-to-int conversion), excessive recompilations when mixing Python scalars with 0-d tensors, and incorrect outputs such as wrong adaptive max pooling results on Apple MPS. These issues significantly hinder adoption of compiled execution paths.
Collection History
Query: “What are the most common pain points with PyTorch for developers in 2025?”4/4/2026
Compiling models with dynamic shapes involving transpose and floating-point scale interpolation crashes due to OverflowError from float infinity to int conversion. Mixing dynamic Python scalars with 0-d tensors causing excessive recompilations.
Created: 4/4/2026Updated: 4/4/2026