Teams borrow idle quota, and owners take it back
Strict quota wastes GPUs when a team has nothing to run.
Team B borrows team A's idle GPUs. Then A submits jobs. What happens to B's borrowed jobs?
Team A's quota is 48 GPUs, and team B is in the same cohort:
| Step | A's 48 GPUs |
|---|---|
| 1. A has no work | all 48 idle |
| 2. B borrows them | B's jobs run on A's quota |
| 3. A submits jobs | A preempts B's borrowed jobs |
| 4. A is back | A uses all 48, and B's preempted jobs wait |
Each team gets a nominal quota, the amount it's guaranteed, of each resource flavor, one kind of hardware. For example, 48 H100 GPUs. Quotas group into cohorts. A cohort is a group of teams that lend idle quota to each other. Capacity a team isn't using can be borrowed by other teams in its cohort. When the owner comes back, it reclaims its quota by preempting the borrowers.
Kueue's fair-sharing mode spells out the reclaim rule. A ClusterQueue with jobs waiting may preempt other jobs in its cohort. It may preempt until it has its fair part of the pool, equal or by a weight you set. The pool is the borrowable resources: the unused nominal quota of all the ClusterQueues in the cohort.
Netflix uses this to keep guarantees without leaving them idle. Preemption lets Netflix Batch keep each tenant's reservation, and still lend that capacity to other tenants while the reservation isn't in use. Before Kueue, Netflix's batch system had no preemption. Once a job was admitted, it ran to completion, however fair-share demand shifted.
The rule must not flip back and forth, or two teams preempt each other forever. Kueue's docs prove this for their strategies: "if workload A preempts workload B, then workload B will not be able to preempt Workload A afterwards." Say in the round that your reclaim rule settles, and why.
In the editor, write idle_pool(quota, used) for a whole cohort, and reclaim(quota, used, lent, ask) for one owner. The last line is step 3 of the table: team A has 48 GPUs of quota, all lent to B, and submits a 32-GPU job.
- 1
Write
idle_pool(quota, used): the GPUs a cohort can lend, each team's unused quota added up. A team using more than its quota adds nothing. - 2
Write
reclaim(quota, used, lent, ask): the lent GPUs the owner preempts so a job ofaskGPUs can start. Use the idle quota first, and never take back more than was lent.
Run your code to check it. Output shows here.