<?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'>KACE: Kernel-Aware Colocation for Efficient GPU Spatial Sharing</title></titleStmt>
			<publicationStmt>
				<publisher>ACM</publisher>
				<date>11/20/2024</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10559302</idno>
					<idno type="doi">10.1145/3698038.3698555</idno>
					
					<author>Bing-Shiun Han</author><author>Tathagata Paul</author><author>Zhenhua Liu</author><author>Anshul Gandhi</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[GPU spatial sharing among jobs is an eective approach to increase resource utilization and reduce the monetary and environmental costs of running deep learning workloads. While hardware support for GPU spatial sharing already exists, accurately predicting GPU interference between colocated workloads remains a concern. This makes it challenging to improve GPU utilization by sharing the GPU between workloads without severely impacting their performance. Existing approaches to identify and mitigate GPU interference often require extensive proling and/or hardware modications, making them dicult to deploy in practice.This paper presents KACE, a lightweight, prediction-based approach to eectively colocate workloads on a given GPU. KACE adequately predicts colocation interference via exclusive kernel metrics using limited training data and minimal training time, eliminating the need for extensive online proling of each new workload colocation. Experimental results using various training and inference workloads show that KACE outperforms existing rule-based and prediction-based policies by 16% and 11%, on average, respectively, and is within 10% of the performance achieved by an oine-optimal oracle policy.
CCS Concepts• Computer systems organization ! Cloud computing.]]></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>Applications of Deep Learning (DL) models, such as image processing and speech recognition, have exponentially grown in recent years <ref type="bibr">[19]</ref>, resulting in useful services and products <ref type="bibr">[12,</ref><ref type="bibr">28]</ref>. Despite the many benets of DL models <ref type="bibr">[38]</ref>, their heavy computational requirements have resulted in a signicant demand for expensive and powerhungry GPUs <ref type="bibr">[11]</ref>. This immense GPU demand underscores the need to fully utilize available GPUs to amortize costs.</p><p>DL models and workloads vary signicantly in their resource usage proles. Some DL workloads, such as BERTbased training <ref type="bibr">[8]</ref>, have high GPU compute requirements but a small GPU memory footprint. Others, such as Whisperbased inference <ref type="bibr">[30]</ref>, have a larger GPU memory footprint, but a moderate GPU compute requirement. Further, training and inference workloads have distinct resource needs, complicated by dierent model architectures. Even dierent batch sizes of a given model can result in signicantly dierent resource requirements; for example, in our experiments, a Whisper-based inference workload with batch size of 16 had a 33% higher GPU compute utilization compared to the same workload with a batch size of 2. Consequently, a DL workload may not fully utilize the xed resources on a given GPU model, resulting in underutilization of expensive GPUs.</p><p>While the variability in GPU resource requirements of DL workloads creates an underutilization problem, it also lends itself to a possible solution-spatially sharing GPU resources among diverse DL workloads to increase GPU utilization. Hardware support already exists for GPU spatial sharing (see Section 2). Nonetheless, there are several challenges that make it dicult to spatially share the GPU between DL workloads: &#8226; Performance interference. Sharing a GPU between just two DL workloads can result in unpredictable performance degradation for one or both colocated workloads <ref type="bibr">[18,</ref><ref type="bibr">35]</ref>.</p><p>For example, when we colocated a BERT <ref type="bibr">[8]</ref> training workload with an ALBERT <ref type="bibr">[17]</ref> training workload, they experienced a throughput drop, relative to an exclusive run, of 40% and 37%, respectively. When the same BERT workload was colocated with a ViT <ref type="bibr">[10]</ref> inference workload, the corresponding throughput drops were 19% and 3%, respectively. The much lower drop in throughput in the latter case was because the colocated Vit workload was an inference workload, and so did not require high GPU compute resources (e.g., for backpropagation). While the colocated ALBERT workload in the former case has much fewer parameters, and thus a lower memory requirement, it is a Transformer-based model, requiring signicant GPU compute resources for training. &#8226; Colocation candidates. For a target DL workload that is to be executed on a GPU, there could be several candidate DL workloads for colocation (e.g., those in the ready queue of a GPU cluster service <ref type="bibr">[41]</ref>). While coarse-grained resource usage patterns of individual colocation candidates can be readily obtained using an exclusive run, this information may not be enough to accurately predict the performance degradation under colocation. &#8226; Proling overhead. A natural approach to determine which workloads to colocate is to predict their performance under colocation. Machine Learning (ML) techniques are a promising solution for such predictions. However, ML techniques typically require a large training set to make accurate predictions. For the workload colocation problem, generating multiple training samples by repeatedly running colocated workloads will require signicant time and eort. Further, the time required to train complex ML models can also impose signicant overheads. In light of the above challenges, we pose our problem statement as follows: "Given a DL workload that is to be executed, how to choose a colocated DL workload to improve GPU utilization while minimizing the performance degradation of the colocated workloads?"</p><p>There has been some recent work on predicting colocated performance under GPU spatial sharing (see Section 6). However, such works typically focus on DL training jobs with checkpointing to save states <ref type="bibr">[21,</ref><ref type="bibr">39]</ref>, and are thus not applicable to inference workloads, which are latency sensitive, or training workloads that may have performance constraints. Further, the proling overhead can be high when predicting colocated performance. For example, multiple colocations have to be proled online (at runtime) for each target workload to be executed <ref type="bibr">[18]</ref>. There are also approaches that only rely on oine proling, but require changes to the GPU driver or scheduler for support <ref type="bibr">[35]</ref>. We thus notice a gap in literature on solutions that achieve ecient GPU spatial sharing without hardware/rmware changes and without signicant proling overhead.</p><p>In this work, we present KACE, a lightweight, applicationlevel solution that leverages oine proling to predict colocation performance under spatial sharing. KACE leverages these predictions at runtime to determine the best candidate workload to colocate with a given target workload. While KACE can generally be applied to any GPU workload, we focus on DL workloads in this work. Unlike recent works that only focus on long-running training jobs (where the proling overhead is not important) <ref type="bibr">[43]</ref>, KACE applies to both inference and training workloads.</p><p>Using the right features, we nd that a small training set (&#8672;20% of the entire dataset) and a simple linear regression model, with trivial training time, provide adequate prediction accuracy for KACE to eectively colocate potentially unseen workloads at runtime. KACE eliminates the need for extensive online proling, as done in recent works <ref type="bibr">[18]</ref>, and instead relies on one-time, oine runs of individual workloads to extract meaningful metrics. We nd that GPU kernel metrics provide valuable information for colocation, enabling KACE to outperform system-metric-based approaches.</p><p>We implement KACE in Python and evaluate its performance by comparing it with various baselines using 7 diverse DL workloads with dierent batch sizes. Our experimental results, using PyTorch for DL runs on an NVIDIA V100 GPU with MPS support, show that KACE achieves over 90% of the colocated performance that an oine-optimal oracle policy achieves using only &#8672;20% training data. Compared to recent approaches, KACE provides 11% higher performance, on average, and as high as 88% for certain workloads. Compared to rule-based approaches, KACE provides 14% higher performance, on average, and as high as 52% for certain workloads. Even in the case of unseen workloads that have not been encountered in training, KACE continues to outperform other approaches, achieving 11%-16% higher performance. The code for KACE is publicly available to promote further research and facilitate reproducibility <ref type="bibr">[1]</ref>.</p><p>2 Background on GPU Sharing Mechanisms GPU time-sharing is a resource management strategy where multiple jobs share a GPU over time (in distinct time slots), involving context switching between jobs. Various scheduling strategies, such as round-robin <ref type="bibr">[24]</ref>, can be employed to schedule jobs over time. However, minimizing the context switch overhead between jobs continues to be a practical challenge (see Section 6). Further, not all DL jobs can fully utilize the GPU resources <ref type="bibr">[44]</ref>, suggesting the need for GPU spatial sharing for improved GPU utilization.</p><p>GPU spatial sharing allows multiple jobs to execute concurrently on a GPU by partitioning GPU resources via various supported hardware and software mechanisms.</p><p>NVIDIA Multi-Instance GPU (MIG) partitions the GPU into independent resource instances of various sizes. MIG ensures isolation of compute and memory resources but cannot dynamically adjust instance sizes on the y; reconguring a MIG instance and checkpoint-restarting a DL job could take minutes <ref type="bibr">[18]</ref>. Further, the xed resource sizes of MIG instances may lead to GPU underutilization due to a lack of exibility. For example, the A100 GPU with 40GB GPU memory only supports MIG instances with memory sizes of 5GB, 10GB, 20GB, or 40GB <ref type="bibr">[26]</ref>. Also, by design, MIG ensures isolation between instances, preventing the exploitation of unused GPU resources across instances. Finally, MIG is typically available only on a handful of high-end data center GPUs <ref type="bibr">[26]</ref>.</p><p>NVIDIA Multi-Process Service (MPS) eliminates context switches by merging colocated CUDA contexts. Specically, MPS allocates one copy of GPU storage and schedules resources for all CUDA processes, instead of holding the context separately <ref type="bibr">[6]</ref>. It also allows each process to exclusively occupy Streaming Multiprocessors (SM) via the CUDA_MPS_ACTIVE_THREAD_PERCENTAGE variable. Due to its exibility, MPS has been shown to outperform MIG <ref type="bibr">[32]</ref>. Further, MPS is more readily available on several GPU models than MIG. We use MPS in this work for GPU spatial sharing. Note that the underutilization due to xed-size MIG instances can be addressed by employing MPS to run multiple DL workloads within a MIG instance; in fact, MPS is supported on top of MIG <ref type="bibr">[26]</ref>. As such, our solution for MPS in this work can aid MIG deployments as well.</p><p>AMD compute-unit masking in AMD GPUs allows users to specify a set of compute units on which kernels should execute <ref type="bibr">[29]</ref>. This mechanism appears similar to MPS, as both enable concurrent kernel execution with memory interference. Consequently, our MPS-based solution could be applicable to AMD GPUs equipped with compute-unit masking.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">KACE System Design and Implementation</head><p>This section describes the system design of KACE. The key components of KACE are: (1) Workload proler, (2) Model trainer, and (3) Colocation predictor; these are depicted in Figure <ref type="figure">1</ref> along with the interactions between components.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1">Workload proler (oline component)</head><p>The proler collects GPU metrics for individual workloads oine. These metrics are collected one-time only.</p><p>A common approach to evaluate GPU performance is to gather overall system metrics, such as compute and memory utilization, using, for example, nvidia_smi <ref type="bibr">[25]</ref>. However, we note that the compute and memory utilization metrics only indicate whether the GPU is busy, rather than providing</p><p>7/15/24, 4:35 PM KACE_sysdesign_v2 Page 1 of 1 <ref type="url">https://app.diagrams.net/?src=about</ref> Trainer profiler Feature set totalthread sm,mem SM_busy MEM_busy MEMCAP SM_xput MEM_xput DRAM_xput threads regs sharemem workload_xput Train Offline Training Train set Online Prediction Split train set Profile Workloads Predictor Deploy model Target workload GPU Workload Profiler Profile once Profiled features Profiled features Feature set Predict Execute ( , , 0.8) ( , , 0.5) ( , , 0.3) (Target, Candidate, Xput sum) Output Candidate workloads Feature generator actual utilization of processing units (Floating Point Process Units, Tensor cores, etc.) <ref type="bibr">[43]</ref>. Thus, these metrics only provide coarse-grained estimates of performance.</p><p>Kernel metrics provide detailed insights into individual kernels, including metrics such as Stream Multiprocessor (SM) throughput and achieved occupancy. These metrics oer precise performance data at the kernel level, unlike nvidia_smi metrics which provide broader system-level information. For example, SM throughput measures the maximum throughput across 22 processing pipelines, considering operations in FP64, ALU, and FMA <ref type="bibr">[27]</ref>.</p><p>Despite the crucial information (actual resource utilization) that kernel metrics provide for interference prediction, proling kernel metrics can take substantial time <ref type="bibr">[35]</ref>. However, the proling in KACE is done oine, and is thus not on the critical path when selecting the colocation candidate at runtime (see Section 3.3). We thus leverage both system and kernel metrics for KACE. We also include individual workload throughput (obtained via an exclusive run without colocation) as a metric as it is a strong performance indicator and can be collected with system metrics without additional proling. The selected metrics we employ in KACE are: SM busy rate, memory busy rate, memory capacity, compute (SM) throughput, memory throughput, DRAM throughput, number of threads, number of registers, static shared memory, and throughput of single workload without colocation (shown, abbreviated, in Figure <ref type="figure">1</ref>).</p><p>To collect metrics, we perform two oine prole runs for each workload (to prevent kernel proling overhead from impacting system metrics). System metrics require a short run (taking, on average, &#8672;1 minute); we execute 100 steps for each workload, excluding the rst 10 steps to account for the bootstrap eect of PyTorch's lazy initialization. For the kernel metric run, we only require one step of each workload. After collecting kernel proles, we sum up the kernel metrics across kernels and weigh them by kernel duration.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2">Model trainer (oline component)</head><p>To train (and test) a model for predicting the performance of colocated workloads, we run experiments where pairs of workloads are colocated. The system design and methodology of KACE can be extended beyond two colocated workloads (see Section 5.2.5), including for non-DL workloads, since the key hurdles we have to overcome to improve colocation performance are not specic to workloads pairs or DL workloads. To fully evaluate the impact of interference, we focus on performance during the interval when both workloads are executing; as such, when any one workload completes execution, we terminate our proling processes.</p><p>For the training data feature set, we combine the features of colocated workloads; we sum up the raw metrics (e.g., number of threads) and average out the metrics that are reported as percentages (e.g., busy rate). Finally, we normalize all features before training. While the trainer can accommodate any prediction model, we evaluate four dierent ML techniques in Section 5.2.</p><p>A key contribution of KACE is its ability to train with a small sample size. We evaluate prediction performance under dierent training set sizes, including the challenging scenario where the target workload to be colocated is not part of training, in Section 5.1; we nd that KACE can predict adequately using only 20%-30% of the data for training.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.3">Colocation predictor (online component)</head><p>The predictor determines, at runtime, the workload to colocate with a given target workload to maximize performance. While any denition of performance can be employed, we consider throughput sum to be our metric in this paper; see Section 4 for details. Given a target workload to be executed, the predictor iterates through all colocation candidate workloads (e.g., from a ready queue <ref type="bibr">[41]</ref>) and predicts the throughput sum for each combination of target and candidate workloads. The candidate workload predicted to provide the highest throughput sum is selected for colocation with the target workload (see Figure <ref type="figure">1</ref>).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.4">Implementation</head><p>The KACE implementation is done at the application level, without any OS or hardware modications. We implement the core logic of KACE in Python with around 2,500 lines of code. For system metric proling, we utilize nvidia_smi pmon to capture the resource usage of processes <ref type="bibr">[25]</ref>. For oine kernel proling, we use NsightCompute <ref type="bibr">[27]</ref>;</p><p>NVIDIA_MPS is disabled in this stage. During online prediction runs, we initiate the MPS daemon. Once the predictor determines the ideal workload for colocation, it submits them to the running MPS server for colocated execution.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">Experimental Setup and Methodology</head><p>Evaluation setup. We conduct our evaluation on a server in the Chameleon Cloud <ref type="bibr">[16]</ref> equipped with 2 Intel Xeon Gold 6230 CPUs, 128GB RAM, and a 32GB NVIDIA V100 GPU. We use PyTorch 1.13 and CUDA12.3 for our experiments. Evaluation methodology. We consider a target workload that is scheduled for execution and a list of candidate workloads that can be colocated with the target workload. Our performance metric, for a given workload colocation, is the throughput sum of the colocated workloads, -1 + -2 , where -1 and -2 are the throughput of the target and candidate workloads, respectively, when colocated. We focus on throughput sum as it is commonly used in colocation evaluations <ref type="bibr">[35]</ref>. When reporting our results, we normalize the observed throughput sum with the throughput sum achieved by Oracle, -Oracle , which is an oine-optimal policy representing the best colocated pair (described below).</p><p>Each colocation experiment is repeated 5 times. We report the average value of the normalized throughput sum along with error bars that represent the standard deviation. Workloads. We employ 21 workloads, encompassing 7 training and inference models with 3 batch sizes each. The workloads have relatively high GPU utilization, with an average SM busy rate of over 60%. Detailed workload information is shown in Table <ref type="table">1</ref>. By considering all possible pairs of workloads that can be accommodated in GPU memory, we obtain 181 possible colocations. We also conduct a limited evaluation (in Section 5.2.6) with an autoregressive workload, GPT2-xl (1.5B parameters) <ref type="bibr">[31]</ref>, to demonstrate KACE's applicability to modern DL workloads.</p><p>Comparison baselines. We compare KACE with several baselines, including impractical ones, to evaluate its performance.</p><p>&#8226; Oracle is an impractical, oine-optimal policy that runs all possible colocation combinations for a given target workload and selects the pair that achieves the highest throughput sum. &#8226; Xu et al. <ref type="bibr">[42]</ref> developed a method to predict workload interference among co-located VMs using GPU and CPU system metrics to train a Random Forest model. Their approach involves classifying GPU kernels as long or short to estimate context switch costs, and can be applied to non-virtualized environments as well. We implement their policy by collecting the metrics mentioned in their work and training a Random Forest model to predict the throughput sum of each colocation pair. &#8226; Random reports the mean of throughput sums of all possible colocations. For example, a given target workload could potentially be colocated with any of the 21 workloads we experiment with. Random obtains the throughput sum for all 21 colocations (except those that do not t in memory) and reports the mean. &#8226; MEMCAP, SM%, and MEM% are rule-based selection policies for choosing the workload to colocate with the target workload. Specically, MEMCAP selects, for colocation with the target workload, the workload that has the smallest GPU memory footprint metric. SM% and MEM% select, for colocation, the workload that has the highest Streaming Multiprocessor (SM) utilization or the lowest GPU memory bandwidth utilization, respectively. All three metrics can be easily obtained using nvidia-smi <ref type="bibr">[25]</ref>. &#8226; Best rule based picks the best-performing rule from among MEMCAP, SM%, and MEM%, for each colocation scenario. This can be considered an oine policy as it requires running all rule-based policies and selecting the best.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">Evaluation Results</head><p>This section presents our key experimental results. We start by discussing our performance prediction results under different ML models and training set sizes. Then we present our workload colocation results, highlighting the throughput sum gain aorded by KACE compared to various baselines.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.1">Colocation performance prediction</head><p>We evaluate the accuracy of KACE for predicting throughput sum of colocated pairs of workloads using four model candidates: Random Forest (RF), a 3-layer 128&#8677;64&#8677;32 Deep Neural Network (NN ), H2O Automatic Machine Learning (AutoML) [13], and Linear Regression (LR). For RF, we perform a grid search, testing 100 congurations out of a search space of 4,320 to nd the optimal hyperparameters. For NN, we apply early stopping to prevent overtting. AutoML is an automated ML framework that selects optimal models from Distributed RF, Gradient Boosting, DL, and ensemble models within a given time constraint. We allocate 1 minute for AutoML to nd the optimal model. We report prediction results on the test set for dierent training data set sizes.</p><p>The top two graphs in Figure <ref type="figure">2</ref> show the R 2 and RMSE values, respectively, for dierent ML techniques as a function of the training data set size (reported as a % of the total data set size). We see that the dierent ML techniques evaluated result in slightly dierent R 2 and RMSE values, with AutoML performing the best among them and Random Forst (RF) performing the worst. The superior performance of AutoML is to be expected as it sweeps through various ML techniques and employs the best one for each scenario. We nd that AutoML typically picks DNN model as the best technique. The poor performance of RF is likely due to the strong correlations in the feature set, leading to a lack of diversity in decision trees and resulting in inconsistency <ref type="bibr">[37]</ref>. Additionally, given the relatively small training set that is common in experimental works like ours (due to the time and eort required to generate samples), RF may result in overtting <ref type="bibr">[3]</ref>.</p><p>The bottom graph of Figure <ref type="figure">2</ref> shows, on a log scale, the time it takes for each ML technique to be trained. Note that the training time does not change much with the training data set size as the number of training data samples is small (the total data set size is less than 200 samples). Of course, the eort required to generate more training data scales with the number of training samples. KACE_LR has the least training time, by far, among the techniques evaluated; this is to be expected as LR is a relatively simple technique. KACE_RF has the highest training time as we also perform a grid search here to look for the best hyperparameters, and RF is a more involved learning technique. KACE_AutoML also has to search through various models, and so requires time.</p><p>For the colocated workload prediction problem, a simple ML technique like LR performs adequately, even outperforming more complex techniques like RF (in terms of R 2 and RMSE values), for several reasons. First, features like SM throughput may have a strong linear relationship with the throughput sum, making LR an ideal t. Second, LR can extrapolate predictions beyond the range of training data based on regression modeling. Third, models such as LR, that have high explainability, can benet from valuable features, such as kernel metrics, that inuence the response variable (throughput sum, in our case). </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.2">Workload colocation results</head><p>We now present our workload colocation results for KACE. Figure <ref type="figure">4</ref> shows the normalized throughput sum achieved by KACE (using LR) and other baseline policies, averaged over all 21 test set workloads. The normalization for each test case is with respect to Oracle; as such, Oracle shows a value of 1. Starting with Random, we see that it only achieves 54% of the throughput sum achieved by the oine-optimal Oracle. This is not surprising as Random eectively colocates a given target workload with a random workload, which can result in signicant GPU contention and performance degradation for the colocated workloads.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.2.1">KACE under dierent ML techniques.</head><p>The rule-based policies, MEMCAP, SM%, and MEM%, result in a wide range of results, with SM% performing even worse than Random, and MEMCAP and MEM% achieving 70%-80% of the performance gains aorded by Oracle. Recall that MEMCAP selects the workload for colocation that has the smallest GPU memory footprint. However, this metric provides limited information and cannot capture, for example, the model architecture details. SM% selects the workload for colocation that has the highest SM utilization; while this should maximize GPU utilization under colocation, it can lead to high resource contention. MEM% selects the colocation workload that has the smallest memory busy rate, favoring workloads with fewer data transfers and smaller input data. As such, this policy routinely overlooks colocation candidates such as speech recognition inference that perform frequent data transfers.</p><p>The Best rule-based policy selects the best of the three rules (MEMCAP, SM%, and MEM%) for each test set target workload, and as such has a higher throughput sum than the individual rule-based policies. While the Best rule-based policy is impractical, it serves as a good baseline policy. For example, we note that Best rule-based improves upon MEM-CAP by achieving a roughly 7% higher average throughout sum of 83.7%. This suggests that MEMCAP likely outperforms the other rule-based policies (SM% and MEM%) in individual test cases; on further inspection, we nd that MEMCAP is the best single rule-based policy in 13 out of the 21 test scenarios.</p><p>Xu et al. <ref type="bibr">[42]</ref> achieves 81% of the throughput sum achieved by Oracle. This is slightly higher than that achieved by MEM-CAP, but lower than that achieved by the (impractical) Best rule-based policy. Given that the feature set of Xu et al. is more extensive than the singular feature employed by MEM-CAP, the above results suggest that the additional features in Xu et al. do not provide signicant benets. This highlights the importance of selecting useful features when predicting colocated performance under GPU sharing.</p><p>KACE outperforms all other comparison baselines, achieving close to 91% of the throughput sum achieved by Oracle. Compared to the next-best practical policy (since Best rule-based requires oine runs), Xu et al., KACE achieves an 11% higher average throughput sum (relatively speaking). The superior performance of KACE can be attributed to the kernel information that it employs as part of its feature set, which allows it to better estimate GPU resource contention. We note that Xu et al. also employ some kernel metrics, such as long/short kernel information, but these features aim to capture GPU context switches among VMs, which is dierent from our objective of maximizing throughput. 5.2.3 Results for individual workloads. To better understand the performance of KACE on individual test workloads, we plot the normalized throughput sum achieved by KACE, Xu et al., and MEMCAP for all 21 test set workload colocations in Figure <ref type="figure">5</ref>; error bars represent the standard deviation over the 5 runs for each colocation. The '_bx' notation in the workload name refers to the batch size of x and the '-train'/'-inf' refers to the workload type. We do not show other policies as they are either impractical or perform worse, and to aid comparisons. Of the 21 colocations, we nd that KACE is the best policy in 13 cases. In these 13 cases, KACE outperforms Xu et al. and MEMCAP by 20% and 24%, respectively, on average, and by as much as 88% and 52%, respectively. Of the remaining 8 cases, Xu et al. is the best policy in 6 of them, and outperforms KACE by 7%, on average, and by as much as 14%. In 2 cases, MEMCAP is the best policy, and outperforms KACE by 6%, on average, and by as much as 7%.</p><p>We see that policy performance varies with dierent workloads. For example, both Xu et al. and MEMCAP underperform in the case of ViT inference, especially for batch size 2 ('ViT_b2-inf'). On further inspection, we nd that Xu et al. consistently selects ViT_b2-inf as the colocation candidate due to its low SM and MEM usage, underestimating the throughput benets of larger batch sizes, and thus fails to choose the optimal ViT_inf-b16 colocation candidate. In contrast, KACE additionally considers individual workload throughput, thereby often selecting the optimal colocation candidate. On the other hand, MEMCAP frequently chooses BERT_b2-inf as the colocation candidate due to its minimal memory footprint, but its high compute needs (92% SM busy rate) lead to signicant interference when paired with ViT_b2-inf, which has moderate compute needs (29% SM busy rate). KACE accounts for thread and register usage, incorporating GPU compute information, and thus outperforms MEMCAP. A similar behavior is also observed when colocating with the Whisper inference workload. 5.2.4 Results for unseen workloads. We now consider the challenging case where the target workload to be executed is not part of the training set (under any batch size); this could arise in practice either because a new workload is encountered at runtime or because the training set size is limited. We evaluated all 7 distinct workloads with the highest batch size, ensuring that the target workload, for any batch size, is not included in training. We nd that KACE continues to perform well, achieving &#8672;92% of the throughput sum achieved by Oracle. Compared to Xu et al. and rule-based policies, KACE achieves 11% and 16% higher average throughput sum, respectively. The above results show that KACE performs well even for unseen workloads. 5.2.5 Results for multiple unseen workloads. We now demonstrate KACE's ability to handle multiple (more than 2) colocated workloads; we consider the unseen workload case. Specically, we evaluate two colocation congurations:</p><p>(1) a target, unseen workload to be colocated with two other candidate workloads; and (2) a target, unseen workload to be colocated with three other candidate workloads. Our experimental results (not included here) show that KACE continues to perform well, achieving 96% and 91% of the throughput sum compared to Oracle when colocating with two and three workloads, respectively. While KACE can be extended beyond four colocated workloads, as the size of deep learning models continues to increase, we do not expect that numerous workloads will be needed to saturate a GPU while maintaining performance eciency <ref type="bibr">[4]</ref>. 5.2.6 Results for an unseen autoregressive workload. We now consider colocation with an autoregressive workload, given that such modern models can be dierent from traditional vision and NLP models. Specically, we experiment with the GPT2-xl model <ref type="bibr">[31]</ref> with output token lengths of 10, 20, and 214 (the average token length in LMSYS-CHAT-1M dataset <ref type="bibr">[22]</ref>). To maintain low proling overhead, we prole kernel metrics during the prell stage and the decoding stage of the rst token (representative of compute-light sequential token generation stages); the MEMCAP system metric captures the memory footprint of the entire decode stage as the MEMCAP value increases with output token length. We use the same training dataset as in Table <ref type="table">1</ref> (that is, without including GPT2-xl) and test with GPT2-xl as the target, unseen workload to be colocated with another workload. We nd that KACE achieves 92.3% of the throughput sum compared to Oracle and is &#8672;10% better than the next-best policy (Best rule-based). Xu et al. performs poorly in this case (57.8% of Oracle) as it does not consider the total memory footprint, an important feature for autoregressive models given their large output token length. The above results suggest that KACE can be extended to modern GPU workloads as well.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">Related Work</head><p>Performance prediction under colocation. Colocation performance predictions can be made using either online proling in the presence of interference or oine proling based on monitored metrics. While online proling oers high accuracy, it cannot proactively schedule workloads for colocation, which is the focus of our work.</p><p>Xu et al. <ref type="bibr">[42]</ref> predict interference between colocated DL jobs that are run on VMs on the same GPU. The authors also focus on predicting the VM context switch costs, and so select features for training that reect these costs. As discussed in Section 5.2, KACE outperforms Xu et al. due to its more appropriate feature set. MISO <ref type="bibr">[18]</ref> predicts the optimal MIG partitions by evaluating colocation speedup with MPS, requiring multiple online proles for each colocation to determine the best conguration. Horus <ref type="bibr">[43]</ref> uses DL computation graphs during oine proling to predict GPU utilization when colocating DL training workloads. However, its objective of maximizing GPU utilization need not translate to maximizing throughput sum, as acknowledged by the authors of Horus. Further, as shown using the SM% approach in Figure <ref type="figure">4</ref>, maximizing SM utilization can lead to poor throughput gains due to high interference. Finally, both Horus and MISO are primarily suited for training workloads due to checkpoints and oine runs, which are impractical for inference jobs with performance requirements.</p><p>We note that there are works that focus on performance prediction under colocation <ref type="bibr">[7,</ref><ref type="bibr">15,</ref><ref type="bibr">23,</ref><ref type="bibr">36]</ref>, but for non-GPU workloads. As such, these works cannot predict the colocated performance of GPU-based DL workloads as they are oblivious to GPU features. GPU scheduling for DL workloads. Prior GPU scheduling works involving temporal sharing aim to minimize the cost of state swapping between DL jobs. Gandiva <ref type="bibr">[40]</ref> introduces a checkpoint-restart mechanism to transfer training states between the GPU and host memory. Salus <ref type="bibr">[44]</ref> optimizes GPU state management to reduce context switches. There are also other works that focus on inference serving with temporal sharing <ref type="bibr">[33,</ref><ref type="bibr">34]</ref>. KACE does not focus on temporal sharing of the GPU, and instead considers spatial sharing.</p><p>For spatial sharing of the GPU, Wavelet <ref type="bibr">[39]</ref> and Zico <ref type="bibr">[21]</ref> colocate forward and backward passes of training tasks to reduce peak memory usage. IADeep <ref type="bibr">[4]</ref> predicts trainingspecic metrics when colocating and exploits long-running training jobs to stop/restart them for optimization. However, these solutions are specic to training workloads. GSLICE <ref type="bibr">[9]</ref> and gpulet <ref type="bibr">[5]</ref> focus on performance isolation for colocated GPU workloads with the objective being predictable performance, which is dierent from KACE's objective of maximizing throughput. SHEPHERD <ref type="bibr">[45]</ref> and AlpaServe <ref type="bibr">[20]</ref> improve GPU eciency for model serving, but do not primarily focus on interference-aware GPU colocation. Orion <ref type="bibr">[35]</ref> reduces GPU interference via kernel-level scheduling through the colocation of memory-and compute-intensive kernels. However, Orion requires oine kernel labeling and specic CUDA support for eective scheduling. In contrast, KACE focuses on workload-level solutions, tackling GPU interference from the application perspective. Further, Orion aims to minimize interference among a given colocated workload set whereas KACE aims to nd workloads to colocate to maximize throughput. As such, KACE and Orion are somewhat complementary. Similarly, KACE can be considered complementary to (the AMD-specic) REEF <ref type="bibr">[14]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7">Conclusion</head><p>This paper presents KACE, a framework for ecient GPU spatial sharing that accurately and quickly predicts interference among colocated DL workloads. Our key contributions include: (i) selecting a set of kernel and system metrics that provide valuable information to predict colocated performance; (ii) using limited and one-time oine and exclusive proling of individual workloads, eliminating the need for costly online proling; (iii) identifying a simple ML model that provides adequate colocation performance prediction accuracy with minimal training time and a small training dataset; and (iv) experimentally evaluating KACE over multiple training and inference workloads and against various baselines. Evaluation results show that KACE achieves over 90% of the throughput sum achieved by Oracle using only a fraction of the training data.</p></div></body>
		</text>
</TEI>
