10/34
Part 2 of 5 · AdmissionLearn and do

Counting GPUs alone leaves every GPU idle

The assumed pool has 64 GPUs and 2,048 vCPUs, shared by the training team and the features team:

Fairness byGPUsvCPUs
dominant share, DRFall 64 in use, by trainingtraining 512, features 1,536
GPUs aloneall 64 idlethe features team took all 2,048

Run DRF on the pool. Both teams climb together to 6 tasks each, a dominant share of 75% each. That uses 48 GPUs and 6 × 64 + 6 × 256 = 1,920 vCPUs.

The features team's 7th task needs 256 vCPUs, and only 128 are left, so it stops. Training's 7th and 8th tasks need 64 vCPUs each, and they fit. Training ends with 8 tasks on all 64 GPUs and 512 vCPUs. Features runs 6 tasks on 1,536 vCPUs. Nothing is idle.

Now measure fairness by GPUs alone. The features team always shows 0 GPUs, so it always looks the most deprived and always goes first. If its backlog is queued first, its tasks take all 2,048 vCPUs (8 × 256). Every training task needs 64 vCPUs, so none can start, and all 64 GPUs sit idle. That's the failure DRF was built for.

Quotas cover the guarantee, and the dominant share orders the borrowing

You rarely run pure DRF. Borg's paper notes that quota reduces the need for policies like DRF. Quotas cover the guaranteed part, and a dominant-share rule orders the borrowing on top.

Kueue's fair sharing works this way. Its proof that preemption settles is written in terms of each queue's dominant resource share. When it preempts, it prefers jobs from the ClusterQueues with the highest share first.

In the editor, write dominant_share(n_tasks, demand, capacity), then finish drf(capacity, demands). The stub gives you used, how much of one resource all the tasks take, and fits, whether a team's next task still fits.