AIAny
AI Infra2024
Icon for item

KTransformers

Runs huge mixture-of-experts LLMs like DeepSeek-R1/V3 on a single 24GB GPU plus CPU DRAM by keeping attention on the GPU and offloading expert weights to CPU. Reports 3-28x speedups via Intel AMX/AVX512 kernels and fits 139K context in 24GB VRAM.

Introduction

Conventional wisdom says a 671B-parameter model needs a rack of datacenter GPUs. KTransformers bets on a different bottleneck: in a mixture-of-experts model, only a few experts fire per token, so the dense, latency-critical attention layers belong on the GPU while the sparse expert weights can sit in cheap CPU DRAM. That single placement decision is what lets a desktop with one 24GB card and a big-memory motherboard run DeepSeek-R1/V3 at all.

What Sets It Apart
  • A templated injection framework lets you swap modules with a YAML rule instead of forking the model code, so new MoE architectures get wired up by configuration rather than rewrites.
  • Expert computation rides Intel AMX and AVX512/AVX2 kernels with NUMA-aware memory management, turning the CPU from a fallback into a real compute tier.
  • The reported gains are concrete, not vague: 3-28x speedups depending on workload, and 139K-token context for DeepSeek-V3/R1 squeezed into 24GB of VRAM.
  • It is not just inference — the same offloading powers SFT, with claims of 6-12x training speedup versus ZeRO-Offload and Qwen3-30B-A3B fine-tuning on a single RTX 4090.
Who It's For

Great fit if you have a serious CPU and DRAM budget but limited GPU VRAM and want to experiment locally with frontier MoE models like DeepSeek, Kimi-K2, GLM, or Qwen3-Next. Look elsewhere if you need maximum tokens-per-second at scale — a fully GPU-resident deployment will beat CPU offloading on raw throughput, and the CPU path leans on Intel AMX/AVX512, so older or AMD hosts see smaller wins.

How the Offloading Works

The split is structural rather than ad hoc: attention and the shared dense path stay GPU-resident for low latency, while routed expert FFNs are quantized (INT4/INT8/FP8/IQ1_S) and served from DRAM only when the router selects them. Because active parameters per token stay small, host-device transfer and CPU compute stop being the wall they are for dense models of the same size.

Information

  • Websitegithub.com
  • OrganizationsMADSys Lab, Tsinghua University, Approaching.AI, 9#AISoft
  • Authorskvcache-ai (maintainers / MADSys group, Tsinghua University & contributors)
  • Published date2024/07/26

Categories

More Items

GitHub
AI Infra2025

Measures generative AI inference performance with token-level metrics (TTFT, inter-token latency), latency, and throughput under realistic traffic patterns. Provides a multiprocess engine, real-time TUI dashboard, extensible plugins, and integrations for telemetry and result uploads, aimed at inference benchmarking and capacity planning.

GitHub
AI Train2019

Train and experiment with multi-billion to trillion-parameter transformer models on large GPU clusters using GPU-optimized building blocks and reference training scripts; offers advanced parallelism and mixed-precision support for research teams and ML engineers.

GitHub

Indexes full text of visited web pages and local files on a self‑hosted server so you can search your personal knowledge from a web UI, terminal, CLI, or an AI assistant. Runs without mandatory telemetry, offers a browser extension for automatic capture, and supports optional semantic search via a configurable embeddings endpoint.