🏎️ Enhance Your Models in 5 Minutes with the Hugging Face Kernel Hub
Boost your model performance with pre-optimized kernels, easily loaded from the Hub.
Today, we’ll explore an exciting development from Hugging Face: the Kernel Hub! As ML practitioners, we know that maximizing performance often involves diving deep into optimized code, custom CUDA kernels, or complex build systems. The Kernel Hub simplifies this process dramatically!
Below is a short example of how to use a kernel in your code.
import torch
from kernels import get_kernel
activation = get_kernel("kernels-community/activation")
x = torch.randn((10, 10), dtype=torch.float16, device="cuda")
y = torch.empty_like(x)
activation.gelu_fast(y, x)
print(y)
In