在低资源设备上高效运行稀疏大模型,通过智能内存管理提升推理速度。
WiSP: A Working-Set View of Mixture-of-Experts Serving on Extremely Low-Resource Hardware

- 将专家模型服务视为工作集问题,动态管理专家权重与缓存的内存分配。
- 在24GiB显存下,解码吞吐量最高提升2.0倍,且输出完全一致。
- 适合资源受限环境中的大模型部署,尤其适用于本地化和代理类应用。
现代本地和代理工作负载常需大模型能力但并发度低,却运行在无法驻留前沿规模模型的GPU上。混合专家(MoE)模型天然适配,因每令牌仅激活少量专家,但其稀疏性节省计算而非内存占用:整个专家池仍需存储,且任意被某层使用的专家必须在该层运行时位于GPU内存中。静态层级CPU卸载虽可使模型适配,但每次前向传播需批量传输专家层,严重削弱稀疏优势。我们从工作集视角看待低资源MoE服务:路由专家权重与KV缓存是争夺有限显存的两个内存流。我们实现此视角为WiSP(Working-Set Paging),一种路由感知的专家页替换器,可插入未修改的推理引擎并保持字节级输出一致。在真实24 GiB RTX 3090上,当模型无法容纳时,WiSP相较静态卸载在相同内存预算下解码吞吐量最高提升2.0倍。下一步尝试预测未来专家并预取,发现单流解码中无效:瓶颈是PCIe带宽而非预测质量,推测传输与需求传输竞争而非隐藏延迟。这促使设计问题从预取转向分配:如何划分显存预算给常驻专家与KV缓存?我们提出MV-WSA(边际价值工作集分配),按每字节带来的边际延迟收益分配内存,并强制设定KV缓存准入下限。作为启动配置器,MV-WSA是唯一在预填充与解码阶段均接近最优的策略;作为实时控制器,它动态调整两池大小,在不改变模型输出的前提下,将端到端时间降低最多1.19倍。
原文摘要 · Abstract (English)
Modern local and agentic workloads often need large-model capacity at low concurrency, but run on GPUs that cannot keep a frontier-scale model resident. Mixture-of-Experts (MoE) models are a natural fit because they activate only a small subset of experts per token, but their sparsity saves computation, not residency: the full expert pool still has to be stored, and any expert used by a layer must be in GPU memory when that layer runs. Static layer-level CPU offload makes such models fit, but transfers the expert layer in bulk on every forward pass, losing much of the sparsity advantage. We view low-resource MoE serving as a working-set problem on the GPU. Routed expert weights and the KV cache are two memory-demand streams competing for the same limited VRAM. We implement this view in WiSP (Working-Set Paging), a routing-aware expert pager that plugs into an unmodified serving engine and preserves byte-identical outputs. On a real 24 GiB RTX 3090, WiSP achieves up to 2.0x the decode throughput of static offload at the same memory budget when the model does not fit. A natural next step is to predict future experts and prefetch them. We find that this does not help in single-stream decode: the bottleneck is PCIe bandwidth, not prediction quality, so speculative transfers compete with demand transfers instead of hiding them. This shifts the design question from prefetching to allocation: how should one VRAM budget be divided between resident experts and the KV cache? We answer with MV-WSA (Marginal-Value Working-Set Allocation), which splits memory by marginal latency benefit per byte while enforcing a KV-admission floor. As a startup configurator, MV-WSA is the only policy we test that stays near-best on both prefill and decode; as a live controller, it resizes both pools while serving and reduces end-to-end time by up to 1.19x over a fixed offline split, without changing model outputs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。