AIAny
AI Infra2024
GitHub

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 Infra2026

Adds keyless model channels to DeepSeek Harness and brings multiple providers into one model picker and local compatible gateway. Availability is checked dynamically; free quotas, regional access, and data handling remain controlled by upstream services.

GitHub
AI Infra2026

Connects coding agents to one local model gateway, making providers and subscriptions available across agents and routing requests to another account or model when quotas run out.

GitHub
AI Agent2026

Lets AI agents read and operate real phones through a shared set of controls for tapping, typing, scrolling, and screenshots. Supports personal iPhones, Android devices, and hosted cloud phones, with different connection and screen-reading methods for each.