Contention-Aware Flexible Execution for Machine Learning Workloads
Marco Kurzynski, Shaizeen Aga, Di Wu
Abstract
Concurrent kernel execution is a ubiquitous paradigm in artificial intelligence (AI) and machine learning (ML) across both training and inference. That said, concurrency causes potential slowdown as concurrent kernels contend for limited GPU resources (cores, caches, memory bandwidth), which are shared between these kernels rather than exclusively available to one, as in isolated execution. This raises an important research question: to what extent does concurrency slow down kernel execution and how can it be mitigated. To answer this question, our work presents two studies. First, we characterize concurrent kernel execution extensively for the first time, to our knowledge. We conduct not just performance analysis of concurrent kernels but also memory behavior under concurrency on state-of-the-art AMD Instinct MI300X GPUs designed for datacenter AI, using the AMD-internal millisecond sampler. Based on the observations, we share insights on the slowdown along two dimensions (memory vs. compute bound, large vs. small kernels) to inform future optimizations. Second, we put the derived insights to use, aiming to deliver higher performance via targeted, flexible overlap of ML operators. Frameworks today make the simple decision of early-first for concurrent kernels, which is suboptimal. Noticing the opportunity that ML dataflow has inherent flexibility in which operators can be overlapped and how hardware resources can be allocated, we deduce simple heuristics to tune both overlap anchors and resource allocation for concurrent kernels to improve performance. We evaluate our proposed contention-aware flexible execution (termed CAFEML) across a variety of ML scenarios (inference decode, inference prefill, training) and demonstrate a speedup of up to 13% end-to-end with simple scheduling changes and no kernel rewrites.
Create a lesson
Related papers
Network Contention State Aware Dynamic Optimizer for Accelerator Collective Communication Libraries
Shared title terminology · Rajat Bisht, Tevfik Kosar, Anthony Skjellum et al.
Accelerating Mixture of Block Attention via Dynamic Routing, KV-Centric Execution and Runtime Pipelining
Shared title terminology · Yingqi Shi, Junru Lu, Yun Liu et al.
Matching Architecture to Workload: Comparing RISC-V Parallel Accelerators for Energy-Efficient Embedded Computing
Shared title terminology · Luca Colombo, Luigi Ghionda, Amirhossein Kiamarzi et al.
A Runtime System for Mitigating Crossbar Port Contention on SM-Partitioned GPUs
Shared title terminology · Ziwen Wang, Qi Luo, Kunlin Li et al.
Locality-Aware Scheduling for Stream Processing Applications in Serverless Environments
Shared title terminology · Tianyu Qi, Maria A. Rodriguez, Rajkumar Buyya
DexAttention: Distributed Sparse Attention through Rapid Online Planning and Persistent GPU Execution
Shared title terminology · Sirui Chen, Xuehai Qian