TorchTLX将GPU专用内核引入TorchInductor
PyTorch推出TorchTLX,将架构专用TLX内核和扩展融合机制接入TorchInductor,支持NVIDIA Hopper、Blackwell及AMD Instinct MI300X、MI350X和MI450X GPU。该项目为torch.compile路径加入专用GEMM与注意力模板、架构感知融合和安全内核选择;PyTorch称专用模板最高可实现1.2倍加速、更丰富的融合最高可达1.5倍,但这些数据属于厂商自测。
TorchTLX让PyTorch用户能够通过TorchInductor使用架构专用GPU优化,同时保留大部分与硬件无关的PyTorch 2编译器栈。
TL;DR
- TorchTLX brings architecture-specific TLX kernels and richer fusion capabilities into TorchInductor across NVIDIA (Hopper/Blackwell) and AMD (Instinct MI300X/MI350X/MI450X) GPUs.
- Integration: TorchTLX extends TorchInductor’s kernel selection and fusion capabilities, providing a faster path to leverage new GPU capabilities in torch.compile;
- Benchmarking: The presented benchmarks show up to 1.2x speedups from architecture-specific GEMM and attention templates and up to 1.5x from richer fusion;
- Scalability: Reusable templates and fusion mechanisms extend optimizations across workloads and accelerate next-gen GPU bring-up.
Why TorchTLX
Figure-1: why TorchTLX?
Getting the most out of modern GPUs increasingly requires architecture-specific execution strategies. TLX lets us quickly expose new hardware capabilities and optimize specialized kernels, but incorporating those optimizations into PT2 requires deeper integration with TorchInductor.
PT2 has traditionally focused on graph-level optimization while relying on Triton to provide competitive kernels underneath. As we push further on performance, the default kernel performance is no longer always enough. TLX, as a low-level extension of Triton, gives us a way to introduce architecture-specific optimizations without giving up the higher-level PT2 compiler stack.
#PyTorch#TorchTLX#TorchInductor#torch.compile#TLX#NVIDIA#NVIDIA Hopper#NVIDIA Blackwell#AMD#AMD Instinct MI300X#AMD Instinct MI350X#AMD Instinct MI450X