Papers

Bevy 系统:用并发请求调度替代 prefetching,加速本地 MoE 推理

Accelerating Offloading-Based MoE Inference by Interleaving Concurrent Requests

Why we picked it

本地跑 MoE 模型的可以看看,Bevy 不靠预测专家,靠调度并发请求,吞吐量是 llama.cpp 的 3.46 倍。

arXiv 论文提出 Bevy,一个面向本地 MoE 推理的系统。它发现当 GPU 显存中存在 expert cache 时,prefetching 的专家预测精度会下降,反而浪费带宽和显存。Bevy 改用 runahead 推理:让专家已就绪的请求先跑到后续层,从而显式暴露下一个所需专家,再在计算就绪请求的同时抓取缺失专家,无需任何预测。其自平衡调度器会在每层对就绪请求做批处理并优先处理落后请求。在两个本地平台上,Bevy 解码吞吐量最高达到 llama.cpp 的 3.46 倍,以及最快 prefetching 基线的 1.55 倍。

Original · arXiv cs.LG

Accelerating Offloading-Based MoE Inference by Interleaving Concurrent Requests

Expert offloading enables large mixture-of-experts (MoE) language models to run locally, but conventional batching stalls the GPU while missing experts are fetched. A popular remedy, known as prefetching, is to predict what experts will be needed soon and fetch them using idle link bandwidth. Imprecise prediction, however, wastes bandwidth and GPU memory on fetching unnecessary experts. Our key finding is that prefetching can be harmful when there is an expert cache in GPU memory. This is because as the cache includes more necessary experts, expert prediction becomes less precise. Our key insight is that proper request scheduling beats prefetching. Building on this insight, we present Bevy, an MoE inference system based on runahead inference for concurrent requests. A request whose experts are available can run ahead to later layers while other requests wait for fetches, revealing the experts it needs next. Bevy can then fetch the missing experts so identified while computing ready requests, overlapping computation and fetching without predicting expert selections. Running requests separately, however, repeats reads of shared weights in GPU memory and increases compute time. To limit this cost, Bevy's self-balancing scheduler batches ready requests at each layer and prioritizes lagging requests, adapting their grouping as expert availability changes. Across two local platforms, Bevy delivers up to 3.46$\times$ the decode throughput of llama.cpp and up to 1.55$\times$ that of the fastest prefetching baseline.