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
noiseonly 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 forckpt_save_s, then exits. No work is lost. - Start-up:
JobStartedarrivesstart_delay_safterStart. - 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 setq_dto 2 GiB; all other scenarios haveq_d= 0. - Family scenarios (synthetic):
f_family*inbenchmarks/scenarios.py: 26 jobs of three model families on 2 GPUs, peaks scaling with batch size and sequence length (with aseq²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 aTracewith every tick's events, snapshot, decision and state, and the executor's ground truth.restart_atanddowntimetest dump/load and reconciliation.run(scenario, strategy, policy=...)returns aReport: 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) / Cover ticks, devices and dimensions, evaluated before OOM resolution (negative when a tick overflows), also in GiB ofvram, and the number of near-miss ticks (headroom below 1 % ofCin some dimension).benchmarks/run.pyreports 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,DeclaredReservationandSerialrun on the same Engine and differ only in admission.