Skip to content

Simulator

rampgate.sim is a deterministic, discrete-event simulator with a virtual clock and seeded randomness. It is in the core and still has zero dependencies. The whole test suite and the benchmark run on it.

Workloads

Each workload has duration_s, steps_per_s, checkpoint_every_s, noise and reports_steps.

  • RampPlateau(load_s, ramp_s, plateau): model loading (up to 30 % of the plateau), a linear ramp, then flat.
  • StepProfile(steps=((t, usage), ...)): piecewise constant.
  • Spiky(base, spike, every_s, spike_s): periodic spikes.
  • EpochEval: training with an end-of-epoch evaluation spike.

Model

  • OOM (simulator v2: true demand vs observation noise): OOMs and victims are decided by each process's true usage; the sample noise only affects what rampgate observes. When foreign load plus the true usage of a device's processes exceeds its capacity, the process whose true usage increased the most in that tick (a real allocation) is killed; if none increased in that tick, the one that increased most recently. A process on its plateau never "grows" from noise, and noise alone never causes an OOM. Simulator v1 (freeze-1 and freeze-2 results) used the noisy samples for both.
  • Preemption: Stop(PREEMPT) saves a checkpoint for ckpt_save_s, then exits. No work is lost.
  • Start-up: JobStarted arrives start_delay_s after Start.
  • Lost work: an OOM rolls a job back to its last checkpoint.
  • Foreign load: constant, or a step schedule, per device.
  • Allocation granularity: a device's alloc_granularity (q_d) is a parameter of the charge (Rule A). The misspec family scenarios round true demand up to 2 GiB blocks and set q_d to 2 GiB; all other scenarios have q_d = 0.
  • Family scenarios (synthetic): f_family* in benchmarks/scenarios.py: 26 jobs of three model families on 2 GPUs, peaks scaling with batch size and sequence length (with a seq² share in the misspec variants). They are not traces of real jobs; see Benchmark.

On real hardware, OOMs, sampling and latency behave somewhat differently; see Real hardware.

Running

  • simulate(scenario, policy, config=..., estimator=..., admission=..., max_time=...) returns a Trace with every tick's events, snapshot, decision and state, and the executor's ground truth. restart_at and downtime test dump/load and reconciliation.
  • run(scenario, strategy, policy=...) returns a Report: makespan, OOM counts (first-contact separately), lost work, utilization, queue waits, and the near-miss metric (report only, never a gate): the run's minimum true headroom (C − true total) / C over ticks, devices and dimensions, evaluated before OOM resolution (negative when a tick overflows), also in GiB of vram, and the number of near-miss ticks (headroom below 1 % of C in some dimension). benchmarks/run.py reports per scenario and row the median minimum headroom, the number of runs below 1 %, the sum of near-miss ticks and the number of Rule V vacates.
  • The baselines GreedyFree, DeclaredReservation and Serial run on the same Engine and differ only in admission.