deepseek-ai/TileKernels

A kernel library written in tilelang

What it solves

TileKernels provides a collection of highly optimized hardware-level building blocks for large language model training and inference. It addresses the need for fast, custom operations—such as mixture-of-experts routing, quantization, and manifold hyper-connections—that push hardware compute and memory bandwidth to their limits.

How it works

Built on the TileLang domain-specific language, the library implements dozens of core mathematical and structural kernels in Python with PyTorch integration. It automatically selects the appropriate hardware backend at runtime, allowing the same code and APIs to execute efficiently on both NVIDIA GPUs and Huawei Ascend NPUs.

Who it’s for

This library is designed for machine learning engineers and researchers building, training, or deploying high-performance large language models who need hardware-accelerated custom layers.

Highlights

  • Includes specialized kernels for Mixture of Experts (MoE) routing, Engram gating, and manifold hyper-connections.
  • Supports FP8 and FP4 casting, dequantization, and fused operations like SwiGLU combined with quantization.
  • Automatically switches backends at runtime to support NVIDIA and Huawei Ascend hardware using the same Python API.
  • Provides high-level PyTorch autograd function wrappers for seamless integration into existing modeling workflows.

Related

  • Project
  • Project
  • Project
  • Project
  • Project