· 2024
PyTorch 2: Dinamik Python Bayt Kodu Dönüşümü ve Grafik Derlemesi ile Daha Hızlı Makine Öğrenmesi
PyTorch 2: Faster Machine Learning Through Dynamic Python Bytecode Transformation and Graph Compilation
- 606atıf
- 2024yıl
Kısa özet
PyTorch 2'nin torch.compile özelliği, TorchDynamo ve TorchInductor tarafından desteklenerek, Python bayt kodunu dinamik olarak optimize edilmiş grafiklere derleyerek GPU'larda 2.27 kat daha hızlı çıkarım ve 1.41 kat daha hızlı eğitim sağlıyor.
Yapay zekâ ile başlık ve abstract'tan üretildi; tam metin okunmaz.
Ana noktalar
- PyTorch 2'nin torch.compile'ı, Python bayt kodunu değiştirerek PyTorch işlemlerini FX grafiklerine çıkarmak için TorchDynamo'yu kullanır.
- Varsayılan arka uç olan TorchInductor, bu grafikleri Triton'a (GPU'lar) veya C++'a (CPU'lar) derler.
- 180'den fazla modelde NVIDIA A100 GPU'larda 2.27 kat çıkarım ve 1.41 kat eğitim hızlandırması elde edildi.
- Hızlandırma kıyaslamalarında altı farklı derleyiciden daha iyi performans gösteriyor.
Yapay zekâ ile başlık ve abstract'tan üretildi; tam metin okunmaz.
Özet (abstract)
This paper introduces two extensions to the popular PyTorch machine learning framework, TorchDynamo and TorchInductor, which implement the torch.compile feature released in PyTorch 2. TorchDynamo is a Python-level just-in-time (JIT) compiler that enables graph compilation in PyTorch programs without sacrificing the flexibility of Python. It achieves this by dynamically modifying Python bytecode before execution and extracting sequences of PyTorch operations into an FX graph, which is then JIT compiled using one of many extensible backends. TorchInductor is the default compiler backend for TorchDynamo, which translates PyTorch programs into OpenAI's Triton for GPUs and C++ for CPUs. Results show that TorchDynamo is able to capture graphs more robustly than prior approaches while adding minimal overhead, and TorchInductor is able to provide a 2.27× inference and 1.41× training geometric mean speedup on an NVIDIA A100 GPU across 180+ real-world models, which outperforms six other compilers. These extensions provide a new way to apply optimizations through compilers in eager mode frameworks like PyTorch.
Yazarların özeti; kaynağından alınmıştır., 2024 · DOI ↗
Ücretsiz hesapla devam et
Makaleye Sor ile bu makaleye günde 3 soru ücretsiz; makaleyi kaydet, kaynakçasını al, ilgi alanına göre her gün yeni özetler. Çıkarımlar Premium.
Web'de ücretsiz devam etGoogle ya da Apple hesabınla giriş; kart istemez. Bu makaleye geri dönersin.
Telefonda:
Alan: Donanım ve Mimari
Hardware and ArchitectureComputer Science