yalund commited on
Commit ·
e1225ad
1
Parent(s): 3e51038
Add moe-l2 model card
Browse files
README.md
CHANGED
|
@@ -1,3 +1,84 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
- zh
|
| 5 |
license: apache-2.0
|
| 6 |
+
tags:
|
| 7 |
+
- moe
|
| 8 |
+
- llm
|
| 9 |
+
- llama.cpp
|
| 10 |
+
- expert-offload
|
| 11 |
+
- low-vram
|
| 12 |
+
- deepseek
|
| 13 |
+
- qwen
|
| 14 |
+
- mixtral
|
| 15 |
+
library_name: moe-l2
|
| 16 |
+
pipeline_tag: text-generation
|
| 17 |
---
|
| 18 |
+
|
| 19 |
+
# moe-l2 — Run 100B+ MoE models on low-VRAM NVIDIA GPUs
|
| 20 |
+
|
| 21 |
+
**moe-l2 is an expert-offload scheduler for llama.cpp that lets you run large MoE (Mixture-of-Experts) models — DeepSeek, Qwen, Mixtral, 100B+ params — on consumer NVIDIA GPUs with far less VRAM than the model would normally need.**
|
| 22 |
+
|
| 23 |
+
## Why
|
| 24 |
+
|
| 25 |
+
MoE models are like a hospital: every token only activates a few experts (the "doctors on duty"), but all experts must stay "on shift" (loaded into VRAM). A 16B MoE model with a 6 GB file can require **23.3 GB of VRAM** when fully loaded — an 8 GB card can't even start it.
|
| 26 |
+
|
| 27 |
+
moe-l2 keeps the experts in host RAM (zero VRAM) and only moves the **activated** experts to the GPU per step, with an LRU hot-expert cache. The GPU reads pinned expert weights directly via PCIe DMA.
|
| 28 |
+
|
| 29 |
+
## Measured results (RTX 4090, full chain `moe-l2 start --gpu`)
|
| 30 |
+
|
| 31 |
+
| Model | Full-load VRAM | With moe-l2 | Speed |
|
| 32 |
+
|---|---:|---:|---:|
|
| 33 |
+
| DeepSeek-V2-Lite (16B MoE) | 23.3 GB | **1.6-2.0 GB** | **139-154 t/s** |
|
| 34 |
+
| Qwen3.6-A3B (32B MoE) | 7.6 GB+ | **2.9 GB** | 50.2 t/s (single) |
|
| 35 |
+
| DeepSeek-V4-Flash (157B MoE, 85 GB file) | OOM | **8.3-9.1 GB VRAM** | N/A (upstream bug) |
|
| 36 |
+
|
| 37 |
+
Three-card full-chain measurements (2026-08-19, bins-v0.6.0):
|
| 38 |
+
|
| 39 |
+
| GPU | DeepSeek-V2-Lite | Qwen3.6-A3B |
|
| 40 |
+
|---|---:|---:|
|
| 41 |
+
| RTX 4090 | 139-154 t/s | 25.5-44.2 t/s |
|
| 42 |
+
| RTX 2080 Ti (11 GB) | 86-94 t/s | 16.6-28.6 t/s |
|
| 43 |
+
| RTX 5090 | 141-151 t/s | 28-52.5 t/s |
|
| 44 |
+
|
| 45 |
+
## How it works (3 layers)
|
| 46 |
+
|
| 47 |
+
1. **Domain predictor** — classifies your prompt's domain (8 domains) and preloads the most likely experts.
|
| 48 |
+
2. **L2 cache** — mmap shared-memory LRU cache, async preload, zero-copy GGUF reading.
|
| 49 |
+
3. **A3 GPU expert cache** — per-slot locked LRU in VRAM; hot experts stay resident, cold experts are evicted. Router-map driven **selective pin** keeps only top-K experts per layer locked, so an 85 GB model runs at ~10.4 GB RSS with zero speed regression.
|
| 50 |
+
|
| 51 |
+
Transparent OpenAI-compatible proxy on localhost:11435 (SSE streaming), so it works with Open WebUI, LangChain, etc.
|
| 52 |
+
|
| 53 |
+
## Quick start
|
| 54 |
+
|
| 55 |
+
```bash
|
| 56 |
+
# Linux x86_64 + NVIDIA GPU + CUDA driver
|
| 57 |
+
pip install moe-l2
|
| 58 |
+
moe-l2 download-bins
|
| 59 |
+
moe-l2 start --model /path/to/model.gguf --gpu
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
`moe-l2 doctor` checks your environment; `moe-l2 model download` fetches models with resumable downloads.
|
| 63 |
+
|
| 64 |
+
## Requirements
|
| 65 |
+
|
| 66 |
+
- Linux x86_64
|
| 67 |
+
- NVIDIA GPU (GTX 1080 → RTX 50, one prebuilt binary for all, sm_61-sm_120a)
|
| 68 |
+
- Python 3.9+
|
| 69 |
+
- Native Windows / macOS / ARM Linux not supported (WSL2 unverified)
|
| 70 |
+
|
| 71 |
+
## Version history
|
| 72 |
+
|
| 73 |
+
13 versions in one month: 23.3 GB → 1.2 GB VRAM, from "can't run" to 140+ t/s. Full changelog on [GitHub](https://github.com/yalun753/moe-l2/blob/main/CHANGELOG.md).
|
| 74 |
+
|
| 75 |
+
## Links
|
| 76 |
+
|
| 77 |
+
- **Source code**: [github.com/yalun753/moe-l2](https://github.com/yalun753/moe-l2)
|
| 78 |
+
- **PyPI**: [pypi.org/project/moe-l2](https://pypi.org/project/moe-l2)
|
| 79 |
+
- **Benchmarks & verification reports**: in the GitHub `references/` directory (EN/ZH)
|
| 80 |
+
- **White paper**: [white-paper](https://github.com/yalun753/moe-l2/blob/main/references/zh/white-paper-zh.md)
|
| 81 |
+
|
| 82 |
+
## License
|
| 83 |
+
|
| 84 |
+
Apache-2.0
|