window.huggingface={variables:{"SPACE_CREATOR_USER_ID":"67a8e12e5bb641683778c4be"}};d> GPU Scheduler OpenEnv Blog
OpenEnv Technical Writeup

GPU Scheduler OpenEnv

A compact OpenEnv benchmark for AI-assisted GPU inference scheduling. An agent observes a small simulated GPU cluster, decides where pending inference-style jobs should run, and is scored on deadline handling, resource fit, allocation, and cost.

Action Space place / defer
One scheduling decision per tick keeps the task compact and inspectable.
Canonical Scenarios 4
Deadline pressure, cost pressure, patience under scarcity, and large-GPU reservation.
First LLM Baseline gpt-4.1-mini
Competitive with heuristics on the first two public scenarios with zero invalid actions.

1. Why This Environment Exists

Many agent benchmarks focus on browsing, code generation, or static tool use. Operational systems have a different shape: the state changes over time, each action changes the future decision surface, and reward should come from the environment rather than from a hidden grader. GPU scheduling is a clean version of that problem.

This benchmark is intentionally not a production scheduler. It does not claim to model CUDA kernels, real cluster telemetry, or datacenter-scale orchestration. The question it asks is narrower and more useful for benchmarking: can an agent make good short-horizon scheduling decisions under fit, urgency, allocation, and cost pressure?

Key insight The benchmark's value is not in simulating a real cluster. It is in creating a clean, scorable sequential decision problem where every tradeoff is explicit and measurable.

2. System Architecture

Definition: OpenEnv OpenEnv is a framework for building and evaluating agent environments. It provides a standard reset() / step() interface, an HTTP server layer, and a built-in /web inspection UI. Agents interact through structured actions and receive scalar reward from environment dynamics, not from a hidden grader.
Scenario ConfigHand-authored scenarios and seeded generation define jobs, GPU tiers, and tick budget.
GPU Scheduling SimulatorValidates actions, advances time, tracks allocations, and computes reward.
Environment WrapperExposes a standard reset/step loop and adds dashboard-oriented fields for inspection.
OpenEnv Server and Web UIProvides /reset, /step, /state, and the interactive console at /web.
Agent ConsumersLocal Python agents, LLM rollout runner, lightweight RL trainer, and heuristic baselines all consume the same interface.
Evaluation ReportsBenchmark tables, generated visuals, and human inspection traces are produced from the same environment loop.
  1. Scenario definitions create a small GPU cluster and a pending queue of jobs.
  2. The simulator validates actions, advances time, and computes reward.
  3. A thin environment wrapper exposes a standard reset() / step() loop.
  4. That loop is consumed by heuristics, an LLM rollout script, a lightweight learned policy, and the OpenEnv web interface.

The important point is that the reward is environment-derived. Nothing in the benchmark silently grades free-form language output. The agent acts, the environment evolves, and the score follows from those dynamics.

3. The Scheduling Task

Definition: Scenario and Tick A scenario is one complete run of the scheduling environment, from the initial cluster state until either all jobs are resolved or the tick budget is exhausted. A tick is a single time step within that run. On each tick, the agent issues exactly one action, the simulator processes it, and the environment transitions to the next state.

Task Shape

  • 3 abstract GPU types with different VRAM, speed, and cost
  • 6 to 10 pending inference-style jobs
  • 10 to 20 scheduling ticks

Action Space

Definition: Action Space The complete set of actions an agent may issue at any tick. Here it is intentionally minimal: place(job_id, gpu_id) or defer().
  • place(job_id, gpu_id) assigns a pending job to a specific GPU.
  • defer() takes no placement action this tick and waits for conditions to change.
  • Each action also carries a short rationale. Rationales are logged and shown in the UI but are not scored in v1.

Observation Space

Definition: Observation Space The full state representation the agent receives at each tick before choosing an action.
Base StatePending jobs, running jobs, completed jobs, missed jobs, per-GPU state, cumulative metrics, and action history.
Dashboard Fieldssummary, action_hint, concise GPU status lines, and queue status lines for the OpenEnv surface.
Why It WorksThe same structured observation is usable from heuristics, prompted models, and browser inspection.
Key ConstraintKeeping the action space to two verbs forces the interesting policy work into when and where to place.
Key insight Keeping the action space to just two verbs, place and defer, forces the policy work into timing and fit rather than parsing a complex command grammar.

4. Reward Design

Definition: Reward Shaping Reward shaping is the deliberate design of bonus and penalty terms that guide an agent toward desired behavior beyond simple task completion.

The reward function is deliberately simple and environment-grounded. Formally, the total reward accumulated over a scenario is:

R = Σ_j [ r_complete(j) + r_priority(j) ]
  - Σ_j   p_missed(j)
  - Σ_a   p_invalid(a)
  - Σ_t   p_idle(t)
  - Σ_t   p_cost(t)
Term Sign Description
r_complete(j)+Positive reward for successfully completing job j.
r_priority(j)+Extra bonus scaled to the priority level of job j.
p_missed(j)-Penalty when job j misses its deadline.
p_invalid(a)-Penalty for issuing an infeasible placement action.
p_idle(t)-Penalty for leaving GPU capacity idle while jobs are still pending.
p_cost(t)-Penalty for running more expensive GPUs than necessary.

That combination is enough to make policies diverge for the right reasons. A policy that only cares about packing VRAM tightly can still lose if it misses urgent jobs. A policy that always grabs the largest GPU can finish work quickly but overspend. A policy that waits too conservatively can avoid some mistakes but still waste turns and tighten deadlines.

Key insight The reward function is designed so that no single greedy heuristic can dominate. Each canonical scenario is constructed to expose the failure mode of optimizing one term at the expense of the others.

5. Included Scenarios

The benchmark uses four fixed, hand-authored evaluation scenarios. Each is designed to stress-test a different axis of scheduler competence.

Scenario Primary Test Optimal Strategy
deadline_crunchUrgency-aware scheduling under time pressurePrioritize jobs by deadline, even at higher cost
cost_pressureBalancing throughput against GPU spendChoose fit-for-purpose GPUs and avoid over-provisioning
wait_for_capacityPatience under short-term resource scarcityIssue defer() on tick 1 to await cheaper GPU availability
reserve_large_gpuReservation of scarce resources for the right workloadResist placing low-value jobs on the only large-VRAM GPU
Key insight A policy that scores well on all four scenarios must internalize urgency handling, cost awareness, patience under scarcity, and strategic reservation.

6. Baselines and Results

The current repo includes five reference baselines: FIFO, earliest deadline first, best-fit VRAM, a structured-output gpt-4.1-mini rollout, and the lightweight learned rl_linear_policy.

Policy Scenario Total Reward Completed Missed Invalid Allocation Total Cost
fifodeadline_crunch29.85100.27819.2
earliest_deadline_firstdeadline_crunch48.86000.28621.2
best_fit_vramdeadline_crunch32.25100.38917.8
fifocost_pressure51.07000.33329.0
earliest_deadline_firstcost_pressure44.77000.21230.8
best_fit_vramcost_pressure34.66100.29624.4
fifowait_for_capacity36.35000.25018.7
earliest_deadline_firstwait_for_capacity35.85000.25018.7
best_fit_vramwait_for_capacity40.45000.25014.6
fiforeserve_large_gpu37.55000.33321.0
earliest_deadline_firstreserve_large_gpu33.45000.33324.1
best_fit_vramreserve_large_gpu37.55000.40021.0
gpt-4.1-minideadline_crunch48.56000.25020.0
gpt-4.1-minicost_pressure51.57000.33329.0
rl_linear_policydeadline_crunch48.56000.14320.0
rl_linear_policycost_pressure46.37000.25932.2
rl_linear_policywait_for_capacity35.85000.20018.7
rl_linear_policyreserve_large_gpu32.05000.26726.0
  • earliest_deadline_first is strongest on deadline_crunch, which is exactly what that scenario is designed to reward.
  • best_fit_vram is strongest on wait_for_capacity, where paying for the large GPU too early is the wrong move.
  • gpt-4.1-mini is already competitive with the heuristics and maintains zero invalid actions on the public LLM scenarios.
  • The lightweight learned policy remains solid on the original two scenarios, but the defer-sensitive scenarios are harder and expose weaker reservation behavior.

7. Figures

The figures below show the benchmark comparison across policies and scenarios, followed by two scheduler-console views: the environment at reset and the console after one placement action.

Benchmark comparison chart across policies and scenarios
Figure 1. Total reward by policy and scenario. Each column isolates a distinct scheduling competency, and no single heuristic wins all four.
OpenEnv web dashboard at reset
Figure 2. The current scheduler console at reset with the pending queue, cluster inventory, and operator detail visible before the first placement decision.
OpenEnv web dashboard after one action
Figure 3. The current console after one real placement dispatch, showing updated running state, allocation metrics, and action history.

8. What the LLM Baseline Shows

The first live model run is useful because it does not fail on schema compliance. It fails on policy sharpness, which is exactly the kind of benchmark signal you want from this environment.

  • Strong at fit reasoning and obvious urgency handling.
  • Zero invalid actions on the public LLM scenarios.
  • Weaker when it should parallelize aggressively instead of deferring conservatively.

9. How to Use the Environment

  • Run the browser console at /web.
  • Swap in a local policy via examples/custom_agent.py.
  • Call the OpenEnv server over /reset, /step, and /state.
  • Use green_agent/runner.py as a thin adapter around your own policy or LLM call.

Links