Skip to main content
Back

DeepSeek Opens TileKernels, Its Production GPU Stack Written in Python

DeepSeek open-sourced a library of GPU kernels written in TileLang that power its internal training and inference pipelines.

Repo, Full Access
  • DeepSeek open-sourced TileKernels, a Python GPU kernel library built on TileLang for LLM operations.
  • Includes MoE gating and routing, FP8/FP4/E5M6 quantization with fused SwiGLU, and batched transpose kernels.
  • Exposes proprietary Engram gating and Manifold HyperConnection kernels used in DeepSeek's own models.
  • Claims most kernels approach hardware limits for compute intensity and memory bandwidth in production use.
  • Requires NVIDIA SM90 or SM100 GPUs, CUDA 13.1+, PyTorch 2.10+, and TileLang 0.1.9+.
  • Released under MIT license and installable via pip install tile-kernels.

DeepSeek has quietly dropped another piece of its production stack into the open. TileKernels is a library of hand-tuned GPU kernels for the operations that dominate large language model training and inference, and several of these kernels are already running inside DeepSeek's own pipelines.

The twist is what they are written in. Instead of CUDA C++, everything ships as Python code built on TileLang, a domain-specific language that compiles Python into GPU code. TileLang gives developers fine-grained control over hardware resources like shared memory, asynchronous copies, and warp-level primitives, all from a Python surface. The resulting code reads like PyTorch but performs closer to what a specialist would get from writing PTX by hand.

Seven modules, one production stack

The repository is organized around seven modules, each targeting a specific choke point in modern LLM workloads:

  • Gating handles top-k expert selection and scoring for Mixture of Experts routing.
  • MoE Routing covers token-to-expert mapping, fused expansion and reduction, and weight normalization.
  • Quantization provides per-token, per-block, and per-channel casting into FP8, FP4, and E5M6, including a fused SwiGLU plus quantization operation.