9/34
Part 2 of 5 · AdmissionLearn and do

Compare teams by their largest share

Assume a pool with 64 GPUs and 2,048 vCPUs, where CPU jobs may run too:

TeamPer taskGPU share per taskCPU share per taskDominant share per task
Training8 GPUs, 64 vCPUs8/64 = 12.5%64/2,048 = 3.1%12.5% (GPU)
Features0 GPUs, 256 vCPUs0%256/2,048 = 12.5%12.5% (CPU)

What does an equal share mean when one team uses GPUs and the other uses CPUs? Take each team's share of each resource. The largest of those is the team's dominant share, and that resource is its dominant resource.

Dominant Resource Fairness (DRF) tries to make the smallest dominant share as large as it can. To do that, it gives the next task to the team with the lowest dominant share, again and again.

The DRF paper's own example: 9 CPUs and 18 GB, split between a team whose tasks need 1 CPU and 4 GB and a team whose tasks need 3 CPUs and 1 GB. DRF gives the first team three tasks and the second two. Each ends up with two thirds of its dominant resource.

In the editor, write shares(per_task, tasks, capacity) and dominant(per_task, tasks, capacity). POOL and TEAMS are the pool and the two teams from the table, so each team's dominant share for one task should be 12.5%.