Brifing

PyTorch 2.13 Release Boosts Performance and Scalability

New features with Apple Silicon support and distributed training enhancements.

PyTorch Blog2 min

1PyTorch 2.13 Announcement

PyTorch 2.13 introduces significant performance improvements and new features to the machine learning ecosystem. With Apple Silicon (MPS) support, deterministic backward passes, and distributed training enhancements, this release aims to accelerate large-scale model training.

2Apple Silicon Support

FlexAttention's compatibility with Apple Silicon (MPS) delivers up to 12x speedups over SDPA on sparse patterns. This enhancement significantly boosts the efficiency of machine learning workloads on M1/M2 chip Macs.

3Deterministic Backward Pass

The deterministic backward path on CUDA enables reproducible gradient computations. This feature facilitates debugging and regression testing while allowing researchers to share results more reliably.

4CuTeDSL Backend

The CuTeDSL 'Native DSL' backend provides a second high-performance code path for Inductor, promising faster compilation times for key GPU operations. This particularly improves efficiency in large-scale matrix multiplications.

5Memory Efficiency

Combining final prediction and loss computation operations with nn.LinearCrossEntropyLoss reduces peak GPU memory usage by up to 4x for large-vocabulary language model training. This makes larger models more accessible.

6Distributed Training Improvements

The new torchcomms communication backend enhances fault tolerance, scalability, and debugging for large-cluster training. FSDP2's ability to overlap reduce-scatter and all-gather communications boosts distributed training throughput.

7Expanding Platform Support

PyTorch's platform coverage expands with improvements like AOTriton 0.12b support for ROCm, Armv9-A targeting, and new device telemetry APIs for Intel XPU. Python 3.15 wheel support also benefits Linux users.

8Community Contributions

PyTorch 2.13 was shaped by 3,328 commits from 526 contributors. This demonstrates the open-source community's dedication to the project. Community feedback continues to play a critical role in the framework's ongoing improvement.

9FlexAttention Performance

FlexAttention on Apple Silicon delivers impressive speedups on sparse masks. In a scenario with 32768 length and 0.8% density, it runs 12.3x faster than SDPA, offering a significant advantage for models requiring long sequence processing.

10Metal Compute Kernels

The transition to native Metal compute kernels eliminates MPSGraph's compilation overhead on Apple Silicon. This provides notable performance gains, especially for high-frequency, latency-sensitive operations.

11ExecuTorch Integration

Integrating ExecuTorch into PyTorch Core makes on-device inference a first-class capability of the framework. This simplifies the deployment of machine learning models on mobile and embedded devices.

12Future and Participation

PyTorch 2.13 continues its evolution from a research-focused framework to a hardware-agnostic platform for production-scale training and inference. User experiences and feedback will remain the driving force behind this transformation.

Original article: PyTorch Blog — PyTorch 2.13 Sürümü ile Performans ve Ölçeklenebilirlik Artışı