PyTorch has migrated to Pyrefly for type checking across its core repository and ecosystem projects. The switch delivers a 9x speed improvement over MyPy (5.5 seconds vs 50.6 seconds), simplified configuration from multiple files to a single unified setup, and consistent type checking across IDE, CLI, and CI environments. Pyrefly's stricter default checking mode has already uncovered numerous bugs that MyPy missed, while its active development cycle includes weekly releases and rapid bug fixes. Contributors benefit from native IDE integration, advanced type inference capabilities, and real-time feedback that matches CI results.

8m read timeFrom pytorch.org
Post cover image
Table of contents
Why Switch to Pyrefly?Additional Benefits for PyTorch ContributorsGet Started with PyreflyFuture Work
363 Impressions