liveBook · Manning

Priority-based scheduling

As explained in Distributed Machine Learning Patterns

Priority scheduling is a scheduling algorithm that orders work according to assigned priority levels and may preempt lower-priority work.

Priority-based scheduling orders queued work by assigned priority rather than first-come, first-served order. When capacity is scarce, a higher-priority job can run first; it may also preempt or evict lower-priority work already using the required compute resources. This provides an escape from workloads that are blocked by strictly sequential scheduling and helps keep urgent work moving. section 6.2.2 section 6.7

In a shared machine-learning cluster, priority is an operational control, not a guarantee of fairness. Unrestricted top-priority submissions can cause other jobs to be evicted or never scheduled, so administrators need rules and limits on high-priority job creation. section 6.2.3

Use priority-based scheduling when the system needs to:

  • Run urgent jobs ahead of lower-importance queued work when resources are released. section 6.2.2
  • Reclaim resources from a running low-priority job for newly submitted high-priority work. section 6.2.2
  • Complement fair-share scheduling where first-come, first-served execution can leave no job able to proceed. section 6.2.2

Ordering and preemption

For four concurrent jobs, A and C marked high priority run before D, marked medium, and B, marked low. If low-priority B is already running when high-priority A arrives, B can be preempted: its resources are released and assigned to A. section 6.2.2

Figure 6.8 The order of execution for the four jobs (A, B, C, and D) where the running low-priority job is preempted by a new job with higher priority
06-08

This execution order illustrates a newly arrived high-priority job preempting a running low-priority job when compute resources are unavailable. section 6.2.2

How Distributed Machine Learning Patterns covers it

How deep it goes
Defines priority ordering and preemption through queue and running-job scenarios, then addresses governance risks without configuration details.
Examples
Illustrates four jobs ranked high, medium, and low, plus preemption of running low-priority job B by high-priority job A.
What it assumes
Assumes familiarity with jobs, queues, shared compute resources, and first-come, first-served scheduling.
What you can do after
Evaluate/understand when priority ordering and preemption unblock urgent work, and when priority limits are needed to protect other jobs.
How it connects
Connects priority scheduling with fair-share scheduling, gang scheduling, elastic scheduling, resource starvation, and deadlocks.

Also explained in

Compare how 2 books explain priority-based scheduling →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Distributed Machine Learning Patterns. The section links point to the parts of the book it draws on.