Source-linked AI summary

COPE: Composable Performance Emulation for Mixture-of-Experts Offloading Policies

Hanming Zhang, Erhu Feng

arXiv:2610.33404v1cs.LGcs.DCcs.PF

TL;DR

Model sparsity and hardware differences make MoE offloading rankings configuration-dependent, while implementing every candidate is costly. COPE organizes policies into reusable residency and execution choices and predicts their performance from target-platform profiles and offline routing traces. It selects the measured minimum-TPOT candidate in most evaluated cases and can reduce policy-specific implementation effort.

  • Problem

    Model and hardware variation can change which MoE offloading policy performs best, while implementing and testing every candidate for each configuration incurs substantial engineering cost.

    Source: §1 · p. 1
  • Method

    COPE combines a Policy Matrix of expert-residency and execution choices with VHM profiles and offline routing traces to predict candidate TPOT before integration.

    Source: §1 · pp. 1–2, §4.1 · p. 5
  • Results

    COPE selects the measured minimum-TPOT candidate in 134/150 A100, 20/20 RTX 4090, and 42/45 RTX 5090 cases.

    Source: §1 · p. 2
  • Takeaways & Limitations

    For Qwen-3 on RTX 4090, implementing only the COPE-selected Fixed Parallel policy reduces policy-specific code by 74% compared with implementing all candidates.

    Source: §1 · p. 2

    COPE studies batch-1 decode rather than prefill, and batch-n serving requires batch-size-specific probes and may rank policies differently.

    Source: §8 · p. 12

Abstract

from arXiv · show

As LLMs scale, mixture-of-experts (MoE) architectures increase model capacity while keeping per-token computation manageable through sparse expert activation. This sparsity also enables memory-efficient deployment by retaining most expert weights in CPU memory and transferring or executing only the routed experts on demand. Existing MoE offloading systems typically target specific model-platform configurations, yet differences in model sparsity, CPU and GPU throughput, VRAM capacity, and host-device bandwidth can change the policy ranking. Because implementing and exhaustively evaluating all candidate policies incurs substantial engineering cost, efficiently selecting the best-performing policy for each model-platform configuration remains a key challenge for practical MoE offloading. We present COPE (Composable Offloading Policy Emulator), which selects the best-performing MoE offloading policy for a target model-platform configuration before runtime integration. COPE comprises two components. Its Policy Matrix factors the design space into two independent axes, expert residency and MoE execution strategy, enabling mechanism reuse across candidate policies and exposing four new candidates. Its Virtual Heterogeneous Machine profiles combined-operator schedules on the target platform and combines these measurements with offline routing traces to estimate candidate performance. Compared with the evaluated baselines, COPE improves fastest-policy selection accuracy by 24%-100% and reduces performance-prediction error by $1.7\times$ to $6.8\times$. By identifying the preferred policy before integration, COPE further reduces policy-specific implementation effort by up to 74%.

1 Introduction

MoE offloading policy rankings vary across models and hardware, making per-configuration selection costly when every candidate must be implemented and tested. COPE factors policy choices and uses target-platform profiles with routing traces to predict performance before integration.

Motivation

  • Model sparsity, offloading mechanisms, and heterogeneous hardware make policy performance configuration-dependent, while implementing every candidate incurs substantial engineering cost.CPU and GPU throughput, interconnect bandwidth, synchronization overhead, and model sparsity can change which policy performs best.Source: §1 · p. 1

Approach

  • The Policy Matrix separates expert residency from MoE execution strategy, allowing mechanisms to be reused and exposing four candidate policies absent from existing systems.Residency controls where experts are stored; execution controls where and how routed experts are computed.Source: §1 · pp. 1–2
  • VHM profiles target-hardware operators and combined schedules, then replays offline routed and predicted expert IDs to estimate candidate TPOT.The routing traces are timing-free, and the profile captures interactions among compute, data transfer, synchronization, and asynchronous dispatch.Source: §1 · p. 2

Evaluation

  • COPE evaluates nine candidates on three CPU–GPU platforms and 11 additional controlled A100 resource configurations, comparing VHM predictions with end-to-end measurements.The measured implementations provide ground truth for policy selection and prediction error.Source: §1 · p. 2

Results

  • COPE selects the measured minimum-TPOT candidate in 134/150 A100, 20/20 RTX 4090, and 42/45 RTX 5090 cases.For Qwen-3 on RTX 4090, implementing only the selected Fixed Parallel policy reduces policy-specific code by 74% versus implementing all candidates.Source: §1 · p. 2

2 Background

Sparse routing makes it possible to keep all expert weights in CPU RAM while placing only some in GPU VRAM, but cache misses and hardware variation create different offloading trade-offs. This section establishes the study’s batch-1 decode setting, surveys policy and model diversity, and distinguishes COPE’s policy-level prediction focus from broader simulators.

2.1 MoE Inference with Offloading

  • In partial-fit deployments, resident experts run on the GPU while cache misses can execute on the CPU or move weights to the GPU, with overlap and hardware costs shaping TPOT.The study focuses on batch-1 decode where weights fit in host memory but not entirely in VRAM.Source: §2.1 · p. 2

2.2 Existing Offloading Policies

  • Existing offloading approaches vary in execution, placement, and prefetching, while exact-routing methods preserve the router’s choices and stored precision.Popularity-based placement and future-expert prediction can change cached weights without changing which experts the router eventually selects.Source: §2.2 · pp. 2–3, Figure 1 · p. 3

2.3 A Growing Space of Models and Configurations

  • Models and platforms vary in expert counts, routing, expert size, compute, memory, and bandwidth, so rankings cannot be extrapolated between configurations.The practical question is which feasible policy template to integrate for a particular model–platform without first implementing every candidate.Source: §2.3 · p. 3

2.4 LLM simulators

  • Existing simulators address broader serving or training questions, but their evaluations do not compare multiple MoE offloading policies for memory-constrained edge devices within a common model.COPE targets this narrower policy-level prediction problem.Source: §2.4 · p. 3

3 Observations

Policy performance changes with model and platform conditions, while existing designs can be organized into reusable residency and execution choices. The observations motivate configuration-specific evaluation and a composable policy space.

3.1 Observation I: Model–Platform Dependent Policy Performance

  • Resource changes can reorder candidate policies even for one model and physical GPU, and simple Fixed Parallel can beat more adaptive candidates.On the controlled A100 study, layer partition was only 12.2–25.0% slower than Fixed Parallel in the two 16-worker configurations.Source: §3.1 · pp. 3–4, Figure 2 · p. 4

3.2 Observation II: Composable and Executable Policy Space Modeling

  • Surveyed offloading designs factor into expert residency and MoE execution strategy, whose combinations define candidates within the stated policy space.The matrix preserves router decisions, executes every selected expert, and retains original precision; pruning, substitution, and lower-precision miss execution fall outside its scope.Source: §3.2 · p. 4

4 Design

COPE separates policy specification from configuration-specific performance prediction. The Policy Matrix organizes residency and execution choices, while VHM profiles reusable operations and combines their costs with offline traces to estimate whole-model TPOT.

4 Design

  • COPE represents a policy as a combination of expert residency and MoE execution choices, then estimates candidate TPOT without running each candidate end to end.VHM uses target-platform operator and short-schedule profiles together with offline routing traces to replay cache states.Source: §4 · p. 4, Figure 3 · p. 5

4.1 Modularizing Offloading Policies with the Policy Matrix

  • The Policy Matrix crosses residency families with execution strategies, yielding eight instantiated cache policies plus a separately evaluated whole-layer partition candidate.Fixed residency retains its initial experts; Mutable per-layer and Mutable cross-layer permit replacement at different scopes, while execution choices coordinate CPU work and GPU staging.Source: §4.1 · p. 5, Figure 4 · p. 6, Figure 5 · p. 6

4.2 Predicting Offloading Performance with the Virtual Heterogeneous Machine

  • VHM profiles reusable atomic operators and combined schedules because isolated costs alone miss overlap, serialization, contention, and dispatch effects.Measured operator costs can differ from analytic HRM estimates; for six staged experts, measured cost is 2.4× the analytic estimate.Source: §4.2.1 · pp. 6–7, §4.2 · p. 6, Figure 6 · p. 7

4.2.1 Abstracting Hardware with Atomic-Operator

  • VHM replays routed cache hits and misses, uses predicted next-layer IDs for mutable-cache prefetching, and sums execution, prefetch, and shared decode costs into TPOT.The replay assumes selected prefetches complete before the layer is used, and its profile is reusable only while the target operating point remains valid.Source: §4.2.2 · p. 7

5 Implementation

The implementation validates nine Policy Matrix candidates in llama.cpp and separately builds VHM to replay their schedules. Routing traces pair actual expert selections with next-layer predictions to drive cache-hit replay and possible cache updates.

5 Implementation

  • Nine production paths in llama.cpp validate VHM’s candidate TPOT estimates against end-to-end measurements on RTX 4090, RTX 5090, and A100.The production paths serve only as validation and do not contribute to VHM construction.Source: §5 · pp. 7–8
  • Fixed and mutable residency start with the same per-layer popularity order and cache capacity, but only mutable residency updates the resident set through prediction and prefetch.Execution strategies differ in how they handle cache misses; the eight cache candidates share a bounded pinned buffer.Source: §5 · p. 8

5.1 Expert Routing Trace Collection

  • A routing-trace hook records each layer’s routed experts and next-layer predictions, which respectively determine replay cache hits and possible updates to the next layer’s cache.The next-layer predictor reads the current layer’s input hidden state.Source: §5.1 · p. 8

6 Evaluation

COPE is evaluated against measured policy performance across A100 resource sweeps and physical RTX platforms, with separate measures for winner selection, candidate ranking, and TPOT error. Results show that policy winners vary with models and resources, while schedule-level profiling predicts them more accurately than atomic-cost composition in many evaluated settings.

6.1 Methodology

  • The evaluation compares end-to-end measurements with atomic-operator and HRM estimators, using shared routing traces and replay states; COPE profiles combined-operator schedules.A100 testing covers three models across ten resource configurations; physical RTX testing covers RTX 4090 and RTX 5090.Source: §6.1 · p. 8, §6 · p. 8, §6.3 · p. 9

6.2 Optimal Policy Diversity on A100

  • Four candidates win across 15 A100 model-resource cells, and DeepSeek’s winner changes from Mutable ready-first at one CPU thread to Fixed Parallel at 16 threads.Qwen-3.5’s 16-thread winner improves on layer partition by only 1.02×.Source: §6.2 · p. 9, Table 2 · p. 9
  • For DeepSeek-Coder-V2-Lite, changing A100 resources alone reorders candidates: mutable policies win at low worker counts, while Fixed Parallel wins at 16 workers.In the latter configurations, layer partition is 12.2–25.0% slower; wait-then-GPU and ready-first are 163–364% slower.Source: §6.2 · p. 9

6.3 Optimal Policy Prediction on A100

  • On A100 sweeps, COPE selects 45/50 DS-Coder and 41/50 Qwen-3 measured winners; for Qwen-3.5 it selects 48/50 versus 36/50 for the atomic baseline.For Qwen-3.5, COPE reduces MAPE from 15.12% to 8.71% and raises mean Spearman correlation from 0.884 to 0.944.Source: Table 3 · p. 10, §6.3 · p. 10, Figure 8 · p. 10

6.4 Optimal Policy Prediction on RTX 4090 and RTX

  • On RTX 4090, COPE selects all 20 measured winners and recovers 59/60 top-three slots, while the atomic baseline selects none and recovers 24/60.COPE’s MAPE is 9.39–17.43%, versus 31.73–40.62% for the baseline.Source: §6.4 · p. 10, Figure 9 · p. 10, Figure 10 · p. 10
  • On RTX 5090, COPE selects all measured winners for Coder and Qwen3, and 12/15 for Chat; for Qwen3, the baseline ranks candidates better while COPE has lower absolute TPOT error.The study covers three VRAM reservations per model; Table 5 reports selection, ranking, and error.Source: Table 5 · p. 11, §6.4 · p. 11, Figure 11 · p. 11

6.5 Engineering Effort and Calibration Cost

  • For Qwen3 on RTX 4090, implementing only the selected Fixed Parallel policy requires 3,107 policy-specific lines, versus 8,276 for all options, a 74% reduction.The comparison excludes shared plumbing and prediction/diagnostic code; Figure 12 contrasts the policy-specific implementations.Source: Figure 12 · p. 11, §6.5 · p. 12
  • On RTX 4090, atomic-operator profiling takes 2.8–3.5 minutes across four models; exhaustive combined-operator schedule profiling takes 25.9–43.5 minutes, while combined-operator time is projected at 25% of exhaustive time when profiling only replay-reachable states.Source: Table 6 · p. 12, §6.5 · p. 12

7 Related Work

COPE reuses established offloading mechanisms but organizes them as residency and execution choices, then predicts which complete candidate to integrate. Its comparisons are scoped to whole-expert representation and exact routing.

Expert caches

  • COPE organizes existing demand-loading, prediction, and overlap mechanisms as residency/execution candidates and predicts which complete template to integrate without production-candidate latency.The cited systems include MoE-Infinity, Mixtral-Offloading, ProMoE, DuoServe-MoE, and FreeToken [13] [47] [54] [57].Source: §7 · p. 12

Adjacent mechanisms

  • MoE-Lightning’s batch-paged weights, vLLM UVA remote reads, and execution-order module staging do not share the Policy Matrix’s candidate semantics.The passage identifies vLLM Prefetch and SGLang OffloaderV2 as staging modules in execution order.Source: §7 · p. 12

Other representation and routing choices

  • COPE fixes whole-expert representation and exact routing, excluding finer-grained or compressed weights and routing changes from its policy comparisons.FineMoE and ZipMoE depart from whole-expert representation; approximate routing changes selected computation.Source: §7 · p. 12

8 Discussion

COPE’s conclusions are scoped to decode TPOT and batch-1 operation, with exact routing, whole experts, and host-memory-resident models. Other serving regimes and representations may change the relevant comparisons.

TPOT rather than TTFT

  • COPE optimizes decode TPOT rather than TTFT, and its batch-1 results do not predict prefill performance.Longer prefills can shift the CPU/GPU crossover toward staging weights for GPU execution.Source: §8 · p. 12

Batch n versus batch 1

  • Batch-n serving has a different CPU/GPU crossover and may rank policies differently from single-user batch-1 decode, requiring batch-size-specific probes.Multiple tokens can share an expert.Source: §8 · p. 12

Unmodified computation versus accuracy-for-speed offloading

  • COPE compares unchanged-checkpoint computation: it preserves exact routing, executes every selected expert, and retains stored precision.Routing changes, quantization, and skipping or modifying experts have accuracy-performance trade-offs not directly comparable with TPOT for an unchanged checkpoint.Source: §8 · p. 12

Disk versus host-memory offloading

  • COPE assumes the model fits in host RAM; disk offloading requires additional templates and probes.On a shared-memory AI SoC, disk becomes a capacity tier analogous to host RAM below discrete-GPU HBM.Source: §8 · p. 12

9 Conclusion

COPE structures the MoE offloading design space and evaluates candidate policies before integration, lowering the engineering barrier to deployment on heterogeneous, resource-constrained hardware.

  • MoE offloading performance depends jointly on expert residency and execution strategy, so policy selection is specific to each model–platform configuration.Source: §9 · p. 12
  • COPE uses a Policy Matrix and a Virtual Heterogeneous Machine to evaluate candidate policies before integration.Source: §9 · p. 12
  • COPE replaces implementation-intensive trial and error with systematic pre-integration analysis, lowering the engineering barrier to deployment on heterogeneous, resource-constrained hardware.Source: §9 · p. 12
Loading 2610.33404v1…