记忆墙的另一半:利用训练好的路由预测从SSD服务35B MoE模型

·

研究论文 · 2026/09/17

在消费级硬件上,混合专家(MoE)推理受限于权重内存:一个35B级模型在4位量化下为19.5GB,稀疏性减少了每token的计算量,但并未减少必须持有的字节数。单纯卸载到SSD并无帮助,因为第N+1层的专家必须在第N层输出存在之前选定,因此读取无法提前开始以隐藏在计算之后。我们提出Edge0,一种流式MoE推理引擎,通过预路由头弥补这一差距:每层头提前一个token预测下一层的路由,预测结果直接作为路由使用,因此暂存的专家集等于路由集,无任何丢弃。一个在学路径上训练的非合并恢复LoRA,补偿了int4量化和路由替换带来的质量损失。在单台24GB机器上,Edge0以20tok/s的速度服务一个35B MoE,峰值活动内存低于3GiB,在五个公开基准上平均与fp16教师模型相差几个百分点。一个8B层级在同一框架上运行,框架、检查点和适配器均已开源。

该工作通过创新的预路由和恢复LoRA技术,在消费级硬件上实现了大模型的高效推理,显著降低了内存需求,同时保持接近教师模型的性能,且开源可复现,对边缘部署具有重要意义。

Mixture-of-experts (MoE) inference on consumer hardware is bounded by weight memory: a 35B-class model is 19.5GB at 4-bit, and sparsity shrinks the compute per token, not the bytes that must be held. Naive offloading to SSD does not help on its own, because layer N+1's experts must be chosen before layer N's output exists, so the reads cannot start early enough to hide behind compute. We present Edge0, a streaming MoE inference engine that closes the gap with a prerouter: a per-layer head predicts the next layer's routing one token ahead, and the prediction is consumed as the routing itself, so the staged expert set equals the routed set and nothing is dropped. An unmerged recovery LoRA, trained on the student path, pays back the quality lost to int4 quantization and routing replacement. On a single 24GB machine, Edge0 serves a 35B MoE at 20tok/s inside 3GiB of peak active memory, within a few points of its fp16 teacher on average across five public benchmarks. An 8B tier runs on the same framework, and the framework, checkpoints, and adapters are open source.

阅读原文

参与讨论