The same job emits several times more CO₂ on one power grid than on another, and much more at one hour than at another on the same power grid. We route GPU jobs across a grid of datacenters in 15 regions, deciding every 15 minutes, from real-time measurements and forecasts, where each new job goes and when each site (datacenter) starts its jobs, uses its battery and sets its cooling. We propose two routers. Dual reaches the plan of one central optimization while each site only ever solves its own small problem. The diffusion router learns to imitate a central planner that is too large to run beyond a few sites, and routes a step's jobs in one pass of a graph network. Both keep to the 15-minute budget at 500 datacenters, where the central planners don't.

Routing (stage 1)Two methods. Dual: Dantzig–Wolfe price coordination; sites answer posted prices with plans until no site can improve. Diffusion router: a graph diffusion model trained on the routings of forecast-only MPC (one share per job) and fine-tuned with CADO; one or two denoising passes score every candidate job–site pair, then a decoder places the jobs with the planners' admission test.
Execution (stage 2)Each site re-solves its own planning LP every step: job starts, battery, cooling setpoint. All sites in parallel.
SimulatorSustainDC (IT, cooling and battery physics), extended to grids of datacenters and real GPU jobs with deadlines.
GoalMinimize the grid's total CO₂ while finishing every job before its deadline, deciding within each 15-minute step.

1Premise

A datacenter's emissions are the energy it draws from the power grid times that grid's carbon intensity (CI, gCO₂/kWh), and CI moves a lot. Across power grids it differs by an order of magnitude (hydro-heavy Bonneville vs. coal- and gas-heavy PJM). Within a grid it follows the daily cycle of demand and solar: California's CI falls by a third around midday. Much datacenter work can bend to this. GPU training and batch jobs can often wait a little and run in any region.

An operator of a grid of datacenters has three levers on its CO₂, and they interact:

  • Where to run each job: which site of the grid it is sent to (routing);
  • When to start it there, within its deadline;
  • How to run the site: cooling setpoint (chiller energy against server fan power), and when to charge or discharge its battery.

Each lever changes the value of the others. Work sent to a site raises its load, so its cooling energy and the best time to start its queue; a battery makes a dirty hour cheaper; a hot afternoon makes the same work cost more energy. The difficulty is scale: the best routing depends on every site's state and forecasts, and a decision must be made every 15 minutes for hundreds of sites.

Figure 1. Where and when the power grid is clean. Mean carbon intensity by hour (UTC) in July 2022 for five US balancing authorities, from the repository's EIA data (data/CarbonIntensity). Select a grid to show the 10–90% range across the month's days. The lines overlap and cross: which grid is cleanest depends on the hour, and the day-to-day ranges overlap more still, so neither “always the same region” nor “always the same hour” is a good rule. Time zones also shift the clean hours of each site against the others. Our experiments use 15 world regions (Section 3).

2What we built on

SustainDC [1] is an open benchmark (Hewlett Packard Enterprise; NeurIPS 2024 Datasets & Benchmarks) that models one datacenter in 15-minute steps. It is built from three separate Gymnasium environments, one per control decision, each with its own agent, observations and reward. They are coupled because each step runs them in a fixed order and each one’s output is the next one’s input:

  1. Workload scheduling. Decides how much of the flexible work to run now or defer. Its output is the IT utilization actually run this step.
  2. Datacenter. Takes that utilization and the agent’s CRAC setpoint, and computes the power drawn: rack-level IT power (CPU and fan curves that depend on inlet temperature and load) plus cooling (CRAC fans, chiller, pumps, cooling tower). Its output is the total facility power.
  3. Battery. Takes that facility power and decides whether to charge, discharge or idle. Its output is the net draw from the grid, which sets the step’s carbon.

All three read the same weather, carbon-intensity and workload traces, so a decision upstream (deferring work, say) changes what the cooling and battery agents see. (In our grid simulator the first environment is bypassed: each site’s utilization comes from the jobs routed to it.) SustainDC ships those traces and MARL baselines through the HARL library [2].

DCcluster-Opt [3] (HPE's sustain-cluster) provides multi-region data (Electricity Maps CI, Open-Meteo weather for 15 regions) and the Alibaba 2020 GPU job trace with its sizing and deadline rules.

We kept SustainDC's physics and interfaces and changed or added the following:

AreaWhat we changed or added
Cooling physicsChiller replaced by the EnergyPlus Chiller:Electric model [5] (efficiency now falls in hot weather, as it should); the CRAC removes exactly the IT heat (steady-state energy balance) instead of a load-dependent fraction of it.
BatteryLithium-ion (LFP) model rated by duration: one power limit for charge and discharge, 95% one-way efficiencies, 5–95% usable window, charging taper above 90%, discharge capped at the datacenter load.
Grid simulatorGeoJobsDC: N full SustainDC sites on a common clock, each in its own time zone. Real jobs with power, duration and deadline are routed to per-site queues and run non-preemptively; each site's utilization is the sum of its running jobs.
Data importDCcluster-Opt's CI, weather and job trace converted to SustainDC's formats; scenario generator for 5 to 500 sites with varied capacity, cooling plant and battery.
ForecastersQuantile-regression forecasters for CI (per region) and for job arrivals, trained on data held out from the evaluation (Section 5.7).
Planners and boundsThe two-stage planners of Section 5 (dual and the diffusion router) and their baselines, an exact MILP for tiny instances and a perfect-foresight LP lower bound.

3Data

Everything the planner does not decide comes from real series. The planner never sees their future except through the forecasters of Section 5.7.

SeriesSourceCoverageUsed for
Carbon intensityElectricity Maps via DCcluster-Opt [3]Hourly, 15 regions (US, Europe, Chile, Singapore, Australia, Japan, Korea, …)Each site's CO₂; episodes in 2023, the forecaster is fitted on earlier years
WeatherOpen-Meteo via DCcluster-OptHourly, same regionsCooling energy (dry and wet bulb temperature)
JobsAlibaba 2020 GPU trace [6] (via DCcluster-Opt)One real 7-week block (the full-year file repeats it)Arrival time, duration, CPU/GPU/memory → power (20 W/core, 500 W/GPU, 2.5 W/GB)

Grid scenarios

A job's deadline is its arrival plus 1.5× its duration (DCcluster-Opt's rule), so it may wait half its duration before starting. Each job's origin is drawn in proportion to a site's demand weight, three times likelier during local business hours (8:00–20:00). Jobs are replicated (±20% size jitter) to reach a mean utilization of 50% over the grid, and arrivals stop before the end of the episode so every planner runs the same work.

ScenarioSitesRegionsNotes
n5, n20, n100, n5005–50015 regions, round-robinEach site draws a variant: 0.5/1/2 MW IT, efficient/default/legacy cooling plant, 0.25/1/2 h battery, demand weight. Sites in a region share CI and weather

4The problem

\(N\) datacenters (sites) \(i\), each with its own electricity grid, weather, IT capacity, cooling plant and battery. Time advances in steps \(t\) of \(\Delta = 15\) min. Job \(j\) arrives at \(a_j\) with duration \(d_j\) and power \(P_j\); at site \(i\) it occupies \(P_j/\mathrm{Cap}_i\) of the capacity for its whole run, and it must start by \(a_j + 0.5\,d_j\) (deadline \(a_j + 1.5\,d_j\)).

Decisions, every 15 minutes

$$\begin{aligned} &\text{Route} && y_{j,i} \in \{0,1\}, \ \ \textstyle\sum_i y_{j,i} = 1 && \text{(each new job goes to one site's queue and stays there)}\\ &\text{Start} && x_{j,s} \in \{0,1\} && \text{(start job } j \text{ at step } s\text{; non-preemptive)}\\ &\text{Battery} && b_{i,t} \in \{\text{charge, idle, discharge}\}\\ &\text{Cooling} && \delta_{i,t} \in \{-1, 0, +1\}\ {}^\circ\mathrm{C} && \text{(change of the CRAC setpoint } \theta_{i,t}\text{)} \end{aligned}$$

Objective and constraints

$$\min\ \sum_i \sum_t CI_{i,t}\, g_{i,t}, \qquad g_{i,t} = f_i(u_{i,t}, \theta_{i,t}, w_{i,t}) + ch_{i,t} - dis_{i,t}$$ $$a_j \le s_j \le a_j + 0.5\, d_j \quad\text{(deadline)}, \qquad \mathrm{load}_{i,t} = \sum_{j \text{ running at } i} \frac{P_j}{\mathrm{Cap}_i} \le 1 \quad\text{(capacity)}$$
\(CI_{i,t}\)
carbon intensity of site \(i\)'s electricity grid in step \(t\) (gCO₂/kWh).
\(g_{i,t}\)
energy site \(i\) draws from the electricity grid in step \(t\) (kWh).
\(f_i(u, \theta, w)\)
energy site \(i\) uses in one step for IT and cooling: \(f_i = \Delta\,[P^{\mathrm{IT}}_i(u, \theta) + P^{\mathrm{cool}}_i(u, \theta, w)]\). It depends on the utilization \(u\), the cooling setpoint \(\theta\) and the weather \(w = (T^{\mathrm{db}}, T^{\mathrm{wb}})\) (outside dry- and wet-bulb temperatures), and comes from the simulator's physics (no closed form). A lower setpoint cuts server-fan power but makes the chiller work harder, so the best setpoint depends on load and weather. Sites differ in capacity and cooling plant, hence the index \(i\).
\(u_{i,t}\)
utilization of site \(i\): \(\mathrm{load}_{i,t}\), the share of its IT capacity used by running jobs.
\(\theta_{i,t}\)
CRAC setpoint: the temperature of the cold air supplied to the servers (°C), moved by \(\delta_{i,t}\).
\(ch_{i,t}, dis_{i,t}\)
energy into and out of the battery in step \(t\), set by \(b_{i,t}\); the stored energy \(e_{i,t+1} = e_{i,t} + \eta_c\, ch_{i,t} - dis_{i,t}/\eta_d\) stays in its usable window (\(\eta_c, \eta_d\): charge and discharge efficiencies).
\(s_j\)
start step of job \(j\) (\(x_{j,s} = 1\) for \(s = s_j\)). A job not started by its latest start waits and counts as unfinished at its deadline.

A decision must be made within its 15-minute step, using real-time measurements for the current step and forecasts of CI, weather and arrivals for the steps after it. Routing is committed (a job never moves) and indivisible, and the right site for a job depends on work that has not arrived yet.

5Method

We split each decision in two stages. Stage 1 (routing) needs a view of the whole grid, but only coarsely: how much each site would charge, in CO₂, for more work of each kind. Stage 2 (execution) needs one site's full state and physics, and nothing about the other sites. Both stages use the same model of a site, a planning LP (Section 5.2), so they agree on what work costs where.

We propose two stage-1 routers, both followed by the same stage 2: dual (Section 5.3), which coordinates the site LPs by prices, and the diffusion router (Section 5.5), which learns to route from a central planner's decisions.

5.1 Architecture

Figure 2. Two stages, one model per site. Every 15 minutes the router sends each of the step's new jobs to one site's queue, from the sites' state and forecasts. Either of our routers fills this slot: dual (Section 5.3, step by step in 5.4) or the diffusion router (Section 5.5, step by step in 5.6). Each site then re-solves its own LP and executes its first step: which queued jobs to start, the battery action and the setpoint.
Figure 3. Cadence. Every step: the step's arrivals are routed (stage 1, whichever router), then each site re-plans the next 24 h with its updated queue and executes one step. Routing commits a job to a site; when it starts is left to that site's LP.

5.2 One site: the planning LP

Each site plans its next 24 h as a linear program over its own queue, running jobs, battery and cooling, on its own CI and weather forecasts; stage 2 executes the first step of that plan.

The LP is a fluid relaxation: queued jobs are grouped into classes \(c\) by latest start, and a class may be started in fractions. Its window is \(W\) steps (24 h plus the longest job). Variables: \(x_{c,s}\), the share of class \(c\) started at slot \(s\) (15-min slots for the first hour, hourly after); load \(u_\tau\); IT + cooling energy \(z_\tau\); battery flows \(ch_\tau, dis_\tau\) and stored energy \(e_\tau\); an overflow \(v_c\) for work that cannot be placed. For a share \(\phi_b\) of extra work bundle \(b\) (Section 5.3), with its jobs as extra classes:

$$\begin{aligned} V_i(\phi) = \min_{x,u,z,ch,dis,e,v}\quad J_i(x) = & \sum_{\tau} \hat c_{i,\tau}\,(z_\tau + ch_\tau - dis_\tau) \;+\; \sum_{c,s} \pi^{\mathrm{late}}_{c,s}\, x_{c,s} \;+\; \sum_c \pi^{\mathrm{ov}}_c\, v_c\\ \text{s.t.}\quad & \textstyle\sum_s x_{c,s} + v_c = 1 \ \ \text{(queued class)}, \qquad \sum_s x_{c,s} + v_c = \phi_{b(c)}\ \ \text{(bundle class)}\\ & u_\tau = R_\tau + \textstyle\sum_{c,s} x_{c,s}\, \mu_c(\tau - s) \le 1, \qquad R^{\mathrm{occ}}_\tau + \sum_{c,s} x_{c,s}\, o_c(\tau-s) \le 1\\ & z_\tau \ge \alpha_{\tau\ell}\, u_\tau + \gamma_{\tau\ell} \quad \forall \ell\\ & e_\tau = e_{\tau-1} + \eta_c\, ch_\tau - dis_\tau/\eta_d, \quad e_{\mathrm{lo}} \le e_\tau \le e_{\mathrm{hi}}, \quad 0 \le ch_\tau, dis_\tau \le \bar p, \quad dis_\tau \le z_\tau \end{aligned}$$
\(J_i(x)\): cost of plan \(x\) (forecast CO₂ in g, plus penalties); \(V_i(\phi)\): the lowest cost when a share \(\phi\) of the extra work must be placed. \(z_\tau\) is the LP's piecewise-linear stand-in for \(f_i\). \(R_\tau, R^{\mathrm{occ}}_\tau\): load and occupancy of the jobs already running. \(\mu_c(k)\), \(o_c(k)\): the class's load and occupancy \(k\) steps after its start (its jobs' exact profiles, partial last step included). \(\hat c_{i,\tau}\): the site's CI forecast. A forecast bundle's classes cannot start before their release step. Starts after the latest start pay \(\pi^{\mathrm{late}}\), larger than the CO₂ of running the longest job at the dirtiest hour, so lateness never pays; overflow is dearer still.

Stage 2: executing the plan

Every step, every site re-solves its LP with no extra work (\(\phi = 0\)), including the jobs routed to it since the last step, and executes the first step of the plan:

  • Starts: the queued jobs the plan starts now, per class in earliest-deadline order, up to the planned amount (the fluid plan is rounded to whole jobs); a job is never started beyond capacity, and jobs not in the plan start when due.
  • Battery: charge or discharge at full power when the planned flow this step is at least 10% of the battery's power, else idle (the simulator's battery has three discrete actions).
  • Cooling: move the setpoint by ±1 °C toward the plan's best setpoint for this step.

The sites are independent at this stage, so the \(N\) LPs are solved in parallel (one process per core).

5.3 Routing: price coordination (dual)

Dantzig–Wolfe decomposition [4] is a classical method for large linear programs, introduced by Dantzig and Wolfe in 1960; we apply it, we did not invent it. It fits problems made of many independent blocks tied together by a few shared constraints. Instead of solving everything at once, a small coordinating LP, the master, puts a price on each shared constraint. Each block then solves its own problem at those prices and proposes its best plan. The master finds the best mix of all plans proposed so far, which gives new prices, and the exchange repeats until no block can propose a plan that improves the mix. At that point the mix is optimal for the full problem. In economic terms, the master is an auctioneer adjusting prices until supply meets demand.

In our routing problem the blocks are the sites (each with its planning LP) and the shared constraints say that every bundle of work is routed somewhere. The coordinator posts a price per bundle, and sites answer with plans from their own LP.

Bundles

Jobs are grouped by slack (latest start − now) into three classes: under 1 h, 1–2 h, over 2 h (equivalently, by duration). Every step, the coordinator prices:

  • this step's new jobs, one bundle per slack class: these are the jobs actually routed;
  • the forecast work of the next 12 h, one bundle per slack class: the arrival forecaster's median work for each future step, shaped like the jobs of that class and hour on the previous days, each part released at its step. These bundles get shares like real ones but route nothing; they make every site's plan keep room for the work to come.

So there are at most \(B = 6\) bundles, whatever the number of sites. A bundle \(b\) has total work \(\omega_b\); site \(i\) chooses the share \(\phi_{i,b}\in[0,1]\) of it to take.

The joint LP and its decomposition

Placing every site's LP side by side and requiring each bundle to be routed in full gives the joint LP. Solved directly, this is our central baseline, MPC, bundled per class:

$$\min_{\phi,\ x_1,\dots,x_N}\ \sum_{i=1}^N J_i(x_i) \quad\text{s.t.}\quad x_i \in X_i(\phi_i)\ \ \forall i, \qquad \sum_{i=1}^N \phi_{i,b} = 1\ \ \forall b \quad (\lambda_b)$$
\(x_i\)
site \(i\)'s whole plan: every variable of its LP (job starts \(x_{c,s}\), load, energy, battery, overflow).
\(J_i(x_i)\)
cost of that plan: forecast CO₂ of site \(i\) over the window, plus lateness and overflow penalties (Section 5.2).
\(\phi_{i,b}\)
share of bundle \(b\) routed to site \(i\), in \([0, 1]\); \(\phi_i = (\phi_{i,1}, \dots, \phi_{i,B})\).
\(X_i(\phi_i)\)
plans site \(i\) can follow when it takes the shares \(\phi_i\): the constraints of its LP, with \(\phi_i\) on the right-hand side.
\(\sum_i \phi_{i,b} = 1\)
the only constraint linking sites: each bundle is routed in full. \(\lambda_b\) is its dual variable, the price of bundle \(b\).

Its size grows with \(N\) (one copy of the site LP per site, solved as one problem), and at 500 sites it no longer fits the 15-minute budget. But the sites are coupled only through the \(B\) routing rows. Pricing them with multipliers \(\lambda_b\) splits the problem into one pricing problem per site:

$$\mathrm{price}_i(\lambda) = \min_{x_i \in X_i(\phi_i),\ \phi_i \in [0,1]^B}\ J_i(x_i) - \sum_b \lambda_b\, \phi_{i,b}$$

A site paid \(\lambda_b\) for taking all of bundle \(b\) takes as much as is worth it to it, given everything it can do with the work (wait for a cleaner hour, cover it from the battery, run cooler). The coordinator holds the plans proposed so far, \(P_i\) for site \(i\), each with its cost \(J_{i,p}\) and shares \(\phi_{i,p}\), and solves the master LP over mixtures of them:

$$\begin{aligned} \min_{\mu \ge 0,\ a \ge 0}\quad & \sum_{i}\sum_{p\in P_i} \mu_{i,p}\, J_{i,p} \;+\; M \sum_b a_b\\ \text{s.t.}\quad & \textstyle\sum_{p\in P_i} \mu_{i,p} = 1 \quad \forall i \qquad (\sigma_i)\\ & \textstyle\sum_i \sum_{p\in P_i} \mu_{i,p}\, \phi_{i,p,b} + a_b = 1 \quad \forall b \qquad (\lambda_b) \end{aligned}$$
\(P_i\)
plans site \(i\) has proposed so far; plan \(p\) has cost \(J_{i,p}\) and shares \(\phi_{i,p,b}\).
\(\mu_{i,p}\)
weight of plan \(p\) in site \(i\)'s mix; the weights of a site sum to 1.
\(a_b\)
part of bundle \(b\) left unrouted, at a large cost \(M\) per bundle (keeps the master feasible from the first round).
\(\sigma_i\), \(\lambda_b\)
dual variables of the two constraint rows: \(\sigma_i\) is what site \(i\)'s current mix is worth to the coordinator, \(\lambda_b\) the price of bundle \(b\).

Its duals are the new prices \(\lambda\) and a value \(\sigma_i\) per site. Each round, every site solves its pricing problem at \(\lambda\) (in parallel), and its answer \((\hat x_i, \hat\phi_i)\) (the best plan and shares at prices \(\lambda\)) joins the master if its reduced cost \(\rho_i\) is negative, i.e. if it beats the site's current mix at these prices:

$$\rho_i = J_i(\hat x_i) - \lambda^\top \hat\phi_i - \sigma_i \;<\; 0, \qquad \underbrace{\text{master value} + \textstyle\sum_i \min(0, \rho_i)}_{\text{Lagrangian lower bound}} \;\le\; \text{joint LP optimum} \;\le\; \text{master value}$$

Rounds stop when no site improves or the relative gap \(-\sum_i \min(0,\rho_i)/|\text{master}|\) falls below \(10^{-4}\) (at most 40 rounds). At convergence the shares \(\phi^*_{i,b} = \sum_p \mu_{i,p}\phi_{i,p,b}\) solve the joint LP (LP duality): dual makes the same routing decision as MPC, bundled per class, but each site only solves its own LP and reveals only its proposals.

  • Feasibility from round one. Every site's first proposal is “take nothing”, and leaving work unrouted costs \(M\), more than any overflow cost, so the first master is always feasible.
  • Warm start. Each site's other first proposal is its answer at the previous step's prices, which are usually close; this skips the rounds spent finding the price range.
  • Parallel sites. Each worker process builds its sites' pricing LPs once per step and re-solves them every round; only prices, costs and shares cross processes.
  • Prices as indices. \(\lambda_b/\omega_b\) is the clearing marginal CO₂ per unit of bundle-\(b\) work: each site's share sits where its marginal cost curve for that bundle crosses the price.

From shares to jobs

The shares of the real bundles become targets \(T_{i,b} = \phi^*_{i,b}\,\omega_b\). Each new job goes to the site with the most of its bundle's target left, among the sites where it fits before its latest start; once every target is met, to the site with the lowest marginal CO₂ now. The job then joins that site's queue and its LP from the next solve on.

5.4 Dual, step by step

One coordination on a toy instance: three sites, an urgent and a flexible bundle, linear costs with a cooling surcharge above each site's clean capacity. Step through it with the buttons (under the diagram, or above the plans table) or the ← → keys; every number shown was computed once, offline, by the same algorithm as DualPolicy.coordinate.

Urgent bundle Flexible bundle Prices from the coordinator Plan accepted
Scenario: 10 MWh urgent, 20 MWh flexible; the solar site is clean up to 10 MWh; first proposals “take nothing” (cold start).

The gap closes

The master's cost can only fall as plans are added (an upper bound on the best cost). The sites' answers give a lower bound. Dual stops when they meet. Vertical scale is logarithmic in both directions.

Master cost (upper bound) Lagrangian lower bound Joint LP optimum

The prices settle

Price of each bundle in kg CO₂ per MWh (λ divided by the bundle's work). They start at the penalty for leaving work unrouted, swing while the coordinator knows few plans, then settle.

Urgent Flexible

Plans the coordinator holds

Each row is a plan a site proposed: the share of each bundle it would take, and its own cost. The weight μ is how much of that plan the current master mix uses. Green rows arrived this round.

A toy instance: three sites, two bundles, linear costs with a cooling surcharge above each site's clean capacity. In SustainDC each site's answer is a full planning LP over the window (queues, deadlines, battery, carbon forecast), but the exchange is the same. The run was precomputed offline with dual-engine.js (which follows DualPolicy.coordinate in geo_dual.py) and is replayed here; nothing is solved in your browser.

5.5 Routing: the diffusion router

The second router learns to route. Its teacher is MPC, unbundled: the joint LP of Section 5.3 with one item per job instead of bundles, the most detailed of our central planners. Its size grows with jobs × sites and it runs out of memory beyond a handful of sites. We run it on small training grids, record its routing at every step, and train a graph diffusion model to reproduce it. At test time the model routes a step's jobs in one or two forward passes, on grids up to 500 sites.

Our approach combines three existing methods: the graph diffusion model of DIFUSCO [7], the training of Fast T2T [8], which makes one or two denoising steps enough, and the cost-based fine-tuning of CADO [9]. We reimplemented them for routing jobs to sites.

Dual reaches the routing of its joint LP exactly, by solving every site's LP several times per step. The diffusion router only approximates its teacher's routing, but needs no LP in stage 1: one network pass scores every job–site pair, and a decoder places the jobs with the same admission test as the other planners. Both hand their routing to the same stage 2.

The step as a graph

Every step with arrivals becomes a bipartite graph \(G_t\): this step's new jobs on one side, the sites on the other. An edge \((j,i)\) means job \(j\) may go to site \(i\): it passes the planners' admission test there, i.e. it fits at its latest start with every job already queued at that site also at its latest start. Rigid (latency-bound) jobs only get the edge to their origin, and a job that fits nowhere keeps every edge. On large grids each job keeps only its \(k\) sites with the lowest estimated CO₂ (top-\(k\) pruning, needed at 50 and 500 sites). A routing selects one edge per job:

$$G_t = (\mathcal J_t \cup \mathcal S,\ \mathcal E_t), \qquad x \in \{0,1\}^{\mathcal E_t}, \qquad \sum_{i:\,(j,i)\in\mathcal E_t} x_{ji} = 1 \quad \forall j \in \mathcal J_t$$
\(\mathcal J_t\), \(\mathcal S\)
the jobs that arrived in step \(t\), and the \(N\) sites.
\(\mathcal E_t\)
the edges: job–site pairs that pass the admission test (or the origin edge, for rigid jobs).
\(x_{ji}\)
1 if job \(j\) is routed to site \(i\), else 0.

Every node and edge carries a feature vector, built only from what the planners see (measurements now, forecasts after):

$$\begin{aligned} &\text{job } j: && v_j = \big(\log P_j,\ d_j,\ \ell_j - t,\ r_j,\ \kappa_j\big)\\ &\text{site } i: && v_i = \big(\mathrm{Cap}_i,\ \mathrm{plant}_i,\ \bar e_i,\ e_{i,t},\ \theta_{i,t},\ h_{i,t},\ n_{i,t},\ L_{i,t},\ [\,F_{i,\tau},\ \hat c_{i,\tau},\ \alpha_{i,\tau}\,]_{\tau = 1..12\,\mathrm h}\big)\\ &\text{edge } (j,i): && w_{ji} = \big(s_{ji},\ o_{ji},\ m_{ji},\ \hat k^{\mathrm{now}}_{ji},\ \hat k^{\mathrm{best}}_{ji},\ \hat k^{\mathrm{now}}_{ji} - \hat k^{\mathrm{best}}_{ji}\big) \end{aligned}$$
\(P_j, d_j\)
the job's power and duration (Section 4).
\(\ell_j - t\)
its slack: latest start \(\ell_j = a_j + 0.5\,d_j\) minus the current step.
\(r_j\)
1 if the job is rigid (must run at its origin).
\(\kappa_j\)
share of the sites that admit it.
\(\mathrm{Cap}_i, \mathrm{plant}_i\)
the site's IT capacity and cooling plant (efficient, default or legacy).
\(\bar e_i, e_{i,t}\)
its battery size (hours) and current charge.
\(\theta_{i,t}, h_{i,t}\)
its current setpoint and local hour of day.
\(n_{i,t}, L_{i,t}\)
number of jobs in its queue, and their load.
\(F_{i,\tau}\)
free capacity in hour \(\tau\) ahead, with every queued job at its latest start.
\(\hat c_{i,\tau}\)
the CI forecast for hour \(\tau\) (Section 5.7).
\(\alpha_{i,\tau}\)
the slope of its energy lines in hour \(\tau\): extra energy per unit of load (Section 5.2).
\(s_{ji}\)
the job's size at the site, \(P_j/\mathrm{Cap}_i\).
\(o_{ji}, m_{ji}\)
1 if site \(i\) is the job's origin; 1 if the site admitted it.
\(\hat k^{\mathrm{now}}_{ji}, \hat k^{\mathrm{best}}_{ji}\)
estimated marginal CO₂ of the job at the site if started now, and at its cheapest start within its slack (from the CI forecast and energy lines).

Diffusion over the edges

The forward process adds noise to a routing by flipping each edge with a small probability at every step, until after \(T\) steps the routing is pure noise:

$$q(x_t \mid x_{t-1}) = x_{t-1} Q_t, \quad Q_t = \begin{pmatrix} 1-\beta_t & \beta_t \\ \beta_t & 1-\beta_t \end{pmatrix}, \qquad q(x_t \mid x_0) = x_0\, \bar Q_t,\ \ \bar Q_t = Q_1 Q_2 \cdots Q_t$$
\(x_0\)
a clean routing (in training, the teacher's).
\(x_t\)
the same routing after \(t\) noise steps, each edge one-hot over \(\{0, 1\}\); \(t = 1, \dots, T\), \(T = 1000\).
\(Q_t\)
the transition matrix of step \(t\): an edge keeps its value with probability \(1 - \beta_t\) and flips with probability \(\beta_t\).
\(\beta_t\)
the noise level, rising linearly from \(10^{-4}\) to \(0.02\).
\(\bar Q_t\)
the product of the first \(t\) transitions, so \(x_t\) can be drawn from \(x_0\) in one go.

The model learns the reverse: a denoiser \(f_\theta(x_t, t, G_t)\) that predicts, for every edge, the probability \(p_{ji}\) that it belongs to the clean routing. It is the anisotropic graph network of DIFUSCO (12 layers, width 256), which updates node and edge embeddings together. In each layer:

$$\hat g_{ji} = A z_j + B z_i + C g_{ji}, \qquad z_j \leftarrow z_j + \mathrm{ReLU}\Big(\mathrm{LN}\big(U z_j + \textstyle\sum_{i} \sigma(\hat g_{ji}) \odot V z_i\big)\Big), \qquad g_{ji} \leftarrow g_{ji} + \mathrm{MLP}\big(\mathrm{ReLU}(\mathrm{LN}(\hat g_{ji})) + \tau(t)\big)$$
\(z_j, z_i\)
embeddings of job \(j\) and site \(i\), initialized from \(v_j\) and \(v_i\) by small MLPs (one per node type).
\(g_{ji}\)
embedding of edge \((j,i)\), initialized from \(w_{ji}\) and the edge's noisy value in \(x_t\).
\(A, B, C, U, V\)
learned matrices, one set per layer.
\(\sigma(\hat g_{ji})\)
the edge gate (sigmoid): how much neighbour \(i\) counts for \(j\). Messages go both ways, so sites are updated from their jobs the same way.
\(\mathrm{LN}\), \(\odot\)
layer normalization; elementwise product.
\(\tau(t)\)
an embedding of the noise step \(t\).
After the last layer, each edge embedding gives two logits, whose softmax is \(p_{ji}\).

Training: imitate the teacher

Fast T2T's consistency loss trains \(f_\theta\) to recover the teacher's routing in a single step from any noise level, and from two noise levels of the same sample:

$$\mathcal L(\theta) = \mathbb E_{t,\,x_0}\Big[\mathrm{CE}\big(f_\theta(x_t, t),\ x_0\big) + \mathrm{CE}\big(f_\theta(x_{t'}, t'),\ x_0\big)\Big], \qquad t \sim \mathcal U\{1, \dots, T\},\ \ t' = \lfloor t/2 \rfloor$$
\(x_0\)
the teacher's routing of a training step.
\(x_t, x_{t'}\)
two noisy copies of it, at a random noise step \(t\) and at half that step.
\(\mathrm{CE}\)
the cross-entropy between the predicted edge probabilities and \(x_0\), summed over edges.
  • Labels. MPC, unbundled drives 1-day training episodes on four 5-site grids (5 MW each) that together cover all 15 regions. Each step with arrivals gives one graph and the teacher's routing. Steps where the teacher hit its time limit are dropped.
  • No leakage. Training days never overlap the evaluation days, nor the days of the job trace those episodes use. Labels use the same forecasts as at test time, never the true future.
  • Model selection. The checkpoint kept is the one whose decoded routings cost least on held-out training episodes, not the one with the lowest loss.

Inference and decoding

Start from noise, \(x_T \sim \mathrm{Bernoulli}(\tfrac12)\) on every edge, and apply the denoiser once (or twice, re-noising in between). Its output is a heatmap: a score \(p_{ji}\) per edge. The scores ignore capacity, so a deterministic decoder turns them into a routing. It takes the jobs in order of latest start. Each job goes to its highest-scoring site among those that still pass the admission test, counting the jobs already placed this step:

$$i(j) = \arg\max_{i:\ (j,i)\in\mathcal E_t,\ \ \mathrm{peak}_i(j) + s_{ji} \,\le\, 1}\ p_{ji}$$
\(i(j)\)
the site job \(j\) is routed to.
\(p_{ji}\)
the heatmap score of edge \((j,i)\).
\(\mathrm{peak}_i(j)\)
site \(i\)'s peak load over \(j\)'s run if \(j\) starts at its latest start, with every queued job, and every job placed before \(j\) this step, also at its latest start.
\(s_{ji}\)
the job's size at the site.
Rigid jobs go to their origin. A job that fits nowhere goes to the site that overflows least. Given the merit rule's scores instead of \(p\), this decoder is exactly the merit router, so the network changes only the preferences, not the admission rules.

Fine-tuning on cost (CADO)

Imitation is capped by the teacher, and the teacher's per-step routing is not always the cheapest once the rest of the episode plays out. CADO treats the denoising steps as a policy and fine-tunes it with REINFORCE, rewarding routings that cost less than the teacher's:

$$R = C\big(x^{\mathrm{teacher}}\big) - C\big(\mathrm{decode}(x_0)\big), \qquad \nabla_\theta J = \mathbb E\Big[\tilde R \sum_{k} \sum_{(j,i)} \nabla_\theta \log p_\theta\big(x^{(k)}_{ji}\big)\Big]$$
\(C(x)\)
the cost of routing \(x\) for this step, in kg CO₂, computed offline from the step's graph instead of by running the simulator. Each site starts its queued and newly routed jobs earliest-deadline-first whenever they fit, with the battery idle and the best setpoint. \(C\) is the CO₂ this emits over the window, using the CI forecast and energy lines, plus a penalty for every step a job waits past its latest start, proportional to its load.
\(x^{\mathrm{teacher}}\), \(\mathrm{decode}(x_0)\)
the teacher's routing of the same step, and the model's sampled routing after decoding.
\(R\)
the reward: the kg CO₂ saved relative to the teacher (positive when the model does better).
\(\tilde R\)
\(R\) standardized over the training batch (mean 0, standard deviation 1), which keeps the update scale steady.
\(x^{(k)}_{ji}\)
the value the model sampled for edge \((j,i)\) at denoising step \(k\) (one or two steps), and \(p_\theta\) its probability.
Only small low-rank adapters (LoRA, rank 2) on the early layers, plus the full last layer, are trained, so the model stays close to its supervised start.

5.6 Diffusion router, step by step

One routing step on a toy instance: six new jobs and three sites. Step through it with the buttons or the ← → keys. The heatmap values are illustrative, chosen by hand to show the mechanics.

Admitted edge Heatmap score (thicker = higher) Routed Does not fit

A toy instance. Loads are in units of capacity at each job's latest start (the admission profile). In SustainDC the graph has the features listed in Section 5.5 and is scored by the trained network; jobs have a size per site, and steps can carry thousands of jobs.

5.7 Forecasts

Both stages plan on real-time measurements and forecasts: the current step's CI and weather are measured, and no future CI, weather or arrival is read from the simulator. Each forecaster reads the series up to the current step.

InputForecasterUsed as
Carbon intensityPer region, a direct multi-horizon linear quantile regression predicts quantiles at leads up to 24 h, from recent values, daily and weekly patterns, and time of day.Median, in every site LP; the current step is measured.
WeatherSame time on the most recent past day.The energy lines of each future step; the current step is measured.
Job arrivalsOne for the whole grid, per slack class: linear quantile regression.Median work per future step, turned into forecast jobs (job mix of the same hour on the previous 7 days): the bundles per class.
Job durationsKnown when a job arrives.Exact load profiles in the LPs.
$$\hat y^{(q)}_{t+h} = x(t, h)^\top w_{h,q}, \qquad w_{h,q} = \arg\min_w \sum_t L_q\big(y_{t+h},\ x(t,h)^\top w\big), \qquad L_q(y, f) = \max\{q(y-f),\ (1-q)(f-y)\}$$
One linear model per anchor lead \(h\) and quantile \(q\), fitted with the pinball loss \(L_q\) (an LP, solved with HiGHS); leads between anchors are interpolated and quantiles are sorted so they never cross. Features \(x(t,h)\) read only the past.

6Planners compared

All planners share stage 2 (the per-site LP, in parallel) and the forecasts; they differ in how stage 1 routes and in how future arrivals enter the plan. From top to bottom they trade optimality for scalability.

PlannerRouting (stage 1)Execution (stage 2)Future arrivals
MILP (reference)Exact, perfect foresightPer-site LP, in parallelOracle
MPC, unbundledOne joint LP over all sitesPer-site LP, in parallelForecast, one item per job
MPC, bundled per classOne joint LP over all sitesPer-site LP, in parallelForecast, one bundle per slack class
Dual, bundled per class (ours)Price coordinationPer-site LP, in parallelForecast, one bundle per slack class
Diffusion router (ours)Graph diffusion model imitating MPC, unbundled; CADO fine-tuningPer-site LP, in parallelImplicit (learned from the teacher)
Merit (reference)Cleanest site with room (lowest marginal CO₂ now)Per-site LP, in parallelNone
Origin (reference, baseline)Stay where they arriveRun as soon as possibleNone

Other approaches we explored

  • Regional MPC: the joint LP over the 15 regions instead of the sites (a region's sites pooled into one), shares split among its sites by capacity. Its size does not grow with \(N\), but it ignores packing and differences between sites of a region.
  • Single-site control: MARL (HAPPO, via HARL) and sampling-based MPC over SustainDC's discrete joint actions (cross-entropy method, mpc_joint; MPPI). These control one datacenter's load shifting, cooling and battery and are not used in the grid planners.

7Evaluation protocol

  • Grids of 5, 20, 50, 100 and 500 datacenters over the 15 regions (Section 3); 1-day episodes in July 2023; seeds 1–3; mean utilization 50%. Every planner sees the same jobs, CI and weather for a given seed.
  • The diffusion router is trained on separate 5-site grids and days (Section 5.5); it is evaluated on the same episodes as every other planner, never trained on them.
  • Metrics: total CO₂ over the grid and unfinished tasks (work not done by its deadline), as changes relative to the origin baseline; decision time per step.
  • Small case: 5 datacenters. Large case: 500 datacenters.

8Results

Results are being finalized. The tables below show the layout; cells marked — will be filled in. “×” marks a planner that did not finish at that size (time limit or out of memory).

Table 1. Change relative to the origin baseline. Negative is better: less CO₂, fewer unfinished tasks. Mean over seeds.
PlannerCO₂ emissionsUnfinished tasks
5 DCs500 DCs5 DCs500 DCs
MPC, unbundled—× OOM—× OOM
MPC, bundled per class—× time limit—× time limit
Dual, bundled per class (ours)————
Diffusion router (ours)————
Merit————
Table 2. Decision time per step (seconds; the budget is 900 s, one 15-minute step).
Planner52050100500
MPC, unbundled—× OOM×××
MPC, bundled per class—————
Dual, bundled per class, 1 core (ours)—————
Dual, bundled per class, one core per site, computed (ours)—————
Diffusion router (ours)—————
Table 3. Dual's coordination per step: rounds to converge, final gap, site LPs solved, and time (parallel, slowest site per round + master), against one solve of the joint LP.
SitesRoundsGapSite LPs / stepDual time (s)Joint LP time (s)Joint LP variables
5——————
20——————
50——————
100——————
500——————

Figure placeholder: decision time per step vs number of datacenters (log–log, with the 15-minute budget), from scripts/plot_scaling_results.py.

Takeaways

To be written with the results.

9Limitations

  • Fluid planning, whole jobs. The site LPs treat job classes as divisible; execution rounds them to whole jobs, so a site can end slightly over or under its target.
  • A learned router is only as good as its teacher and its training grids. The diffusion router imitates a per-job joint LP that only runs on small grids, so it is trained on 5-site grids and applied to grids of up to 500 sites; whether it generalizes rests on the graph network, with top-\(k\) pruning on the large grids.
  • Migration is free. No transfer energy, latency or data-gravity cost when a job runs away from its origin.
  • Workload realism. One GPU trace, whose 7-week block is replicated to fill the grid; forecasts are evaluated on held-out days of it.

References

  1. A. Naug, A. Guillen, R. Luna, V. Gundecha, et al. SustainDC: Benchmarking for Sustainable Data Center Control. NeurIPS 2024 Datasets and Benchmarks. github.com/HewlettPackard/dc-rl
  2. Y. Zhong, J. G. Kuba, X. Feng, S. Hu, J. Ji, Y. Yang. Heterogeneous-Agent Reinforcement Learning. JMLR 25, 2024.
  3. Hewlett Packard Enterprise. DCcluster-Opt (sustain-cluster): geo-distributed datacenter scheduling benchmark and data. github.com/HewlettPackard/sustain-cluster
  4. G. B. Dantzig, P. Wolfe. Decomposition Principle for Linear Programs. Operations Research 8(1), 1960.
  5. U.S. Department of Energy. EnergyPlus Engineering Reference: Chiller:Electric.
  6. Q. Weng et al. MLaaS in the Wild: Workload Analysis and Scheduling in Large-Scale Heterogeneous GPU Clusters. NSDI 2022.
  7. Z. Sun, Y. Yang. DIFUSCO: Graph-based Diffusion Solvers for Combinatorial Optimization. NeurIPS 2023.
  8. Y. Li, J. Guo, R. Wang, H. Zha, J. Yan. Fast T2T: Optimization Consistency Speeds Up Diffusion-Based Training-to-Testing Solving for Combinatorial Optimization. NeurIPS 2024.
  9. Song et al. CADO: From Imitation to Cost Minimization for Heatmap-based Solvers in Combinatorial Optimization. TMLR 2026. arXiv:2602.08210.