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

Turns natural-language instructions into end-to-end Android automation that drives real devices and captures Logcat and screenshots. Uses a multimodal “Dynamic‑First, Coordinate‑Fallback” locator and a native MCP server for IDE integration, supporting fast Flash (3–5s/step) and verifiable Pro workflows.

Converts real repositories into verifiable, sandboxed training environments with black-box tests to train coding agents on long-horizon program reproduction. Provides Program-Env for automated environment construction and Program-Agent for a role-isolated development workflow, yielding 1,648 C/C++/Go/Rust tasks and improving benchmark performance.

GitHub
AI Agent2026

Runs a local-first AI agent runtime that drives your desktop and automates workflows — browsing, file edits, approved shell commands, document extraction, and scheduled tasks — while integrating local or cloud LLMs (llama.cpp/TurboQuant) and embedding as an HTTP service or Tauri sidecar.