No Request Left Behind: Tackling Heterogeneity in Long-Context LLM Inference with Medha

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Agrawal, Amey, Qiu, Haoran, Chen, Junda, Goiri, Íñigo, Zhang, Chaojie, Shahid, Rayyan, Ramjee, Ramachandran, Tumanov, Alexey, Choukse, Esha
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866915637679357952
author Agrawal, Amey
Qiu, Haoran
Chen, Junda
Goiri, Íñigo
Zhang, Chaojie
Shahid, Rayyan
Ramjee, Ramachandran
Tumanov, Alexey
Choukse, Esha
author_facet Agrawal, Amey
Qiu, Haoran
Chen, Junda
Goiri, Íñigo
Zhang, Chaojie
Shahid, Rayyan
Ramjee, Ramachandran
Tumanov, Alexey
Choukse, Esha
contents Deploying million-token Large Language Models (LLMs) is challenging because production workloads are highly heterogeneous, mixing short queries and long documents. This heterogeneity, combined with the quadratic complexity of attention, creates severe convoy effects where long-running requests stall short, interactive ones, degrading system responsiveness. We present Medha, a serving system that eliminates these convoys by introducing fine-grained, preemptive scheduling to LLM inference. Medha makes preemption practical with a co-designed set of mechanisms -- including Adaptive Chunking and Stream Pipeline Parallel that overcome the perceived inefficiencies and scaling challenges of chunking. Additionally, we present a new parallelism strategy KV-Cache Parallelism to reduce the decode latency and afford interactivity despite very long context. These mechanisms are orchestrated by a Length-Aware Relative Slack (LARS) scheduler, a deadline and heterogeneity-aware scheduling policy that prevents both the convoy effect and the starvation that plagues simpler policies. Under a heterogeneous workload, Medha improves throughput by 5.7x while reducing median and 99th percentile latency by 30x and 174x, respectively, compared to state-of-the-art non-preemptive systems.
format Preprint
id arxiv_https___arxiv_org_abs_2409_17264
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle No Request Left Behind: Tackling Heterogeneity in Long-Context LLM Inference with Medha
Agrawal, Amey
Qiu, Haoran
Chen, Junda
Goiri, Íñigo
Zhang, Chaojie
Shahid, Rayyan
Ramjee, Ramachandran
Tumanov, Alexey
Choukse, Esha
Machine Learning
Distributed, Parallel, and Cluster Computing
Deploying million-token Large Language Models (LLMs) is challenging because production workloads are highly heterogeneous, mixing short queries and long documents. This heterogeneity, combined with the quadratic complexity of attention, creates severe convoy effects where long-running requests stall short, interactive ones, degrading system responsiveness. We present Medha, a serving system that eliminates these convoys by introducing fine-grained, preemptive scheduling to LLM inference. Medha makes preemption practical with a co-designed set of mechanisms -- including Adaptive Chunking and Stream Pipeline Parallel that overcome the perceived inefficiencies and scaling challenges of chunking. Additionally, we present a new parallelism strategy KV-Cache Parallelism to reduce the decode latency and afford interactivity despite very long context. These mechanisms are orchestrated by a Length-Aware Relative Slack (LARS) scheduler, a deadline and heterogeneity-aware scheduling policy that prevents both the convoy effect and the starvation that plagues simpler policies. Under a heterogeneous workload, Medha improves throughput by 5.7x while reducing median and 99th percentile latency by 30x and 174x, respectively, compared to state-of-the-art non-preemptive systems.
title No Request Left Behind: Tackling Heterogeneity in Long-Context LLM Inference with Medha
topic Machine Learning
Distributed, Parallel, and Cluster Computing
url https://arxiv.org/abs/2409.17264