<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Heterogeneity-Aware Cluster Scheduling Policies for Deep Learning Workloads</title></titleStmt>
			<publicationStmt>
				<publisher></publisher>
				<date>2020 November</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10213410</idno>
					<idno type="doi"></idno>
					<title level='j'>OSDI 2020</title>
<idno>1942-1184</idno>
<biblScope unit="volume"></biblScope>
<biblScope unit="issue"></biblScope>					

					<author>Deepak Narayanan</author><author>Keshav Santhanam</author><author>Fiodar Kazhamiaka</author><author>Amar Phanishayee</author><author>Matei and Zaharia</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[Specialized accelerators such as GPUs, TPUs, FPGAs, and custom ASICs have been increasingly deployed to train deep learning models. These accelerators exhibit heterogeneous performance behavior across model architectures. Existing schedulers for clusters of accelerators, which are used to arbitrate these expensive training resources across many users, have shown how to optimize for various multi-job, multiuser objectives, like fairness and makespan. Unfortunately, existing schedulers largely do not consider performance heterogeneity. In this paper, we propose Gavel, a heterogeneity-aware scheduler that systematically generalizes a wide range of existing scheduling policies. Gavel expresses these policies as optimization problems and then systematically transforms these problems into heterogeneity-aware versions using an abstraction we call effective throughput. Gavel then uses a round-based scheduling mechanism to ensure jobs receive their ideal allocation given the target scheduling policy. Gavel’s heterogeneity-aware policies allow a heterogeneous cluster to sustain higher input load, and improve end objectives such as makespan and average job completion time by 1.4⇥ and 3.5⇥ compared to heterogeneity-agnostic policies.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">Introduction</head><p>As Moore's law comes to an end, specialized accelerators such as GPUs, TPUs, FPGAs, and other domain-specific architectures have emerged as an alternative to more generalpurpose CPUs. These accelerators have been deployed to great effect <ref type="bibr">[25,</ref><ref type="bibr">35]</ref> to train state-of-the-art deep neural network (DNN) models for many domains, including language, image and video <ref type="bibr">[14,</ref><ref type="bibr">30,</ref><ref type="bibr">31,</ref><ref type="bibr">51,</ref><ref type="bibr">55]</ref>.</p><p>Consequently, users today must choose from a wide variety of accelerators to train their DNN models. For example, public cloud users can rent several generations of NVIDIA GPUs and Google TPUs from cloud providers <ref type="bibr">[1]</ref><ref type="bibr">[2]</ref><ref type="bibr">[3]</ref>. Even organizations with private clusters have accumulated different accelerator types over time <ref type="bibr">[34]</ref>; anecdotally, our research group has NVIDIA Titan V, Titan X, and P100 GPUs in its private cluster. Resources in these multi-tenant settings are typically arbitrated by a scheduler. GPU cluster schedulers such as Themis <ref type="bibr">[40]</ref>, Tiresias <ref type="bibr">[28]</ref>, AlloX <ref type="bibr">[37]</ref>, and Gandiva <ref type="bibr">[58]</ref> thus need to decide how to allocate diverse resources to many users while implementing complex cluster-wide scheduling   policies, optimizing objectives such as fairness or makespan. Unfortunately, choosing the most effective accelerator types in this context is difficult for three reasons: Performance Heterogeneity. Commonly used models show heterogeneous performance behavior across accelerator types due to various architectural differences. For example, Figure <ref type="figure">1a</ref> shows that a ResNet-50 model sees a nearly 10&#8677; speedup from an NVIDIA V100 GPU compared to a K80 GPU, while an A3C Deep Reinforcement Learning model only sees a 2&#8677; speedup. However, as shown in Figure <ref type="figure">1b</ref>, the V100 is no longer the optimal choice for all models when we consider the number of samples trained per dollar -for many models, the older P100 GPU is competitive or cheaper on a per-dollar basis. Some scheduling policies can also benefit from splitting a job between multiple resource types: for example, minimizing a job's cost subject to a latency SLO (e.g., complete a job in 10 hours) might involve using a cheaper accelerator to begin training and then switching to a faster, more expensive device to meet the SLO. Thus, for even simple single-job settings, the choice of accelerator type is non-trivial and depends on both the job and the policy. This gets more complicated in multi-job settings as granting all jobs their preferred accelerator simultaneously might not be possible. Existing schedulers like Gandiva, Tiresias, and Themis do not consider this heterogeneous performance behavior.</p><p>Generality across Policies. Cluster operators might want to implement different scheduling policies based on their business goals, such as optimizing for time to complete a set of batch jobs (makespan), fairness for ad-hoc jobs, or more sophisticated hierarchical policies that divide resources among high-level entities (e.g., departments) using one policy, and then individual jobs within the entity using another <ref type="bibr">[34]</ref>. In data analytics clusters, many job schedulers have support for hierarchical allocation policies <ref type="bibr">[6,</ref><ref type="bibr">7,</ref><ref type="bibr">12,</ref><ref type="bibr">59]</ref> already. The two recently proposed GPU schedulers that do consider heterogeneous resources, AlloX <ref type="bibr">[37]</ref> and Gandiva fair <ref type="bibr">[18]</ref>, optimize for a single scheduling objective, and tightly couple their scheduling mechanism to that objective (e.g., max-min fairness). Thus, they cannot easily support the more sophisticated policies often used in practice.</p><p>Colocation and Placement Optimizations. To improve cluster utilization, existing GPU schedulers often deploy optimizations such as space sharing as in Gandiva <ref type="bibr">[58]</ref>, where multiple jobs can use the same accelerator concurrently, and placement sensitivity as in Themis and Tiresias <ref type="bibr">[28,</ref><ref type="bibr">40]</ref>, which involves the careful placement of tasks in a distributed job to ensure good scaling performance. The performance benefits of these optimizations should be considered explicitly while optimizing for global scheduling objectives, since these optimizations are more effective when deployed in a heterogeneity-aware way. We show that explicit modeling for space sharing can improve objectives by 2.2&#8677; compared to Gandiva's ad-hoc approach.</p><p>In this paper, we present Gavel, a new cluster scheduler designed for DNN training in both on-premise and cloud deployments, that effectively incorporates heterogeneity in both hardware accelerators and workloads to generalize a wide range of existing scheduling policies. For example, Gavel can provide heterogeneity-aware versions of fair sharing / least attained service <ref type="bibr">[28]</ref>, FIFO, minimum makespan, minimum cost subject to SLOs, finish-time fairness <ref type="bibr">[40]</ref>, shortest job first, and hierarchical policies <ref type="bibr">[12,</ref><ref type="bibr">59]</ref>.</p><p>Gavel's key observation is that many widely used scheduling policies, including hierarchical ones, can be expressed as optimization problems whose objective is a function of the jobs' achieved throughputs. For example, least attained service is equivalent to maximizing the minimum scaled throughput among the jobs, makespan is equivalent to minimizing the maximum duration (computed as the ratio of number of iterations to achieved throughput), and so on. Given the optimization problem for a scheduling policy, Gavel introduces a general way to transform the problem to make it heterogenity-, colocation-and placement-aware. In particular, Gavel changes the problem to search over a heterogeneous allocation for each job, the fraction of time spent in various resource configurations (e.g., 60% of time running alone on a V100 GPU and 40% of time space-sharing an A100 GPU with another job), and changes the throughput terms in the objective function to effective throughput, i.e. the average throughput of the job over the mix of resources in its allocation. Additional constraints need to be added to ensure that the returned allocation is valid. We show that Gavel's transformed optimization problems are efficient to execute even for clusters with hundreds of GPUs and jobs, and can support a wide range of policies. Many of these problems can be solved using a sequence of one or more linear programs.</p><p>Gavel's heterogeneity-aware allocations for each job need to be mapped to actual scheduling decisions (placement of jobs on specific resources in the cluster for a specified duration of time). To achieve this, Gavel uses a preemptive round-based scheduling mechanism to ensure that jobs receive resources in fractions similar to the computed target allocation. Gavel's scheduling mechanism needs to be able to schedule both distributed training jobs, which request multiple accelerators at once, as well as combinations of jobs running concurrently on a given accelerator due to space sharing.</p><p>Gavel makes these scheduling decisions transparently: it specifies an API between the scheduler and applications that allow jobs written in existing deep learning frameworks like PyTorch <ref type="bibr">[48]</ref> and TensorFlow <ref type="bibr">[13]</ref> to be moved between resources with minimal code changes, and uses a mechanism similar to Quasar <ref type="bibr">[21]</ref> to estimate performance measurements of colocated jobs, which are needed as inputs to Gavel's policies, when not available a priori.</p><p>By explicitly considering performance heterogeneity, Gavel improves various policy objectives (e.g., average job completion time or makespan): on a smaller physical cluster, it improves average JCT by 1.5&#8677;, and on a larger simulated cluster, it increases the maximum input load a cluster can support, while improving objectives such as average job completion time by 3.5&#8677;, makespan by 2.5&#8677;, and cost by 1.4&#8677;.</p><p>To summarize, our main contributions are:</p><p>&#8226; A systematic method to convert existing cluster scheduling policies into equivalent policies that consider heterogeneity and colocation; these equivalent optimization problems are practical for current DNN clusters.</p><p>&#8226; A round-based scheduling mechanism to ensure that the cluster realizes the allocations returned by these policies.</p><p>&#8226; Generalizations of many existing policies in our framework that improve corresponding objectives.</p><p>Gavel is open sourced at <ref type="url">https://github.com/ stanford-futuredata/gavel</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">Background</head><p>In this section, we provide a brief overview of DNN training ( &#167;2.1), and discuss performance optimizations used in existing schedulers that Gavel can help deploy more effectively ( &#167;2.2). Gavel's throughput estimator obtains performance measurements for each runnable job on each available accelerator type if necessary; its policy then computes an allocation that optimizes a user-specified objective such as fairness. Gavel's scheduling mechanism accepts this computed allocation as an input, and makes per-round placement decisions in proportions that faithfully mimic the computed allocation.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1">Deep Neural Network (DNN) Training</head><p>DNN training proceeds in iterations. In each iteration, the DNN processes a collection of inputs (called a minibatch) and subsequently updates the model parameters using gradients derived from the input minibatch. Each minibatch is typically of similar size, which means model training throughput using short profiling runs (order of minutes). Gavel leverages this fact in its throughput estimator. Jobs are typically fairly longrunning (on the order of hours to days), and can be distributed over many workers <ref type="bibr">[9,</ref><ref type="bibr">58]</ref>. Modern DNN schedulers leverage the fact that DNN training is iterative to suspend and resume training at iteration boundaries <ref type="bibr">[28,</ref><ref type="bibr">58]</ref>; this ensures that jobs can be time multiplexed over the existing physical resources. The latest model parameters need to be checkpointed to stable storage when a job is suspended to ensure training progress is not lost. In this work, we show how time sharing should be deployed to optimize various single-and multi-job objectives.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2">Performance Optimizations</head><p>Prior work has shown that GPUs can be severely underutilized in multi-tenant clusters <ref type="bibr">[34]</ref>; for example, average GPU utilization (measured as the percentage of GPU Streaming Multiprocessors active over time) was as low as 52% on a Microsoft cluster. Prior work has also shown the placement of tasks for a distributed training job can have significant impact on performance. Gavel can optionally deploy these optimizations systematically, as we show in &#167;3.1.</p><p>Space Sharing. Smaller models often do not leverage the full computational capacity of modern GPUs. In such cases, concurrently executing multiple models on the same GPU using NVIDIA's Multi Process Service (MPS) or CUDA streams can help improve utilization <ref type="bibr">[10,</ref><ref type="bibr">47]</ref>.</p><p>Placement Sensitivity. DNN models show heterogeneity in their distributed scaling behavior depending on the size of the tensors that need to be exchanged between workers during training: some models have compact weight representations and can scale well even when workers are not on the same server, while other models scale poorly when workers are spread over many servers. Existing schedulers like Tiresias use heuristics for placement sensitivity.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">System Overview</head><p>Given a collection of jobs, Gavel arbitrates cluster resources (in the form of accelerators of different types) among the resident jobs, while optimizing for the desired cluster objective. This is accomplished in a two-step process: first, a heterogeneity-aware policy computes the fraction of time different jobs (and combinations) should run on different accelerator types to optimize the desired objective. These policies require as input the performance behavior (in terms of throughputs) for each job on each accelerator type, which can either be provided by the user, or can be measured on the fly by Gavel's throughput estimator. Allocations are intended to be respected only between allocation recomputation events; for example, if job 1 is much longer than job 2, the allocation will be recomputed once job 2 completes. Gavel can recompute its policy either when a reset event occurs (job arrives or completes, worker in the cluster fails), or at periodic intervals of time. Given the policy's output allocation, Gavel's scheduling mechanism grants jobs time on the different resources, and moves jobs between workers as necessary to ensure that the true fraction of time each job spends on different resources closely resembles the optimal allocation returned by the policy. Gavel's workflow is shown in Figure <ref type="figure">2</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1">Heterogeneity-Aware Policies</head><p>Gavel expresses scheduling policies as optimization problems for various objectives of interest, such as fairness or makespan, and allocations as matrices that specify the fraction of wall-clock time a job should spend on each accelerator type between allocation recomputations. A matrix X can represent allocations on a single accelerator type (homogeneous setting), on multiple accelerator types (heterogeneous setting), as well as with other optimizations. Consider X example :   allocation is valid on a V100 GPU, and the remaining 40% of time on a P100 GPU. This is shown visually in Figure <ref type="figure">3</ref>.</p><p>Gavel finds an optimal value for the matrix X given a policy expressed as an optimization problem. To construct the optimization problem for a given policy, Gavel requires a throughput matrix T with each job's throughput (in training iterations per second) on different accelerators. T m j can be set to &#8226; if job m does not run on accelerator type j (for example, due to memory constraints).</p><p>Given T and X, we define the effective throughput of a model m as the time-weighted average throughput across accelerators and jobs. We denote this quantity throughput T (m, X) or simply throughput(m, X) (dropping the T ) for brevity. For allocations X without space sharing, throughput(m, X) = &#194; j2 accelerator types T m j &#8226; X m j Different cluster scheduling policies can be expressed as optimization problems for X while maximizing or minimizing an appropriate objective function. Constraints need to be specified to ensure that X is a valid allocation. A hypothetical policy that maximizes total effective throughput looks like, Maximize X &#194; m2jobs throughput(m, X) Subject to the following constraints:</p><p>These constraints ensure that each job-worker allocation is non-negative and between 0 and 1 (equation 1), that the total allocation for a job does not exceed 1 (equation 2), and that the allocation does not oversubscribe workers (equation 3).</p><p>Space Sharing. Gavel's allocation matrices can also incorporate space sharing (SS). While previous work has used greedy algorithms for space sharing, we found that different pairs of DNN applications in practice have vastly different performance when colocated together, based on the resources they consume (Figure <ref type="figure">4</ref>). When using space sharing, X needs to contain rows for each viable combination of jobs, and T needs to have throughputs of the job combinations, like: The SS-aware allocation X dictates the fraction of time that each job combination should spend on each accelerator type. We limit entries of T to combinations of at most 2 jobs; we found empirically that larger combinations rarely increase net throughput. Additionally, although the size of T grows quadratically with the number of jobs even with job combinations of size 2, we found that in practice we only need to consider combinations that actually perform well. We evaluate the scaling behavior of these SS-aware policies in &#167;7.4.</p><p>Objectives in terms of throughput(m, X) remain the same; however, throughput(m, X) now needs to be computed to include the throughputs of co-located jobs:</p><p>The constraints need to be slighly modified as well to ensure that X is a valid allocation in this new regime:</p><p>C m is the set of all job combinations that contain job m.</p><p>Placement Sensitivity. Similarly, Gavel's allocation matrices can also be extended to incorporate placement sensitivity. The observed throughput for distributed jobs depends on the location of tasks, as well as the model and accelerator type (slower workers are less likely to be communication-bound, Jobs placed on resources where they have high priority (marked in red)</p><p>Figure <ref type="figure">5</ref>: Priorities are used to move the received allocation towards the intended allocation (in this case, X example ). priorities n is computed as X/rounds_received n (element-wise division).</p><p>which means consolidation of tasks is less effective). We can make our policies placement-sensitive by considering the performance of distributed jobs in: 1) a consolidated setting, where as many accelerators are on the same server as possible (for example, 8 GPUs per server if using 8-GPU servers), and 2) an unconsolidated setting, where accelerators are on independent servers. These are extreme points in the placement space, and are upper and lower bounds on performance. We can model this in our policies by having two different worker types (consolidated and unconsolidated) with corresponding throughput values in T and allocation values in X.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2">Round-based Scheduling Mechanism</head><p>After computing the optimal allocation, Gavel's next step is to assign jobs (or job combinations, in the case of SS) to accelerator types while matching the optimal allocation as closely as possible. That is, to realize the allocation X example above, the scheduling mechanism needs to make sure that in the time period where jobs 0, 1, and 2 are the only three runnable jobs in the cluster, jobs should receive resources according to their computed optimal time fractions.</p><p>To do this, the scheduler computes a priority score for every job and accelerator type combination that is high when a job has received a smaller time fraction than the optimal allocation. Scheduling is performed in rounds; in each round, the scheduler runs jobs in decreasing priority order, while ensuring that a given job is not scheduled on multiple workers (or accelerators) in a given round. This is shown in Figure <ref type="figure">5</ref>. Priorities are updated as rounds complete. We have found empirically that round durations of around 6 minutes allow Gavel to effectively approximate the ideal allocation ( &#167;7.5).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.3">Throughput Estimator</head><p>To estimate the throughputs of concurrent jobs (e.g., in the case of space sharing), Gavel employs a throughput estimator, similar to those found in prior work such as Quasar <ref type="bibr">[21]</ref>. Gavel's throughput estimator maps a new job to a set of preprofiled reference jobs. The throughputs of the closest reference job can then be used as the initial performance estimate for the new job's combinations. For individual jobs, the throughput estimator is not needed, since throughputs can be estimated on the fly as jobs run on different resource types.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.4">Limitations and Non-Goals</head><p>While Gavel exposes a flexible API that supports a variety of policies and objectives, we do not propose new scheduling policies or performance optimizations in this work. Instead, Gavel's main goal is to determine how best to share resources amongst many different users and jobs in a heterogeneityaware way, while supporting many existing cluster-wide objectives. Gavel accomplishes these goals with a policy framework that easily allows policies to be made heterogeneity-, colocation-, and placement-aware ( &#167;4), a reusable scheduling mechanism ( &#167;5), and a narrow scheduler API that allows users to deploy their applications with minimal code changes ( &#167;6).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">Scheduling Policies</head><p>In this section, we show how various scheduling policies such as max-min fairness (Least Attained Service or LAS) and multi-level fairness can be expressed as optimization problems in terms of effective throughput. We describe some properties of the resulting heterogeneity-aware allocations at the end of this section.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.1">Max-Min Fairness as an Optimization Problem</head><p>The classical Least Attained Service (LAS) policy, used by Tiresias <ref type="bibr">[28]</ref>, implements max-min fairness across active users in the cluster, by round-robining resources across jobs according to the total number of accelerator hours consumed. This can be modified into a weighted max-min fairness policy with per-user weights w m . On a homogeneous cluster, if a job m with weight w m receives a fraction X m (which is a scalar since there is only one resource type), LAS can be expressed as the following optimization problem:</p><p>We need to add an additional constraint to ensure that the cluster is not overprovisioned (&#194; m X m &#63743; 1). However, this vanilla LAS policy is not fair in a heterogeneous setting; jobs might see unequal reductions in throughput due to variations in performance across accelerator types. For example, giving one job a K80 and another job a V100 would equalize their number of resources, but could result in very low performance for the job with the K80.</p><p>To compute a more fair allocation, we can compute maxmin fairness over the weighted normalized effective throughputs, as defined in &#167;3.1. Let X equal m be the allocation given to job m assuming it receives equal time share on each worker in the cluster. For example, if the cluster had 1 V100 and 1 K80,</p><p>scales the effective throughputs to make them comparable across jobs.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Makespan</head><p>Minimize time taken by batch of jobs. LAS <ref type="bibr">[28]</ref> Max-min fairness by total compute time.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>LAS w/ weights</head><p>Max-min fairness with weights. Finish Time Fairness <ref type="bibr">[40]</ref>  Minimize total cost subject to SLOs. Hierarchical <ref type="bibr">[59]</ref> Multi-level policy: FIFO, fairness, etc.</p><p>Table <ref type="table">1</ref>: Policies that can be expressed in Gavel.</p><p>As specified in &#167;3.1, additional constraints need to be specified to ensure that allocations are valid.</p><p>As an example, consider 3 jobs which benefit differently when moved from a K80 GPU to a V100 GPU: Solving the above optimization problem with w m = 1, and a cluster with 1 V100 and 1 K80 yields the following allocation:</p><p>0.0 job 0 0.45 0.09 job 1 0.09 0.91 job 2 Jobs receive about 10% higher throughput compared to an allocation where every user is given 1/n of the time on each accelerator (here, n = 3), also called an isolated allocation <ref type="bibr">[26]</ref>.</p><p>Fairness policy objective functions need to be modified to take into account muti-resource jobs with scale_factor m &gt; 1, since these multi-resource jobs occupy a larger share of the cluster per unit time. An easy way to do this is to multiply the max-min objectives from before by scale_factor m . Concretely, the LAS objective from before now becomes,</p><p>&#8226; scale_factor m</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.2">Other Policies as Optimization Problems</head><p>We can express many other common cluster scheduling policies, some proposed by recent papers, using throughput(m, X); we list these policies in Table <ref type="table">1</ref>. Most of these policies can be expressed using a single linear program, with a few exceptions: the cost policies are formulated as a linear-fractional program <ref type="bibr">[8]</ref>, which can be reduced to a sequence of linear programs. These optimization problems yield corresponding heterogeneity-aware allocations. The optimal allocation can be computed using off-the-shelf solvers.</p><p>Minimize Makespan. The makespan minimization policy tries to complete all active jobs as soon as possible. Gandiva uses a version of this policy to finish higher-level tasks such as hyperparameter tuning and AutoML, which involve training a large number of variants of a model. If num_steps m is the number of iterations remaining to train model m, then the makespan is the maximum of the durations of all active jobs, where the duration of job m is the ratio of the number of iterations to throughput(m, X) (expressed in iterations / second).</p><p>Overall, this can be framed as,</p><p>Minimize Finish-Time Fairness (Themis). Themis <ref type="bibr">[40]</ref> proposes a new metric called finish-time fairness (represented as r), which is the ratio of the time taken to finish a job using a given allocation and the time taken to finish the job using 1/n of the cluster (X isolated ), assuming n users using the cluster. This can be expressed in terms of throughput(m, X) as follows (num_steps m is the number of iterations remaining to train model m, t m is the time elapsed since the start of training for model m, and t isolated m is the hypothetical time elapsed since the start of training if model m had 1/n of the cluster to itself),</p><p>The final optimization problem is then,</p><p>FIFO. The First-In-First-Out (FIFO) policy schedules jobs in the order they arrive. In a heterogeneous regime, jobs should be placed on the fastest available accelerator type. Mathematically, we can write this as maximizing the throughput of job m relative to its throughput on the fastest type (throughput(m, X fastest )). Assuming that jobs are enumerated in order of their arrival time (m arrived before m + 1), a FIFO allocation can be computed with the following objective:</p><p>where M is the total number of jobs.</p><p>Shortest Job First. The Shortest Job First policy finds the allocation that minimizes the duration of the shortest job,</p><p>Minimizing Total Cost and Cost subject to SLOs. We can express policies for deployments that use elastic public cloud resources. Since cloud VMs are charged on a per-time basis, we can express policies that explicitly optimize for total cost, speed, or both. Consider a simple policy that maximizes total throughput,</p><p>The above policy can be extended to incorporate cost by optimizing the following cost-adjusted objective,</p><p>where cost j is the cost of accelerator type j. The numerator in the above objective is the time-averaged effective throughput, and the denominator is the time-averaged cost. When using space sharing, care must be taken to not double count the cost of instances running job combinations (all jobs in a job combination derive value in the form of some throughput). Jobs can have time SLOs as well, e.g., certain high-priority jobs might need to complete every 12 hours. We can add additional constraints: given SLO m for each model m (models without SLOs can have SLO m = &#8226;), throughput(m, X) num_steps m /SLO m</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.3">Hierarchical Scheduling Policies</head><p>Modern cluster schedulers do not only deploy "single-level" policies. Hierarchical policies are common <ref type="bibr">[6,</ref><ref type="bibr">12,</ref><ref type="bibr">59</ref>]: a large organization might share a single physical cluster among many sub-organizations (or entities) using a fairness policy. In turn, each entity can share resources among individual jobs according to a distinct per-entity policy, such as per-user fairness or FIFO. We give an example in Figure <ref type="figure">6</ref>, where a research and product team share the same physical cluster. The research team runs ad-hoc experiments that can be executed in FIFO order, but the product team needs to ensure that all its jobs receive a fair share of the cluster.</p><p>Gavel can currently support fairness in the upper levels and fairness or FIFO in the lower levels, which matches the hierarchical policies supported by the Hadoop scheduler <ref type="bibr">[6]</ref>. Determining how to extend this to other hierarchical policy sets (for example, with finish time fairness) is future work.</p><p>Gavel solves hierarchical objectives using a procedure called water filling <ref type="bibr">[15]</ref>, which is used in other max-min fairness problems such as link allocation in networks <ref type="bibr">[49]</ref>. At a high level, the water-filling algorithm increases the allocation given to all parties at an equal rate to respect max-min fairness, until a party saturates. The saturated party is then taken out, and the procedure repeated iteratively until all commodities are saturated. We adapt this procedure to our setting, solving a series of optimization problems iteratively: an LP that computes a fair allocation across entities while respecting each entity's internal policy, and an MILP that identifies bottlenecked jobs, i.e., jobs whose effective throughputs cannot be improved without lowering other jobs' effective throughput.</p><p>We assume that each entity s is associated with a weight w s ; the jobs belonging to this entity receive a total cluster share proportional to this weight. We denote w job m to be the weight of job m, set such that &#194; m2s w job m = w s . Jobs are assigned priorities in accordance to the relevant entity's policy; for example, a fairness policy within an entity would assign each job a weight proportional to its individual weight within the entity, while for FIFO, the first job in the queue would initially receive the entire weight of the entity.</p><p>In each iteration, we solve the following modified LP (assuming scale_factor m = 1 for all m for simplicity):</p><p>&#9670; t m is the normalized effective throughput of job m in the previous iteration (t m := 0 in the first iteration). The above objective can be appropriately modified for scale_factor m &gt; 1.</p><p>Bottlenecked jobs are given priority 0 and no longer considered in future iterations. Priorities are redistributed among non-bottlenecked jobs according to the entity's policy at the end of every iteration. For instance, in the example shown in Figure <ref type="figure">6</ref>, if job 4 is bottlenecked, then its weight is reassigned to job 5 in accordance to the FIFO policy, while if job 2 is bottlenecked, its weight is distributed equally between jobs 1 and 3 in accordance with the entity's fairness policy.</p><p>The LP then solves the max-min problem on the resources remaining while ensuring each job's throughput does not drop compared to the previous iteration's allocation X prev , expressed as throughput(m, X) throughput(m, X prev ) for all m. Iterations continue until all jobs are bottlenecked. To make this procedure more concrete, consider an example with 4 identical jobs: job 1 with a weight of 3.0, and jobs 2 to 4 with a weight of 1.0; and 4 identical GPUs. In the first iteration, job 1 is assigned resources such that its throughput is 1.0, and jobs 2, 3, and 4 are assigned resources such that their throughput is 0.33 to respect weights. Job 1 is a bottleneck; the throughput of the remaining jobs can still be increased. In the next iteration, jobs 2 to 4 are given full-GPU allocations.</p><p>The final allocation satisfies both inter-entity and intraentity policies. We note that the above water-filling procedure can also be used for single-level fairness policies such as the one described in &#167;4.1 to improve the throughput of nonbottelenecked jobs.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.4">Properties of Gavel's Policies</head><p>Existing scheduling schemes have been analyzed in terms of properties like sharing incentive, Pareto efficiency, and strategy proofness <ref type="bibr">[26]</ref>. We formalize Gavel's heterogeneityaware policies in the context of these properties as well.</p><p>Homogeneous Clusters. For homogeneous clusters, Gavel's heterogeneity-aware policies are equivalent to the baseline policies (throughput(m, X) = X m &#8226; T m ), since the heterogeneity-aware optimization problems reduce to the original optimization problems with one accelerator type.</p><p>Sharing Incentive. For heterogeneous clusters, the policy's objective metric (maximize least job share in LAS, completion time of first job in FIFO, or makespan) is at least as well off as it would be under a policy that na&#239;vely splits all resources equally among all runnable jobs. This is because the allocation corresponding to giving each user 1/n of each resource is a feasible solution to Gavel's optimization problem, so Gavel's solution will be at least as good. All Gavel policies have sharing incentive <ref type="bibr">[26]</ref>, which encourages users to use the shared cluster rather than a static private share.</p><p>Colocation. Solutions with colocation are always at least as good as without colocation.</p><p>Pareto Efficiency. Allocations of max-min fairness policies with water filling are Pareto efficient: that is, the allocation for a particular job cannot be increased without decreasing the allocation for another job.</p><p>Note that some of Gavel's policies may not satisfy other desirable properties. For example, Sun et al. <ref type="bibr">[53]</ref> showed that no fair-sharing policy can simultaneously satisfy Pareto efficiency, sharing incentive and strategy proofness in a setting with interchangeable resources. If users manipulate their throughputs, then they can possibly obtain larger shares of the cluster (e.g., jobs can be placed on a faster accelerator type) for certain objectives. Exploring how to make Gavel's policies strategy-proof is interesting future work.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">Scheduling Mechanism</head><p>Gavel's scheduling mechanism schedules training iterations of runnable jobs on the available workers (with possibly different accelerators), such that for each schedulable job (or combination), the fraction of wall-clock time it spends on each accelerator type is approximately equal to the computed optimal allocation X opt between allocation recomputation events. This is challenging for two main reasons: 1) Jobs can run on multiple accelerators. Moreover, since distributed training can be communication intensive <ref type="bibr">[19,</ref><ref type="bibr">46]</ref>, jobs should be placed on accelerators "close" to each other (for example, on accelerators on the same server, or on accelerators in servers in the same rack). 2) Combinations of up to two jobs can run on a set of accelerators in order to improve resource utilization (space sharing). Each distinct job can have &#63743; 1 job combination running in a given round to prevent work duplication.</p><p>Gavel makes its scheduling decisions in rounds. This is similar in spirit to Tiresias's <ref type="bibr">[28]</ref> priority discretization in some respects. However, Gavel's scheduling mechanism differs from Tiresias's in three ways:</p><p>&#8226; Gavel needs to schedule jobs on different accelerator types: it needs to decide which job should be active in any round and which accelerator type to use.</p><p>&#8226; Gavel needs to grant resources to jobs while respecting an arbitrary allocation returned by the policy.</p><p>&#8226; Gavel's round-based scheduler grants time to jobs while ensuring that multiple job combinations sharing a job do not run in the same round; Tiresias does not consider job combinations and does not need to deal with this.</p><p>Gavel's scheduler tries to place work on all available workers for a specific duration (this time period is configurable; we use 6 minutes in our experiments). We call the work handed to each worker in a given round a micro-task. Without rounds, jobs that request many accelerators can suffer from starvation. For example, consider a cluster with 8 total accelerators and 4 available. The scheduler can handle a 8-accelerator job waiting for resources in one of two ways: a) wait for 8 accelerators to become available; 4 accelerators will be unused until the full quota of 8 accelerators becomes available, b) keep the 8-accelerator job in the queue, and give 4 accelerators to another job that requests a fewer number of resources. However, this situation can repeat itself, leading to starvation <ref type="bibr">[59]</ref>. Scheduling is thus performed in rounds to limit resource under-utilization, simplify scheduling logic, and ensure that jobs with large scale factors do not experience prolonged starvation.</p><p>Since the number of active, schedulable jobs might far exceed the total number of workers, Gavel first determines the job combinations that should run in the upcoming round. To do this, Gavel maintains the time t m j spent by a job (or combination) m on accelerator type j, which is updated as jobs run on different accelerator types every round. Given t m j , Gavel's scheduler can then compute the fraction of total wall-clock time spent by each job (or combination) m on each accelerator type j as f m j = t m j /(&#194; m 0 t m 0 j ). The matrix of priorities is then just the element-wise division of X opt by f . Algorithm. In every round, we want to move f m j closer to X opt m j . This can be achieved by giving high-priority jobs time on accelerator type j.</p><p>This problem can be solved exactly if jobs only request single accelerators and if space sharing is not deployed by finding the num_workers j jobs with highest priority (for example, using a heap). However, jobs submitted to Gavel can be distributed, and space sharing can be used to improve resource utilization. Solving this problem exactly with these added requirements makes the problem similar to a multiplechoice knapsack problem <ref type="bibr">[52]</ref>, which is NP-hard. Algorithm 1 Algorithm for Gavel's scheduling mechanism for all j 0 that conflict (share a job k) with j do 10:</p><p>Remove j 0 from active _ combinations 11:</p><p>num _ workers _ rem. = j.scale _ factor</p><p>To overcome these challenges, we observe that it is acceptable to make greedy sub-optimal scheduling decisions occasionally in any given round, since we can recover from these sub-optimal decisions in subsequent rounds: our goal is to ensure that the average allocation each job receives over multiple rounds resemble the computed allocation (the allocations returned by policies are optimal, which follows from how policies in Gavel are expressed as optimization problems). We study the impact of this design choice in &#167;7.5. A job (combination) not run in a particular round will have increased priority in subsequent rounds until it receives accelerator time, while a job that runs in a particular round will have decreased priority. This ensures that jobs do not suffer from starvation if they have a non-zero optimal allocation.</p><p>Gavel uses a greedy algorithm to pick the highest-priority job combinations that fit in the provided resource budget. The algorithm maintains a set of eligible job combinations (eligible _ job _ combinations) that can be scheduled in the upcoming scheduling round. The scheduling mechanism then tries to add job combinations with highest priority into a job _ combinations _ to _ schedule set. Once a job combination is added to this set, all conflicting job combinations are removed from the set of eligible combinations to ensure that a given job is not run more than once in a given scheduling round. Job combinations that cannot fit in the current round due to space limitations (required number of accelerators unavailable) are also removed from the set of eligible combinations. This procedure is detailed in Algorithm 1. Gavel's scheduling mechanism is decoupled from its policies, ensuring that the same scheduling mechanism can be used for  many different policies. Figure <ref type="figure">7</ref> shows Gavel's scheduling mechanism in action.</p><p>Once Gavel has decided what jobs (and combinations) should run in a given round on different accelerator types, Gavel must decide how to place these jobs. Gavel's scheduler places jobs in decreasing order of the number of requested workers, and tries to give jobs accelerators on the same physical server to minimize fragmentation.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">Implementation</head><p>We implemented a prototype of Gavel in approximately 9000 lines of Python code, and implemented a simulator in about 500 LOC. We used cvxpy <ref type="bibr">[23]</ref> to implement Gavel's heterogeneity-aware policies, and gRPC <ref type="bibr">[4]</ref> to communicate control messages between the scheduler and workers.</p><p>Interface between Scheduler and Applications. Gavel currently supports user applications written in PyTorch <ref type="bibr">[48]</ref>; support for TensorFlow <ref type="bibr">[13]</ref> is left for future work. The scheduler and user applications then interact through a narrow API. Gavel ships with a Python library that users can import into their code. This library provides an implementation for a wrapper around existing framework-provided data iterators (GavelIterator). GavelIterator ensures that each task in a distributed job runs for the same number of iterations, and synchronizes the conclusion of rounds between the scheduler and workers. GavelIterator is instantiated with arguments train _ loader (base data loader), load _ checkpoint, save _ checkpoint, and a configuration object. load _ checkpoint is a pointer to a function that loads all necessary parameters and metadata from a checkpoint at the start of a round, and save _ checkpoint is a pointer to a function that creates a checkpoint at the end of a round; these need to call appropriate framework methods (&lt; 5 LOC).</p><p>GavelIterator contacts the scheduler near a round end to see if the same job will run in the next round on the same worker. We call this a lease renewal. If the lease is not renewed, the iterator calls save _ checkpoint at round end. The scheduler can then launch another job on the worker.</p><p>Throughput Estimation. Gavel uses a similar technique to Quasar <ref type="bibr">[21]</ref> to estimate colocated throughputs when using the optional space sharing optimization (if they are not available a priori), mixing profiling with matrix completion. Table <ref type="table">3</ref>: Comparison of end objective between physical experiment and simulation for two different traces. For the continuous trace, we measure the average JCT of 25 jobs in a steady-state cluster. For the static trace, we measure the total time needed to complete 100 jobs submitted at the start of the run. The heterogeneity-aware policies improve target objectives, and results on the physical cluster are in agreement with results on simulated cluster (&lt; 8%).  Matrix completion enables sparse low rank matrices to be reconstructed with low error <ref type="bibr">[17,</ref><ref type="bibr">43]</ref>. With matrix completion, Gavel is able to extrapolate measurements obtained through direct profiling on separate workers dedicated to profiling, and determine the job's most similar pre-profiled reference job. The throughput estimator can then use the reference job's throughput measurements as an initial throughput estimate. Gavel's throughput estimator is diagrammed in Figure <ref type="figure">8</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7">Evaluation</head><p>In this section, we seek to answer the following questions:</p><p>&#8226; Do Gavel's heterogeneity-aware policies improve objective metrics in a physical cluster ( &#167;7.2) and in simulations of larger clusters ( &#167;7.3)?</p><p>&#8226; How do Gavel's policies scale? ( &#167;7.4)  &#8226; How well does Gavel's scheduling mechanism realize Gavel's heterogeneity-aware allocations? ( &#167;7.5)</p><p>&#8226; Is Gavel able to accurately estimate the throughputs of co-located jobs when using space sharing? ( &#167;7.6)</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.1">Experiment Setup</head><p>We run experiments on both a physical and simulated cluster.</p><p>Clusters. We run physical cluster experiments on a cluster with 8 V100s, 16 P100s, and 24 K80s. Simulated cluster experiments are run on a cluster with 36 GPUs of each type.</p><p>Traces. We run physical and simulated experiments on two types of traces: one where all jobs are available at the start of the trace and jobs are not subsequently added ("static"), and another where jobs are continuously added to the cluster ("continuous"). For the continuous trace, job arrival times are generated according to a Poisson arrival process with an interarrival rate l. For the simulated experiments, we vary l to show the extra load each heterogeneity-aware policy is able to sustain in steady state. We run 3 seeds for every l, and show standard deviations. For the physical cluster experiments, we use a single l that keeps the cluster well-utilized in steady state. The online traces used in the simulated experiments have a variable number of jobs (at least 5000) and span 20-30 days. We measure the completion times of jobs with ID 4000 to 5000 to study steady state behavior (new jobs continue to be added until jobs of interest complete). Job types are uniformly sampled from the job table with 26 distinct job (or model) types, shown in Table <ref type="table">2</ref>. The online traces used in the physical experiments span a day and have 100 jobs.  The duration of each job on a V100 GPU is sampled from an exponential distribution: jobs have duration 10 x minutes, where x is drawn uniformly from [1.5, 3] with 80% probability, and from <ref type="bibr">[3,</ref><ref type="bibr">4]</ref> with 20% probability. Given the job's observed throughput on the V100 GPU, the number of training steps is then inferred by multiplying the throughput (in steps/sec) by the duration. This matches the process used by Gandiva <ref type="bibr">[58]</ref>. For the simulated experiments, we show results in two regimes: one where all jobs use a single worker ("continuous-single"), and another where 70% of jobs request a single worker, another 25% request between 2 and 4 workers, and the remaining 5% request 8 workers, as observed in published traces from Microsoft [9] ("continuous-multiple").</p><p>Metrics. For fairness and FIFO policies, our target metric is average job completion time of steady-state jobs, which is the same metric used by related work <ref type="bibr">[28,</ref><ref type="bibr">41]</ref>. We also show finish time fairness (FTF) for policies that explicitly optimize for FTF. For makespan policies, our target metric is the time needed to complete a job batch. For cost-related policies, the metric is cost (in dollars), and the percentage of jobs that violate time SLOs.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.2">End-to-End Results on Physical Cluster</head><p>For our physical cluster experiments, we run a heterogeneityaware and a heterogeneity-agnostic fairness policy on a continuous trace, and a heterogeneity-aware makespan policy against a baseline that uses Gandiva's ad-hoc space sharing on a static trace. Results are shown in Table <ref type="table">3</ref>. Gavel's heterogeneity-aware policies improved average job completion time by 1.5&#8677; and makespan by 1.2&#8677;. For the makespan objective, we do not run Gavel with space sharing; in theory, space sharing would additionally reduce makespan.</p><p>We also compare the real performance to simulations and observe that for both policies, the difference between metrics in simulation and on the physical cluster is small (&lt; 8%), indicating that our simulator has high fidelity.</p><p>Table <ref type="table">4</ref> shows the overhead of using Gavel's preemptive scheduler with a round duration of 6 minutes, with and without lease renewals. Allocations and worker assignments can be computed asynchronously. The only synchronous overhead is the loading and saving of checkpoints, which is dependent on the size of the model. Lease renewals decrease this overhead by allowing jobs to run on the same worker for extra rounds. The overhead of preemption, even without lease renewals and with a short round duration, is low (&lt; 3%).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.3">End-to-End Results in Simulation</head><p>We use a larger simulated cluster to evaluate the efficacy of Gavel's heterogeneity-aware policies across a range of objectives, and compare with heterogeneity-agnostic versions from previous work using a round duration of 6 minutes. As appropriate, we compare to other baselines like AlloX. Magnitudes of speedups are higher for these experiments compared to the physical cluster experiments since the simulated traces show job behavior over weeks, while the physical cluster traces are only a day long; consequently, queue buildups are less extreme for the traces used in the physical cluster experiments.</p><p>Least Attained Service (LAS). Figures 9 and 10 compare the vanilla LAS policy with its heterogeneity-aware variants. We compare with two other baselines: a modified LAS policy that uses Gandiva's ad-hoc space sharing, and an AlloX policy that explicitly optimizes average job completion time (but only for single-worker jobs). We make three observations. First, the heterogeneity-aware policies support higher load on the same cluster, reduce average JCT by 3.5&#8677; for the continuous-single trace, and by 2.2&#8677; for the continuousmultiple trace (graph can be read by comparing average JCT value for a given input job rate or x-intercept) at high load (5.6 jobs/hr for continuous-single, 2.6 jobs/hr for continuousmultiple). Second, the heterogeneity-aware LAS policy supports higher load than AlloX, since AlloX can give short jobs preferential treatment in the interest of optimizing average JCT, leading to long jobs experiencing starvation (long tail in JCT CDF). At moderate load, AlloX represents a best-case scenario since it explicitly optimizes for average JCT on a heterogeneous cluster. Gavel is able to essentially match this best case scenario, while also supporting other objectives. Third, Gandiva-style packing, which randomly explores job combinations until a combination that improves performance is found, is ineffective compared to Gavel's principled packing (2.2&#8677; better average JCT for both traces at high load).</p><p>Finish Time Fairness (FTF). We compare the heterogeneity-aware version of Finish Time Fairness  (FTF) to its heterogeneity-agnostic counterpart in Figure <ref type="figure">11</ref>. The heterogeneity-aware policy reduces average JCTs by 3&#8677; and improves average FTF by 2.8&#8677;. FTF is the ratio of the time taken to finish a job using a given allocation and the time taken to finish the job using 1/n of the cluster (X isolated ), assuming n users use the cluster. Lower FTF means jobs take less time with the provided allocation compared to X isolated .</p><p>Makespan. Gavel's heterogeneity-aware makespan policy reduces makespan by 2.5&#8677; compared to a FIFO baseline, and by 1.4&#8677; compared to a baseline that uses Gandiva's ad-hoc space sharing. Makespan is reduced by a further 8% when the number of jobs in the trace is high when using space sharing.</p><p>FIFO. The heterogeneity-aware versions of FIFO allow the cluster to support average input job rate. At high load, the heterogeneity-aware version without space sharing reduces average JCT by 2.7&#8677;, and the heterogeneity-aware version with space sharing reduces average JCT by 3.8&#8677; at high load. Space sharing is less effective for distributed jobs: it reduces average JCT by 1.1&#8677; with distributed jobs, compared to 1.4&#8677; for the continuous-single trace.</p><p>LAS with priorities. We also run an experiment with the LAS policies where 20% of jobs have higher priority. At high load, Gavel reduces the average JCT of high-priority jobs by 1.5&#8677; and the average JCT of low-priority jobs by 2.7&#8677;.</p><p>Cost. We simulate each of the cost policies on a 500-job workload comprised of ResNet-50 and A3C jobs. As we observe in Figure <ref type="figure">1b</ref>, the ResNet-50 job has the best costnormalized throughput on the V100 while the A3C job has Figure <ref type="figure">12</ref>: Behavior of a multi-level fairness policy with time as jobs are added to a small cluster with 3 V100 GPUs, 3 P100 GPUs, and 3 K80 GPUs. Each line represents a separate job, and jobs are added every 4 timesteps. The first 6 jobs belong to entity 0 (weight of entity, w 0 = 1), the next 6 jobs belong to entity 1 (w 1 = 2), and the last 6 jobs belong to entity 2 (w 2 = 3). the best cost-normalized throughput on the K80. Each job's duration is chosen from {0.5, 1, 2, 4, 8} days, and each job's SLO is chosen from {1.2&#8677;, 2&#8677;, 10&#8677;} its duration.</p><p>The policy that minimizes cost reduces the total cost compared to the policy that maximizes throughput by a factor of roughly 1.4&#8677;. However, approximately 35% of jobs violate their SLO as this policy prioritizes cheaper but slower GPUs; in particular, the A3C jobs are scheduled on K80 GPUs which results in violations for tight SLOs. In comparison, the policy that includes SLOs as well eliminates all violations for a small increase in cost (a cost reduction of 1.2&#8677; compared to the baseline policy), by ensuring that A3C jobs with tight SLOs are run on instances with V100 GPUs.</p><p>Multi-level Hierarchical Policies. Figure <ref type="figure">12</ref> shows the behavior of a multi-level fairness policy as new jobs belonging to multiple entities are added to a heterogeneous cluster with equal numbers of K80, P100, and V100 GPUs. Resources are granted to jobs in a way that respects both the higher-level and lower-level policies: in Figure <ref type="figure">12a</ref>, fairness is enforced both within and across entities (as can be seen by the widths of the colored bands, which represents cross-entity fairness, and the widths of bands within a color, which represents fairness across jobs within an entity), and allocations are adjusted as new jobs come in. Figure <ref type="figure">13</ref> shows results with a fair-ness+FIFO policy; later jobs in each entity 0 do not receive any GPU time to respect the per-entity FIFO policy.</p><p>The multi-level fairness policy can also be implemented in a heterogeneity-agnostic manner by statically partitioning Figure <ref type="figure">13</ref>: Behavior of a hierarchical policy (weighted fairness as top-level policy, FIFO as bottom-level policy) with time as jobs are added to a small cluster with 3 V100 GPUs, 3 P100 GPUs, and 3 K80 GPUs. Each line represents a separate job, and jobs are added every 4 timesteps. The first 6 jobs belong to entity 0 (weight of entity, w 0 = 1), the next 6 jobs belong to entity 1 (w 1 = 2), and the last 6 jobs belong to entity 2 (w 2 = 3).</p><p>(a) LAS.</p><p>(b) Hierarchical.</p><p>Figure <ref type="figure">14</ref>: Scaling of LAS and hierarchical policies with the number of active jobs on a heterogeneous cluster with an equal number of V100, P100, and K80 GPUs. The size of the cluster is increased as the number of active jobs is increased.</p><p>resources across users while respecting per-entity and peruser weights. While this results in a fair allocation as well, we observe that total effective throughput is about 17% lower compared to the heterogeneity-aware policy (Figure <ref type="figure">12b</ref>).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.4">Scalability of Heterogeneity-Aware Policies</head><p>Figure <ref type="figure">14</ref> shows the scaling behavior of the heterogeneityaware LAS and multi-level fairness policies with and without space sharing. We observe that even with 2048 active jobs, the hierarchical policy without space sharing can be run in &lt; 10 minutes. With space sharing, the policy can be run with 512 jobs in &lt; 10 minutes. The single-level LAS policy is much cheaper to compute in comparison. We note that allocations do not need to be recomputed every scheduling round -however, the longer the policy takes to run, the longer it takes for the new allocation to be acted upon (jobs can still be given heterogeneity-agnostic allocations in the interim, and consequently time on resources). We believe latencies of &lt; 30 minutes for large clusters are still preferable to nonpreemptive schedulers where jobs experience large queuing delays, or preemptive schedulers with heterogeneity-agnostic policies which lead to worse objective values, as shown above.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.5">Efficacy of Scheduling Mechanism</head><p>Figure <ref type="figure">15a</ref> shows the effect of the round length on average JCT for the heterogeneity-aware LAS policy with a single-   GPU trace. We observed similar behavior on traces with multi-GPU jobs, as well as other policies. A smaller round length gives Gavel's scheduling mechanism more rounds to course correct, allowing the true allocation and computed optimal allocation to more closely match. We found that the time needed to load and save checkpoints for our target models is &lt; 5 seconds, which means that a round length of 6 minutes gives a good tradeoff between fidelity with the optimal allocation and preemption overhead (preemption overhead with 6-minute rounds shown in Table <ref type="table">4</ref>). We compare this to an ideal baseline that allocates resources to jobs exactly according to their computed allocation. As shown in Figure <ref type="figure">15b</ref>, Gavel's scheduling mechanism with a round duration of 6 minutes behaves almost identically to this ideal baseline with a single-GPU trace (behavior with a multi-GPU trace is similar). We note that the ideal baseline is impractical to use in practice, since jobs with different scale factors can complete at different times (leading to starvation), and preemptions can be often since allocations for some (job, accelerator type) pairs are small, leading to high overhead.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.6">Impact of Throughput Estimation</head><p>Figure <ref type="figure">16</ref> shows the effect of Gavel's throughput estimator on average JCT when using the space sharing-aware LAS policy compared to the LAS policy without space sharing, and the LAS policy with space sharing and oracle throughputs. The throughput estimator is able to determine missing throughputs in an online fashion accurately enough to observe a very small decrease in average JCT at high load (orange and blue lines).</p><p>In this section, we compare Gavel to related work.</p><p>Existing DNN Training Schedulers. Several recent papers have proposed schedulers targeting DNN training workloads.</p><p>Gandiva <ref type="bibr">[58]</ref> uses time and space sharing to reduce queuing delay and improve resource utilization, but does not specify an explicit scheduling policy and does not support configurable objectives. It uses a profiling-based methodology to determine whether to co-locate jobs on an accelerator. However, it does not incorporate model performance data (isolated or co-located performance) explicitly into its scheduling policy, resorting to random exploration of job combinations until a combination that improves performance is found.</p><p>Tiresias <ref type="bibr">[28]</ref> and Themis <ref type="bibr">[40]</ref> use different objectives to achieve multi-job fairness. However, both do not incorporate jobs' affinities for different accelerator types in their scheduling objectives, and have scheduling mechanisms strongly coupled with the target policy, making it hard to support other more sophisticated policies like multi-level fairness.</p><p>AlloX <ref type="bibr">[37]</ref> and Gandiva fair <ref type="bibr">[18]</ref> are recent DNN schedulers that do consider worker and model heterogeneity. However, both only work for single policies (average job completion time for AlloX, max-min fairness for Gandiva fair ). Moreover, Gandiva fair uses a second-price auction mechanism to improve the performance of a heterogeneity-agnostic max-min fairness scheme, but does not provide guarantees as to the optimality of the final allocation. On the other hand, Gavel formalizes each policy as an optimization problem, and can provide a guarantee that the returned solution is "optimal" according to the provided objective. Gavel is also able to support more sophisticated policies such as multi-level fairness.</p><p>Traditional Cluster Schedulers. Traditional schedulers such as Mesos <ref type="bibr">[32]</ref>, Borg <ref type="bibr">[57]</ref>, TetriSched <ref type="bibr">[54]</ref>, and YARN <ref type="bibr">[56]</ref> support workloads with fixed heterogeneous resource requests, but do not reason about the diverse performance characteristics of jobs across accelerators. Mesos and YARN do not reason about interchangeable resource types that can run the same computation: for example, Mesos's DRF multi-resource sharing policy <ref type="bibr">[26]</ref> decides how to give jobs allocations of distinct resource types, such as RAM and CPUs, but assumes that each job has declared which resources it needs to use and in what ratio (unlike our case, where we consider heterogeneity over accelerators themselves).</p><p>The multi-interchangeable resource allocation (MIRA) problem <ref type="bibr">[53]</ref> also introduces the notion of effective throughput similar to Gavel, but does not demonstrate how this can be used to specify policies as optimization problems, does not consider performance optimizations like space sharing and placement sensitivity, and does not discuss how computed allocations can be realized on physical resources.</p><p>Omega <ref type="bibr">[50]</ref>, Apollo <ref type="bibr">[16]</ref>, and Hydra <ref type="bibr">[20]</ref> are schedulers that take into account the fact that the target workload shows heterogeneity in the number and duration of constituent tasks. However, tasks largely take the same time on different CPUs, and heterogeneity in memory capacities only impacts the number and size of tasks that can be placed on a server. In our work, the compute devices themselves are interchangeable with sometimes large performance differences, and policies decide the time fractions of resources each job should receive while optimizing for various end objectives. Dynamic Performance Estimation. As detailed in &#167;6, Gavel uses the approach proposed by Quasar <ref type="bibr">[21]</ref> to estimate co-located job performance online. In particular, Gavel uses a mix of profiling and matrix completion to compute a "fingerprint" against a set of reference models profiled offline. In this work, we show that the techniques used by Quasar can be successfully applied to this new setting.</p><p>Applicability to Other Settings. Even though we focused this paper on allocating heterogeneous resources for DNN training workloads, we believe that Gavel can be used for non-DNN workloads as well. Other workloads that are amenable to GPU execution, such as simulations, can be considered, even though performance estimates for these applications will be needed. We also believe the main technical insight presented in this paper -formulating diverse scheduling policies as optimization problems -is broadly applicable, and can be used to more easily deploy policies on homogeneous deep learning clusters, and on CPU clusters as well.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="9">Conclusion</head><p>In this paper, we proposed Gavel, a heterogeneity-aware cluster scheduler that is able to optimize for many high-level metrics like fairness, makespan, and cost. Gavel demonstrates how existing policies can be expressed as optimization problems, and extends these policies to be heterogeneity-aware. Gavel then uses a decoupled round-based scheduling mechanism to ensure that the computed optimal allocation is realized. Gavel's heterogeneity-aware policies improve end objectives both on a physical and simulated cluster. It can support a higher average input job rate, while improving objectives such as average job completion time by 3.5&#8677;, makespan by 2.5&#8677;, and cost by 1.4&#8677;.</p></div></body>
		</text>
</TEI>
