Gandiva: Introspective Cluster Scheduling for Deep Learning — Detailed Summary

Wencong Xiao, Romil Bhardwaj, Ramachandran Ramjee, Muthian Sivathanu, Nipun Kwatra, Zhenhua Han, Pratyush Patel, Xuan Peng, Hanyu Zhao, Quanlu Zhang, Fan Yang, Lidong Zhou | Beihang University / Microsoft Research / The University of Hong Kong / Huazhong University of Science and Technology / Peking University | OSDI '18, October 8–10, 2018, Carlsbad, CA, pp. 595–608 | ISBN 978-1-939133-08-3

Per-section summary organized by the paper's heading structure. Each section includes paragraph-level bullet points and exact quantitative results where the paper provides them. The first two authors contributed equally; Xiao, Han, Peng and Zhao performed the work as interns at Microsoft Research. Shepherd: KyoungSoo Park.


Abstract

"We show via a prototype implementation and micro-benchmarks that Gandiva can speed up hyper-parameter searches during deep learning by up to an order of magnitude, and achieves better utilization by transparently migrating and time-slicing jobs to achieve better job-to-resource fit."


1. Introduction

Epigraph: "All men schedulers make mistakes; only the wise learn from their mistakes." — Winston Churchill (with "men" struck through and replaced by "schedulers").

Characteristic 1 — feedback-driven exploration.

Characteristic 2 — heterogeneity.

Characteristic 3 — intra-job predictability (the enabler).

Framework contribution — five APIs.

Implementation and results preview.

Stated contributions.

  1. Illustrate the unique characteristics of the DL workflow and map them to specific cluster-scheduling requirements.
  2. Identify generic primitives usable by a DLT scheduling policy, and make time-slicing and migration an order of magnitude more efficient — and therefore practical — by leveraging intra-job periodicity.
  3. Propose and evaluate an introspective scheduling framework that continuously refines its decisions, improving early-feedback time and cluster efficiency.

2. Background


3. DLT Job Characteristics

3.1 Sensitivity to locality

3.2 Sensitivity to interference

3.3 Intra-job predictability


4. Design

4.1 Mechanisms

Overview — three ways to remove exclusivity and fixed assignment (Figure 6): (1) during overload, incoming jobs time-share GPUs with existing jobs, via a custom suspend-resume mechanism tailored for DLT jobs plus selective packing; (2) efficient migration of a job from one GPU set to another — letting time-sliced jobs move to recently vacated GPUs, or de-fragmenting the cluster so incoming jobs get good locality; (3) a GPU grow-shrink mechanism so idle GPUs are used opportunistically. All three are supported by introspection: continuous profiling of resource usage and estimation of job performance.

Suspend-Resume and Packing.

Migration.

Grow-Shrink.

Profiling.

4.2 Scheduling Policy

Definitions and assumptions.

Goals.

4.2.1 Reactive Mode

Algorithm 1 — getNodes(in job, out nodes)

 1: nodes0 ← findNodes(job.gpu, affinity ← job.gpu)
 2: nodes1 ← minLoadNodes(node0)
 3: nodes2 ← findNodes(job.gpu, affinity ← 0)
 4: nodes3 ← findNodes(job.gpu)
 5: if nodes1 and height(nodes1) < 1:
 6:     return nodes1        // Same affinity with free GPUs
 7: if nodes2 and numGPUs(nodes2) ≥ job.gpu:
 8:     return nodes2        // Unallocated GPU servers
 9: if nodes3:
10:     return nodes3        // Relax affinity constraint
11: elif nodes1:
12:     return nodes1        // Allow over-subscription
13: else:
14:     enqueue(job)         // Job queued

(The PDF prints line 3 as findNodes(jog.gpu, ...) — a typo for job.gpu.)

4.2.2 Introspective Mode


5. Implementation

5.1 Scheduler

5.2 Modifications to DL toolkits

PyTorch time-slicing.

TensorFlow migration.


6. Evaluation

Hardware and software setup.

"Our servers are 12-core Intel Xeon [email protected] with 448GB RAM and two 40Gbps links (no RDMA), running Ubuntu 16.04. Each server has either four P100 or four P40 GPUs. All servers are connected to a network file-system called GlusterFS with two-way replication on the server disks (SSDs)."

6.1 Micro-benchmarks

Time-slicing.

Packing.

Table 1: Packing multiple jobs on P40 (mb/s = minibatches/s)

Job GPU Util (%) Time Slicing (mb/s) Packing Max (mb/s) Packing Gain (%)
VAE 8.7 81.8 419.3 412
SuperResolution 14.1 40.3 145.2 260
RHN 61.6 10.1 14.8 46
SCRNN 66.8 16.7 23.3 39
MI-LSTM 76.2 22.2 25.9 17
LSTM 87.2 63.8 53.0 −16
ResNet-50 94.0 10.3 9.0 −13
ResNext-50 98.9 83.6 74.4 −11

Grow-Shrink.

Migration.

6.2 Model exploration in a multi-job

Experiment A — number of configurations explored.

Experiment B — time to a qualified model.

Table 3: Time to find a qualified configuration (minutes)

Position 93th (25%) 187th (50%) 280th (75%) 365th (98%)
4 GPUs Baseline 691.5 1373.0 2067.2 2726.4
Gandiva 125.5 213.8 302.4 387.1
Speedup 5.51x 6.42x 6.84x 7.04x
16 GPUs Baseline 253.0 492.7 731.7 970.0
Gandiva 74.4 103.7 135.4 162.6
Speedup 3.40x 4.75x 5.40x 5.96x

Experiment C — sensitivity to target accuracy.

Table 4: Model searching in ResNet-like network (minutes)

Accuracy 70% 80% 90%
Baseline 134.1 2849.1 5296.7
Gandiva 134.1 543.1 935.4
Speedup 1.00x 5.25x 5.66x
Position 15th 58th 87th

6.3 Cluster experiments: time-slicing and packing

6.4 Cluster experiments: time-slicing and migration

Table 2: Neural models and the ratios in the trace

Ratio Neural model Type Dataset
10% InceptionV3 CV ImageNet
ResNet-50 CV ImageNet
Alexnet CV ImageNet
Vgg16 CV ImageNet
60% Bi-Att-Flow NLP SQuAD
LanguageModel NLP PTB
GNMT NLP WMT16
Transformer NLP WMT16
30% Wavenet Speech VCTK
DeepSpeech Speech CommonVoice

Table 5: Full trace experiment with fast-forwarding (100 GPUs: 50 P100, 50 P40)

Avg. JCT (mins) Makespan (mins)
Cap. Sche. 832 13371
Gandiva 656 11349
Improvement 26.8% 17.8%


8. Conclusion

"We present Gandiva, a cluster scheduling framework for deep learning, which provides a set of efficient, low-level system primitives such as time-slicing, migration, intra-job elasticity, and dynamic priority. Using these primitives, Gandiva can effectively support neural model exploration in a multi-job, finding accurate neural models up to an order of magnitude faster than using traditional schedulers in a realistic shared cluster environment. Gandiva provides an efficient implementation of the proposed mechanisms by exploiting the intra-job predictability of DLT: our system prototype demonstrates that job suspend/resume and migration can be achieved under a second, even for cross-server migration for popular deep learning toolkits such as Tensorflow and PyTorch. Combined with an introspective scheduling policy, Gandiva improves overall cluster utilization by 26%."


Consolidated Quantitative Record

Quantity Value
Cluster GPU utilization, Gandiva vs baseline (180 GPUs, stable regime 20-200 min) 62.8% vs 50.1% → 26% relative improvement
Time to 100 mini-batches (early feedback) 498 s (Gandiva) vs 2,203 s (baseline) → 77% reduction
Average JCT vs YARN capacity scheduler (100 GPUs) 656 vs 832 mins → 26.8% improvement
Makespan vs YARN capacity scheduler 11,349 vs 13,371 mins → 17.8% reduction
Hyper-parameter configurations explored ~10x baseline (4-GPU and 16-GPU)
Time-to-qualified-model speedup (Table 3) 5.51x-7.04x (4 GPUs), 3.40x-5.96x (16 GPUs)
ResNet-like AutoML speedup (Table 4) 1.00x @ 70%, 5.25x @ 80%, 5.66x @ 90%; qualified model reached 92.62% validation accuracy
Multi-job speedup in shared cluster 13.6x and 12.9x; baseline 1,215.74 and 1,110.62 mins; time-slicing alone gave 7x
GPU memory max/min ratio within a mini-batch 77x (23 GB / 0.3 GB, ResNet-50/ImageNet, batch 128); 3x for GNMT (0.4 GB model, batch 16)
Mini-batch duration, ResNet-50/ImageNet on 4x K80 ~1.5 s
Suspend-resume cost <100 ms (image classification) to 1 s (language translation); ≤2% overhead at 60 s slices; aggregate throughput impact <2%
GPU change on resume (cudaDeviceReset + CudaInit) 5-10 s, hidden in the background while suspended
Migration cost, checkpoint-aware path 1-2 s typical; ~3.5 s worst (DeepSpeech, 1405 MB); 98% of the 35 s 8-GPU overhead eliminated; 6 of 10 models migrate within 1 s
Migration cost, CRIU path 8-10 s single-GPU, higher for multi-GPU; checkpoints on the order of GBs
Migrations over the full trace run 470 times ≈ once every 20 minutes
Packing gain range (Table 1) +412% (VAE) to −16% (LSTM); high-utilization image jobs lose 11-13%
VGG16 worst-locality penalty (DiffSocket vs SamePCIeSw) 60% of best-locality throughput
Two co-located Language Model jobs 19% slowdown each
Inter-server NIC interference (40G IB) ResNet-50 −47%, InceptionV3 −30%, DeepSpeech −5%
Cloud GPU VM cost premium ~10x a regular VM
Production trace scale 9 days, 2,000 GPUs, 8,800+ jobs; CV 10% / NLP 60% / Speech 30%
Reported production average GPU utilization (prior study) ~52%
Time-slicing interval 60 s (all models ≤ 6 s per mini-batch)
Code added to TensorFlow 400+ lines Python/C++, plus 200+ lines for the per-server Migration Helper
De-fragmentation threshold 3 free GPUs out of 4
Fast-forwarding fidelity JCT and makespan differ <1% from a real 3-hour run
References in the paper 58

Evaluation Setup Summary

Component Value
Server CPU 12-core Intel Xeon E5-2690 @ 2.60 GHz
Server RAM 448 GB
Network Two 40 Gbps links, explicitly no RDMA; 40G InfiniBand for the §3 locality/interference characterization
OS Ubuntu 16.04
GPUs per server Four P100 or four P40 (one 8x P100 server for the migration breakdown)
Storage GlusterFS with two-way replication on server SSDs; Ramdisk + NFS for checkpoint transport
Intra-server topology classes SamePCIeSw, SameSocket, DiffSocket
Cluster sizes 180 GPUs / 45 servers (§6.3); 100 GPUs = 50 P100 + 50 P40 (§6.4); 16 P40 and 4 P40 (§6.2); 8 P100 (migration breakdown); 4 P100 (time-slicing, grow-shrink)
Frameworks PyTorch 0.3 (8 models), TensorFlow 1.4 (10 models) — 18 models total
Cluster management Docker containers on Kubernetes; Gandiva scheduler runs as a Kubernetes-managed container; CRIU for the generic migration path
Parallelism Data parallelism only, synchronous updates (asynchronous supported but not evaluated)
Batch sizes Defaults from each model's reference (ResNet-50/ImageNet example = 128; GNMT example = 16; typical range 16-256)
Datasets ImageNet, Cifar10, WMT'14 En-De, WMT16, SQuAD, PTB, VCTK, CommonVoice
Baselines Bin-packing scheduler without over-subscription (§6.3); Hadoop YARN capacity scheduler (§6.4); FIFO-queue AutoML baseline (§6.2)
MPS Deliberately disabled — significant overhead on P40/P100

Communication and Interconnect Discussion

The paper's treatment of communication is confined to locality and interference characterization; it does not analyze collective communication libraries.


Limitations and Future Work (as stated)