torch.compile with dynamic shapes causes crashes, recompilations, and incorrect results

8/10 High

Using `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.

Category
build
Workaround
none
Stage
build
Freshness
emerging
Scope
framework
Upstream
open
Recurring
Yes
Buyer Type
team
Maintainer
active

Sources

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