Home · ASPLOS 2023 · Machine Learning Systems

ElasticFlow: An Elastic Serverless Training Platform for Distributed Deep Learning

Diandian Gu, Yihao Zhao, Yinmin Zhong, Yifan Xiong, Zhenhua Han, Peng Cheng and 4 others

Conference
ASPLOS 2023
Published
2023
Pages
266-280
Citations
57

Training platforms make developers guess a GPU count and hold it until the job ends — ElasticFlow asks only for the model and a deadline, admits jobs by the minimum GPU share that provably meets each deadline, and spends leftover GPUs where diminishing returns bite least, meeting 1.5–7.7× more deadlines on a 128-GPU cluster.

The argument in one glance

  1. Problem

    Training jobs are submitted like servers, not like goals

    On today’s clusters a developer requests machines — so they must solve a systems problem (GPU count, local batch size per GPU’s memory, placement) entangled with their actual deep-learning problem (model, global batch size, learning rate). And production needs guarantees: models retrained on schedule for product releases — but no platform promises a finish time.

  2. What people did

    Smarter cluster schedulers

    A generation of DL schedulers improved sharing and speed: Gandiva introspects and migrates jobs, Tiresias orders them cleverly, Themis adds fairness, Pollux elastically co-optimizes throughput and statistical efficiency, Chronus targets deadlines.

  3. Why it fell short

    Each has half the answer

    The elastic schedulers (Pollux) ignore deadlines; the deadline-aware ones (EDF, Chronus) are not elastic and strand idle GPUs. Underneath, two physics facts complicate everything: throughput scales concavely with GPU count (communication overhead grows), and the curve itself depends on placement (NVLink within a server vs slower links across servers).

  4. This paper's idea

    Serverless in, deadline-guaranteed out

    ElasticFlow’s interface takes a model, hyperparameters, a termination condition, and a deadline — no GPU count, no time reservation. Admission control computes each job’s Minimum Satisfactory Share (the least GPU allocation that meets its deadline) and admits only what it can guarantee; a greedy allocator spends surplus GPUs where marginal returns are highest (provably optimal for concave curves); buddy allocation with power-of-two workers makes placement fragmentation-free. Result: 1.46–7.65× more deadlines met on 128 A100s.

Why this problem is worth solving

Training a deep neural network on a cluster today follows the server-centric model: the developer requests instances, wraps code in containers, picks a worker count, and divides the global batch size by it to fit each GPU’s memory. Two different kinds of expertise collide in one person. Tuning the global batch size and learning rate is a machine-learning problem; choosing worker counts and local batch sizes is a systems problem — and most DL developers are not systems engineers.

The second gap is guarantees. Production pipelines retrain models on schedules — the paper’s example is fine-tuning BERT with daily news so a recommendation service updates every day. What the developer actually wants to express is a deadline. No server-centric platform can promise one, because a fixed-size reservation cannot adapt when the cluster gets busy or idle.

What makes deadline scheduling for training genuinely hard is the shape of the scaling curve. Distributed data-parallel training synchronizes gradients among workers every iteration, so throughput grows concavely with GPU count — each added GPU helps less than the last, and per-GPU efficiency falls. Worse, the curve depends on placement: eight workers inside one server ride NVLink; spread across four servers they ride slower inter-server links, yielding a different curve entirely. A deadline scheduler must reason over a family of placement-dependent, non-linear curves per job. (For the inference-side twin of this problem — serverless functions with latency SLOs — see the INFless explainer elsewhere on this site.)

What people did before, and where it broke

Generic cluster managers (Kubernetes, YARN) treat DL jobs as opaque containers — no elasticity, no deadline awareness, low utilization.

DL-specialized schedulers each solved a slice. Gandiva introspects and migrates but keeps the user-specified GPU count. Tiresias reduces completion time with clever queueing — also non-elastic. Themis adds finish-time fairness. Pollux is genuinely elastic, adapting GPU counts to co-optimize throughput and statistical efficiency — but it optimizes average completion time, not promises. Chronus is deadline-aware — it prioritizes SLO jobs — but not elastic, so it cannot exploit idle GPUs to bank time against future load. Earliest-Deadline-First (EDF), the classic real-time policy, fails differently: with non-linear scaling, giving the most urgent job all the GPUs it can use wastes enormous GPU-time (diminishing returns) that later jobs needed — the paper’s motivating example shows EDF missing deadlines an optimal schedule meets comfortably.

The missing combination — elastic and deadline-guaranteed — is exactly the pairing that requires solving the concave-curve admission problem, which is ElasticFlow’s core contribution.

ElasticFlow's pipeline, from function to finished model

  1. Serverless interface new

    The developer submits a function: DNN model, hyperparameters (global batch size, learning rate), termination condition (a maximum iteration count, optionally accuracy targets), a deadline, dataset and optimizer. No GPU count, no duration. The platform derives local batch sizes and worker counts.

  2. Admission control new

    Computes the job’s Minimum Satisfactory Share — the smallest (possibly time-varying) GPU allocation meeting its deadline given already-admitted jobs — by progressive filling over deadline-sorted jobs. Admits only if all guarantees still hold; otherwise the job is dropped immediately, honestly.

  3. Elastic resource allocation new

    After every job holds its minimum share, surplus GPUs go one at a time to the job with the highest marginal throughput gain — a greedy rule the paper proves optimal for concave scaling curves. Speeding jobs past their deadlines frees GPUs sooner, making room to admit future arrivals.

  4. Buddy placement new

    Worker counts are restricted to powers of two, and jobs are placed by Best-Fit into subtrees of the GPU hierarchy (GPUs within servers, servers within racks). Combined with migration, this provably eliminates fragmentation — placement decouples from admission and allocation entirely.

  5. Elastic PyTorch runtime

    A prototype in 8,800+ lines of Python drives PyTorch DDP with NCCL, scales and migrates workers on scheduler events, and profiles each job’s scaling curve before and during execution (~0.01 s per epoch overhead).

Open source; evaluated on 16 Azure ND A100 v4 servers (128 A100 GPUs, 8 InfiniBand HCAs each) plus a simulator validated to within 3% of testbed results.

The idea

Make the interface say what users mean. Users mean “train this model, done by Friday.” The serverless interface captures exactly that, and its omissions are the design: by not letting users pin a GPU count, the platform gains the freedom to rescale jobs at any moment — the freedom every guarantee below depends on.

Measure jobs in GPU-time, not GPUs. With concave curves, one GPU is always the most efficient allocation (resource usage = GPUs × time is minimized), but deadlines forbid pure efficiency. The

MSS — the least resource allocation, possibly varying over time slots, that lets a job finish by its deadline given the shares already promised to admitted jobs
formalizes the compromise: spend as little GPU-time as the deadline allows, no less. Note the subtlety the paper’s Figure 4 illustrates: MSS is not a single number — a job might need one GPU now and four later, because earlier slots are crowded with already-admitted jobs. That is why a simple binary search fails and admission uses progressive filling: sort jobs by deadline, grow each job’s allocation until its deadline is satisfiable, and reject the newcomer if any guarantee would break.

Admission control is a feature, not a failure. Dropping a job at submission — while it can still be run elsewhere or renegotiated — is strictly kinder than accepting it and silently missing the deadline. Every admitted job’s deadline is guaranteed by construction; EDF-style optimistic acceptance is where the 7.65× gap comes from.

Spend the surplus where curves are steepest. Leftover GPUs are handed out one at a time to the job whose throughput gains most from one more GPU. Under concave curves this greedy rule is provably optimal. The effect compounds: accelerated jobs finish early, GPUs free up early, and future arrivals find a roomier cluster — elasticity converts idle capacity into future admissions. Best-effort and soft-deadline jobs slot into the same framework with infinite deadlines, fed after guaranteed shares.

Erase placement as a variable. Because scaling curves depend on topology, placement threatens to entangle everything. ElasticFlow cuts the knot: power-of-two worker counts plus migration implement

the classic memory-allocator scheme where blocks of size 2^k split and merge cleanly, guaranteeing no fragmentation
over the GPU hierarchy — if enough idle GPUs exist anywhere, a topologically compact subtree exists too. Placement becomes a solved sub-problem (Best-Fit into subtrees), and admission can trust one conservative curve per size.

A BERT fine-tune with a Friday deadline

MSS = minimum satisfactory share. Scaling curve = throughput vs GPU count, profiled per job (concave). Time slots = scheduler intervals. The job and numbers are illustrative; mechanics follow Algorithms 1–2 and Figure 4 of the paper.

Step 1 of 6

Submit a goal, not a reservation

The developer submits a function: the BERT model, global batch size 512, learning rate schedule, termination at 50,000 iterations, deadline Friday 08:00. Nowhere does it say "16 GPUs" or "for 20 hours" — ElasticFlow will decide both, differently at different times.

job = {model, hyperparams, max_iters, deadline}
GPU count / duration: platform-owned

Why it works

  • The interface withholds GPU counts from users → every job is rescalable at any instant → the scheduler can promise outcomes because it, not the user, owns the means.
  • Concave curves make GPU-time the real currency → MSS spends the minimum GPU-time each deadline permits → guaranteed jobs occupy as little of the future as possible, maximizing admissions.
  • Progressive filling accounts for already-promised slots → MSS is computed against reality, including time-varying shares → admission decisions are safe, not optimistic.
  • Marginal-return-greedy surplus allocation is optimal for concave curves → surplus turns into early finishes → early finishes turn into future capacity, a feedback loop static schedulers never get.
  • Power-of-two sizing + migration = buddy allocation over the GPU hierarchy → fragmentation is impossible → placement-dependent curves collapse to one curve per size, keeping admission tractable.

What it costs

  • Dropped jobs. Guarantees are bought by refusing unguaranteeable work; users must handle rejection (and the paper leaves anti-gaming quotas and pricing to operators).
  • Power-of-two rigidity. Worker counts of 3, 5, or 6 are off the menu; the buddy guarantee is purchased with allocation granularity.
  • Scaling and migration overheads. Every rescale checkpoints and relaunches workers; measured and modeled, but nonzero — and frequent bursts mean frequent rescales.
  • Profiling trust. MSS is only as good as the scaling curve; curves are profiled per job and adjusted online, but unpredictable jobs (accuracy-based termination) are bounded by max iterations rather than known precisely.
  • Data-parallel scope. The design targets DDP-style training; model/pipeline parallelism and its different scaling behavior are outside the evaluation.

The evaluation

The testbed is serious: 16 Azure ND A100 v4 servers — 128 A100 GPUs with NVLink inside servers and 8 HDR InfiniBand adapters each — driven by two months of real job traces from ten of Microsoft’s internal ITP clusters, with six model families (VGG16, ResNet50, Deep Speech 2, Inception V3, BERT, GPT-2). A simulator validated to within 3% of testbed results extends the comparison. The metric is the deadline satisfactory ratio: the fraction of jobs finishing by their deadlines.

Six schedulers vs ElasticFlow on deadline satisfaction

PropertyNon-elastic, deadline-blind (Gandiva / Tiresias / Themis)Deadline-aware, non-elastic (EDF / Chronus)Elastic, deadline-blind (Pollux)ElasticFlow
Design position
Deadlines met (128 GPUs, 195-job production trace)
Behavior under light load / bursts
What the ablation says—EDF + admission control alone: insufficient
Testbed: 16× Azure ND A100 v4 (128 A100-40GB, NVLink + 8× HDR InfiniBand per server); workloads from two months of Microsoft ITP production traces; models VGG16 / ResNet50 / Deep Speech 2 / Inception V3 / BERT / GPT-2. Larger-scale results via a simulator with ≤3% error vs testbed. Metric: fraction of jobs meeting deadlines; best-effort jobs handled with infinite deadlines after guaranteed shares.Underlined values explain themselves when clicked.

Check your understanding

  1. 1. Earliest-Deadline-First gives the most urgent job as many GPUs as it can use. Predict why this classic policy performs WORST (7.65× fewer deadlines met) among all baselines.

  2. 2. Why can a job’s Minimum Satisfactory Share be a time-VARYING allocation (e.g., 1 GPU now, 4 GPUs later) rather than a single number found by binary search?

  3. 3. Two servers each have 7 of 8 GPUs allocated. A new job needs 2 well-connected GPUs; 2 are free cluster-wide. How does ElasticFlow guarantee this never becomes a deadlock?

  4. 4. After every admitted job holds its minimum share, why does giving surplus GPUs to the job with the highest MARGINAL gain (rather than the earliest deadline, or evenly) matter for jobs that arrive tomorrow?

Related papers on Machine Learning Systems

See all 212 →