32/34
Part 5 of 5 · Spot, failures and metricsLearn and do
A job asks for H100s, and only A100s are free
Let jobs declare the flavors they accept, and admit on another flavor when the first is full. Kueue calls this resource fungibility: when one resource flavor is fully used, it can admit the job on a different one. If the speeds differ a lot, charge quota in normalized units, since mixed accelerators speed up different models by different amounts.
In the editor, write pick_flavor(accepts, free, gpus) and charge(gpus, flavor). SPEED is an assumed quota rate: an H100 counts as 2 units and an A100 as 1, and the last lines ask for 8 GPUs when no H100 is free.