Hardware

Hugging Face Integrates Meta Helion into Kernels Hub

Hugging Face has integrated Meta's Helion domain-specific language into its Kernels project, allowing developers to easily share and run highly optimized, pre-tuned machine learning kernels.

PyTorch Blog1 day agoHardware
Image: PyTorch Blog

The Hugging Face Kernels project has officially added support for Helion, a high-level domain-specific language developed by Meta for writing portable, high-performance machine learning kernels. Meta describes the programming model as "PyTorch with tiles," operating on standard tensors while leaving optimization decisions to an algorithmic autotuner. By integrating with Hugging Face's packaging tools, developers can now package these Helion kernels and distribute them seamlessly through the Hugging Face Hub, avoiding the dependency issues that typically plague custom GPU kernel deployment.

Because Helion kernels are written in plain Python, they compile during their first execution and do not require ahead-of-time compilation. Developers can use the kernel-builder tool to scaffold projects, specifying dependencies and target backends like CUDA, ROCm, and XPU. To eliminate cold-start times for end users, developers can pre-tune their kernels using Helion's ahead-of-time runner. This process generates a decision tree of optimized configurations for specific hardware, such as NVIDIA H100 or B200 GPUs, which are saved as plain Python files alongside the source code.

Early implementations demonstrate significant performance advantages. A pre-tuned Helion attention kernel, HelionDSL/attention, was tested on NVIDIA H100 GPUs against the FLASH backend of PyTorch's scaled dot product attention. The Helion kernel outperformed the PyTorch implementation on all 19 of the pre-tuned shapes, achieving a geomean speed-up of 1.20. On 10 held-out shapes not seen during the tuning phase, it still beat the baseline on 9 shapes with a geomean speed-up of 1.17.

Additionally, the HelionDSL/linear-attention project packages seven distinct pre-tuned linear-attention kernels, including retention, GLA, and delta rule variants, optimized for NVIDIA B200 GPUs. Compared to flash-linear-attention, these kernels showed a geomean speed-up of 1.41 on device time and 1.33 end-to-end across six pre-tuned shapes. On six held-out shapes, the geomean speed-up reached 1.35 on device time and 1.31 end-to-end, while combined forward and backward passes yielded a 1.55 geomean speed-up on the tuned shapes.

This is our own summary of reporting by PyTorch Blog

More in Hardware

Hugging Face Integrates Meta Helion into Kernels Hub | The AI Network