Contention-Aware Surrogates for Reconfiguring Shared Inference Servers

When several neural networks share one central CPU server, each slows the others down. They compete for memory bandwidth and cache, and heavy vector instructions make the processor lower its clock speed. The best way to split the cores among models therefore depends on what else is running. Packrat, the best existing tool for CPU model serving, profiles one model at a time in isolation and then assembles a configuration from those profiles. That only works if a configuration that is good alone stays good when neighbours are added. We propose to test that assumption directly. Where it fails, we propose replacing the isolated profile table with a learned surrogate, meaning a cheap model that predicts how well a configuration will perform so the search need not measure it. Our surrogate takes as input both the candidate configuration and a live snapshot of hardware contention read from standard Linux performance counters. It is then used inside an evolutionary search that rebalances the server online.

The reason to use surrogate-assisted optimization here is that measuring a real configuration is expensive. Each trial means migrating live model instances and watching tail latency for tens of seconds while real traffic is served, so only a few dozen trials fit in any reconfiguration window. This is the same "costly evaluation, tight budget" regime that surrogate-assisted evolutionary algorithms were built for. The difference is that the costly function is a shared, centralized server whose behaviour shifts as its workload changes, not a fixed simulator.

Core Claim

We claim two things. First, that on a multi-tenant CPU server, the ranking of serving configurations under co-location differs measurably from the ranking predicted by isolated single-model profiles. Second, that a tree-ensemble surrogate conditioned on normalized performance-counter rates recovers the correct ranking well enough to find lower tail latency than profile-based reconfiguration, using no more live measurements.

The first claim is analogous to a known result. MAPLE-Edge showed that summing layer-wise lookup tables fails once a compiler fuses operators. Our hypothesis is that summing per-model profiles fails in the same way once models share a memory bus.

The second claim reuses three existing techniques. From MAPLE-Edge we take the hardware descriptor: six perf counters, normalized into rates. From Packrat we take the decision space (instances, threads, and batch size per model) and the live-migration mechanism. From Un-evaluated Solutions May Be Valuable in Expensive Optimization we take the practice of keeping good candidates the surrogate has scored but that were never measured, which keeps the search population diverse when the measurement budget is small.

The whole proposal depends on the first claim. If isolated rankings survive co-location, Packrat with periodic re-profiling is enough, and we will say so.

Research Program

The setting is a dual-socket Xeon server that hosts several models at once. We use the four models Packrat studied: ResNet-50, Inception-v3, GPT-2 and BERT. A configuration assigns each model a number of instances, threads per instance, a batch size and a socket. With four tenants this gives a mixed discrete space of roughly sixteen to twenty variables, coupled by the shared core budget. That is large enough that exhaustive profiling of joint configurations is infeasible, and Packrat's dynamic program over independent profiles is exactly the shortcut under test.

The surrogate is a gradient-boosted tree ensemble. We choose it for three reasons. BGA-ML showed that XGBoost can replace an hours-long simulator inside a genetic algorithm. psLSHADE was 25 to 72 times slower per iteration than plain LSHADE because of its meta-model, and an optimizer that runs on the contended server itself cannot afford that overhead, since it would add to the contention it is trying to manage. Finally, USEA reports that a cheap-surrogate evolutionary method finished in about 45 seconds where a Gaussian-process Bayesian optimizer took over 21,000 seconds on 50-dimensional problems.

The ensemble predicts each tenant's 99th-percentile latency from three inputs: the configuration, the tenant's current request arrival rate, and a contention vector of counter rates (cache misses per second, L1 loads per second, and so on) sampled from the running system. We train it with a pairwise ranking loss next to the usual regression loss. Evolutionary selection only needs the correct ordering of candidates, not exact latency values.

Each reconfiguration episode works as follows. The evolutionary search scores thousands of candidates with the surrogate. A small number are pre-screened for live measurement, using the surrogate's predicted best value plus the disagreement among ensemble members as a simple uncertainty signal. Each measured candidate is deployed through active-passive migration and observed for a fixed window. The new measurement is added to the archive before the next round.

The contention vector also addresses a known weakness. psLSHADE's authors saw global surrogates lose rank correlation late in search and under shifting conditions. Here, when contention changes, the shift appears in the surrogate's inputs rather than silently invalidating it. Whether this lets the surrogate carry over to new contention regimes without retraining is an empirical question we test directly.

Baselines

The naive reference point is the default serving setup Packrat compared against: one large instance per model with cores split evenly. Packrat's reported gains over that default, measured in isolation, are 1.83x for ResNet-50, 1.73x for Inception-v3, 1.71x for GPT-2 and 1.43x for BERT (Packrat).

The strongest existing method is Packrat itself, extended to multiple tenants in the most favourable honest way. Each model gets its isolated power-of-two profile, the knapsack dynamic program runs over the shared core budget, and profiles are refreshed on the same schedule as our reconfiguration episodes. Profiling time counts against the same wall-clock and measurement budget we use. I found no reported result on Lacuna for Packrat or any method on co-located multi-tenant CPU serving, so this baseline must be run rather than quoted.

The second strong competitor is contextual Bayesian optimization. It uses a Gaussian process over the same configuration-plus-counter inputs, with expected improvement, the same live-measurement budget, and its own hyperparameter tuning.

The third competitor is a plain genetic algorithm that measures every candidate live. It is equivalent to our method without the surrogate.

Two ablations isolate the key ingredient. The first removes the counter features, leaving a configuration-only surrogate. The second removes the ranking loss and the retention of unmeasured candidates.

All methods share the same traffic traces, the same measurement-window length, the same number of live measurements per episode, and the same tuning budget. Our method beats Packrat if it achieves lower mean tenant p99 latency and fewer service-level violations across held-out contention regimes, with confidence intervals over repeated runs that exclude zero difference. It must also keep optimizer CPU time below one percent of server capacity.

Why not just…?

Why not just re-profile more often with Packrat? Re-profiling refreshes each model's isolated profile but still measures each model alone. If co-location reorders configurations, the cause is the interaction between tenants, and no amount of fresh isolated data captures it. Profiling joint configurations instead would mean measuring a combinatorial number of them. This alternative is a real threat if interactions turn out to be weak, and the gating experiment below measures exactly that.

Why not just use contextual Gaussian-process Bayesian optimization? In a sixteen-to-twenty-dimensional mixed discrete space, with an archive that grows across episodes, Gaussian processes face the cubic cost noted for HEBO in USEA. That cost is paid on the very server being optimized. Bayesian optimization could still win on sample efficiency at this scale, which is why it is run as a full baseline with equal budget and its optimizer CPU time reported alongside its latency results.

Why not just use a Markov decision process or a reinforcement-learning controller? Huang and Zhou obtained a 97.5% success rate with an online MDP. However, their action was a single scalar compression ratio for one queue. Deng et al. note that coupled queue models become intractable, and a learned policy over a joint multi-tenant configuration space would need far more live interaction than one episode's budget allows. We therefore keep reinforcement learning out of scope and make no claim against it.

Why not just run random or evolutionary search directly on the real system? NAS-Bench-201 found that simple search is competitive, but every query there is a free table lookup. Here each query costs a disruptive measurement window. The surrogate-free genetic-algorithm baseline tests whether the surrogate actually earns its overhead.

Proposed Experiments

The gating experiment comes first. We sample about 200 joint configurations and measure each under four contention regimes: isolated, two tenants, four tenants, and four tenants plus a memory-bandwidth-heavy background job. We then compute the Kendall rank correlation between the ranking implied by isolated profiles and the measured co-located ranking. If the correlation stays above roughly 0.9 in every regime, the core claim fails, and we stop and report Packrat as sufficient.

As a precedent for expecting a lower correlation, HW-NAS-Bench found that simple hardware proxies can have rank correlation as low as 0.18 with measured latency. That evidence is suggestive only, since it compares FLOPs across devices rather than tenants on one server.

If the gate passes, we train the contention-aware surrogate on three contention regimes and test it on a held-out fourth. We report rank correlation and the fraction of predictions within ±10% of measured latency. This mirrors the metric MAPLE-Edge used, where it reported 96.59% on Jetson TX2 with ten calibration measurements, although that number comes from a different task and is not a target.

The closed-loop evaluation then replays bursty arrival traces for all four tenants over many reconfiguration episodes. We compare every baseline and ablation on per-tenant p99 latency, service-level violation rate, number of live measurements, time to reach a configuration within 5% of the best found, and optimizer CPU overhead.

The decisive result is the ablation without counter features. If removing the contention vector costs nothing, the gain comes from search alone and the idea collapses to "use a better optimizer." If removing it erases most of the advantage over Packrat, the proposal's central mechanism is confirmed.