Activation-Aware Balancing of Fused CPU and GPU Expert Execution for Offline MoE Inference

Borui Xu, Weihao Cui, Yao Chen, Weiguo Liu, Xuanhua Shi, Bingsheng HearXiv 2026

TL;DR

Running massive Mixture-of-Experts (MoE) models like DeepSeek-R1 on a single GPU means keeping most of the "expert" weights in host RAM and splitting the work between the CPU and GPU. HeteroMoE is a new runtime scheduler and execution engine that dynamically balances this CPU–GPU split on the fly for every single layer, achieving 1.45–4.40× higher throughput than existing systems on an H100 server without losing model accuracy.

Figure 1: Throughput of MoE inference systems across expert activation loads on DeepSeek-R1 on H100, normalized to the theoretical best. The reference assumes the theoretically optimal CPU–GPU partition and an ideal expert cache.

What Problem Does This Paper Address?

Frontier MoE models—such as DeepSeek-R1 (671B parameters) and Kimi-K2 (1T parameters)—are too large to fit into a single commodity GPU's memory. In practice, systems keep the routed expert weights in host (CPU) memory and execute the model using the CPU, GPU, and PCIe bus together.

In offline batch inference (like model evaluation or synthetic data generation), systems maximize throughput by packing as many sequences into GPU memory as the KV cache allows. Depending on context length and batch size, the expert activation pattern—how many experts are triggered and how many tokens each receives—changes dramatically.

Existing systems struggle to adapt to these shifting workloads:

  • CPU-only expert systems (like KTransformers) work well when each expert processes only a few tokens, but choke when batch sizes grow.
  • GPU-only offloading systems (like MoE-Lightning) stream every uncached expert over PCIe, becoming bottlenecked by transfer bandwidth on light workloads.
  • Hybrid systems (like Fiddler and HybriMoE) partition experts using fixed, additive per-expert CPU costs. Because real CPU backends actually fuse all CPU-assigned experts into a single call, summing individual costs wildly overestimates CPU time and dumps way too many experts onto the GPU, clogging the PCIe bus.

Methods

HeteroMoE tackles this with an activation-aware, cache-aware scheduler paired with a low-overhead execution engine:

  1. Roofline-Based Cost Model: Instead of summing per-expert CPU costs, HeteroMoE models the fused CPU call as a roofline bounded by the slower of two limits: reading distinct expert weights from host DRAM (memory-bound at low token counts) or computing the tokens (compute-bound at high token counts). It balances this against the GPU branch, which overlaps PCIe weight transfers with GPU kernel execution.
  2. Per-Call Dynamic Partitioning: At every MoE layer, the scheduler counts live token-to-expert activations, checks which experts are already cached on the GPU, and sorts the remaining uncached experts from hottest to coldest. Since every expert in a layer has the same weight size, transferring the hottest ones first maximizes offloaded work. The scheduler simply picks the number of transfers $m^*$ that minimizes the slower of the CPU and GPU+PCIe branches—taking just 0.10–0.17 ms per decoding call.
  3. Cache-Aware Weight Management & Prefetching: HeteroMoE sizes a per-layer GPU expert cache to whatever free GPU memory remains after accounting for the KV cache and working buffers. It scores experts using an exponentially decayed activation count ($s_e^{(t)} = 0.9 s_e^{(t-1)} + c_e^{(t)}$) to keep genuinely heavy-hitter experts resident, and prefetches predicted experts for the next layer during attention when PCIe would otherwise sit idle.
  4. Engine Optimizations: The engine runs CPU and GPU branches concurrently with only one GPU-to-host synchronization per layer. It also introduces custom AVX-512 VNNI CPU kernels that transpose quantized weights into vector lanes to eliminate redundant unpacking, uses 2-MiB huge pages for host memory, and batches decode-loop logit warping to remove per-request host overhead.

Datasets

The authors evaluate HeteroMoE on four diverse datasets representing light to heavy expert activation workloads:

  • AIME2024 (math problems, batch size 30)
  • MTBench (reasoning/conversation, batch size 80)
  • ChatGPT-prompts (conversational prompts, batch size 360)
  • ShareGPT-V3 (conversational prompts under 256 tokens, batch size 600)

No new benchmarks were introduced; all evaluations use standard, publicly available datasets.

Key Insights and Ideas

  • The balance point moves with every call: Lightly activated experts are cheaper on the CPU (which reads weights directly from host RAM), while heavily activated experts are cheaper on the GPU once the one-time PCIe transfer is amortized. Because batch size, routing, and cache state constantly shift, static placements fail.
Figure 5: Per-expert CPU and GPU time on A6000. The CPU is faster at low activation counts and the GPU at high counts, and the dashed line marks the PCIe transfer of one expert.
  • Skewed activations make scheduling cheap: Across both prefill and decoding, the top 30% of experts typically receive 52–71% of all routed tokens. Combined with uniform expert weight sizes, the scheduler doesn't need to search over arbitrary subsets—it only needs to decide how many of the hottest uncached experts to transfer.
  • Fused CPU execution is a roofline, not a sum: In a real decoding call at batch size 600 on A6000, an additive model predicts 328 ms for ~200 CPU experts, whereas the actual fused CPU call takes just 68.7 ms. Modeling this accurately prevents over-offloading to the GPU.

Key Results

Evaluated on Q4_K_M quantized DeepSeek-R1 and Kimi-K2 against five baselines (llama.cpp, MoE-Lightning, KTransformers, Fiddler, and HybriMoE):

  • H100 Server (PCIe 5.0, AVX-512 CPU): HeteroMoE outperforms the strongest baseline in end-to-end throughput by 1.45–4.40× on DeepSeek-R1 and 1.51–3.70× on Kimi-K2. On a batch-size sweep (60–600) of ShareGPT-V3, it reaches 82–87% of the theoretical hardware best.
  • A6000 Server (PCIe 4.0, Zen 3 CPU without AVX-512): HeteroMoE is 1.16–3.86× faster on DeepSeek-R1.
  • Same-Backend Policy Comparison: Isolating just the scheduling policy on A6000, HeteroMoE's roofline model outperforms the Fiddler and HybriMoE rules by 1.87–2.70× and 1.80–2.00×, respectively, by keeping GPU expert shares balanced at 17.9–21.2% instead of 34.9–72.1%.
  • Model Quality: Dynamic partitioning preserves all token-expert computations and shows no quality degradation (e.g., identical 57.3% pass@1 on AIME2024 and 95.0% pass@1 on MTBench compared to KTransformers).

Limitations and Future Work

  • Calibration Overhead: The cost model requires a one-time per-server, per-model calibration run (about 6 minutes on H100 and 15 minutes on A6000) covering small and large batches as well as short and long prompts, since constants calibrated at one batch size do not generalize across the entire batch range.
  • Hardware Dependencies: The custom AVX-512 VNNI CPU kernels cannot run on CPUs lacking AVX-512 (such as the Zen 3 CPU in the A6000 server), which narrows the speedups at small batch sizes on older hardware.
  • Scope: The work targets single-node, offline throughput-oriented batch inference where requests are known in advance; online latency-sensitive serving with strict SLOs is not the focus.

Summary updated

BibTeX
@misc{xu2026activation,
  author = {Borui Xu and Weihao Cui and Yao Chen and Weiguo Liu and Xuanhua Shi and Bingsheng He},
  title = {{Activation-Aware Balancing of Fused CPU and GPU Expert Execution for Offline MoE Inference}},
  year = {2026},
  eprint = {2611.40668},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.40668},
}
Figure