Log inStart free
LESSON 2.36 · 6 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW

Combinatorial optimization

See every way to share 5 jobs between 2 GPUs, and search for the best.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 2 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 2.36 · SEARCH BAY5 JOBS · 2 GPUS · 32 SCHEDULES
01
Stage 1 of 6 · Discrete choices
Combinatorial optimization picks the best of a finite set of options. 5 jobs on 2 GPUs give 32 schedules.
Explain it simply

5 training jobs have to share 2 GPUs. Each job runs on one GPU or the other, never half on each. So there's no slope to follow, as in gradient descent. Each job doubles the choices, so the tree ends in 32 leaves, one for each schedule.

5 jobs of 2, 2, 3, 3, 4 hours. A tree with 5 levels splits at each job into GPU 1 and GPU 2. It ends in 32 leaves.

job and its hoursGPU, greedy planmakespan, best planidle GPU, search timecut branch
jobsscheduleGPU 1GPU 20246810121416 hA 2hB 2hC 3hD 3hE 4hplans: one level per job2 × 2 × 2 × 2 × 2 = 32 leavesE 4hC 3hD 3hA 2hB 2hGPU 1GPU 2jobsscheduleGPU 1GPU 20246810121416 hA 2hB 2hC 3hD 3hE 4hplans: one level per job2 × 2 × 2 × 2 × 2 = 32 leavesE 4hC 3hD 3hA 2hB 2hGPU 1GPU 2
Toy: 4 to 6 training jobs · 2 GPUs · every schedule is a leaf of the tree
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
∣S∣=G n|\sy{S}{out}{S}| = \sy{G}{param}{G}^{\,\sy{n}{data}{n}}
∣S∣=25=32|S| = 2^{5} = 32

With G GPUs and n jobs, there are G to the n schedules.

Common mix-ups

MYTHA greedy rule always finds the best schedule.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01With 6 jobs, how many schedules does the tree hold?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 2 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.