PyTorch 2.0: Dynamic Shapes Support
summary
PyTorch 2.0 adds a symbolic shapes system that lets compiled graphs accept varying tensor sizes by propagating symbolic dimensions (implemented with sympy), adding runtime guards and control-flow ops, and integrating into the JIT/export path and torchinductor. Benchmarks on variable-length language-model generation show smoother latency than eager and padded static builds, higher throughput, and drop compilation repetitions from about five or six to a single compile. The system is implemented end-to-end and yields measurable performance and compile-time gains.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 0:57Execution Flow
- 2:33Symbolic Shapes
- 3:46Metadata
- 4:36Control Flow
- 5:10Specialization
- 9:58Conclusion
related talks
24mWhat's New for Dynamic Shapes in PyTorch 2.1
13mPyTorch 2.0
28mOn Tensors
24mAdvancements in High-Performance AI/ML through PyTorch's Python Compiler
36mPyTorch: Fast Differentiable Dynamic Graphs in Python
31mPyTorch 2.1 - New Developments
01h 02mThe Shapes of Multi-Dimensional Arrays
54mKeynote: PyTorch 2.1 Technical Deep Dive
