Every deployed cluster scheduler denominates entitlement in devices — whole accelerators, fractions of one, or a share of wall clock. Devices are a proxy. The quantity actually consumed, paid for, and reported under an energy-disclosure regime is energy, and a device-count quota cannot express "this team may spend 40 MJ this window". So the budget that matters is enforced nowhere and reconciled after the fact, if at all. A survey of our own tree found the gap on both sides: `over-quota` and `fair-share` appear in zero files, so we had no entitlement model either. `pool/1` denominates entitlement in microjoules AND devices, and enforces both. Three rules carry it, and each needs the energy unit to state at all: 1. **A guess may not spend a neighbour's capacity** (SPEC §4.4). A claim whose estimate is `Estimator` — nobody measured or modelled it — is admitted only inside its own guarantee, never against surplus borrowed from a sibling. A tenant may bear its own mis-estimate; a sibling's unspent joules are not the tenant's to gamble, and an unobserved estimate is the figure most likely to be wrong in the direction that overcommits. 2. **A gang is all-or-nothing in joules, not only in slots** (§2.4). Gang scheduling exists because half a distributed job is worse than none of it; the same holds for its energy. Admitting part of a gang against a budget that cannot finish the whole gang spends real joules and delivers nothing. 3. **Preemption follows evidence, then declaration** (§5.2). Workloads with a measured cost per COMPLETED unit are reclaimed worst-first. Workloads that have completed nothing are unmeasured, not wasteful, and fall back to declared priority. Rule 3 is why the energy unit is load-bearing rather than decorative: it ranks by cost per completed unit, which needs an outcome anchor. A scheduler that knows only device-seconds cannot express the ordering. Two disciplines from the family are built in from the start rather than retrofitted: - **Unknown is never an extreme.** `uj_per_completed_unit` returns `None` with no completed unit (§5.1) — not zero, which would make a new workload unreclaimable, and not infinity, which would make every new workload the first victim and destroy the very work that would have produced the measurement. - **Pending and refused are different verdicts** (§4.5). A claim that cannot fit today queues; one that can never fit as written is denied, with the reason. Reporting the second as the first is how a queue fills with work that will never run. Admission order is normative (§4), because a different order gives a different verdict: impossibility first, then devices, then the guarantee, then borrowing. Surplus is shared by weight against every borrower under one parent, so a tenant cannot take it all by claiming first, and never crosses roots. Scope is deliberately narrow (§1.1, §7): `pool/1` decides admission and preemption order. It does not place, meter or execute. A verdict is only as sound as the figure handed to it, so the grade travels into the verdict itself rather than sitting beside it. 10 tests, including the discriminating pair for rule 1 — the same claim with the same surplus available, differing only in whether anyone measured the estimate. Co-Authored-By: Claude Opus 5 <[email protected]>
1 line
8 B
Text
1 line
8 B
Text
/target
|