TL;DR
Niyama is a novel LLM inference serving system that breaks the traditional "silos" between interactive (low-latency) and batch (high-throughput) workloads. By using dynamic chunking and a hybrid scheduling policy, it increases serving capacity by up to 32% while maintaining strict Quality-of-Service (QoS) guarantees, even under extreme traffic surges.
Introduction: The Inefficiency of Siloed Serving
Currently, Large Language Model (LLM) providers treat different types of requests as separate entities. Interactive requests, such as autocomplete suggestions requiring millisecond-level responses, are typically handled by dedicated GPU clusters separate from batch tasks like long document summarization.
This "siloed" approach leads to significant resource underutilization. If an interactive cluster experiences a lull while a batch cluster is overloaded, resources cannot be easily reallocated. Furthermore, standard scheduling algorithms like First-Come-First-Served (FCFS) or Earliest Deadline First (EDF) often fail during traffic spikes. They are prone to "head-of-line blocking," where long requests delay short ones, or a "death spiral," where cascading delays cause nearly all requests to miss their deadlines.
Technical Innovations
Niyama introduces three primary technical innovations to enable efficient co-scheduling on shared infrastructure:
1. Dynamic Chunking
Standard systems often use fixed-size chunks for the "prefill" stage (processing the input prompt). Niyama instead calculates "deadline slack"—the remaining time before active requests must generate their next token. It then dynamically adjusts the prefill chunk size to be as large as possible to maximize throughput without violating the latency targets of active interactive requests.
2. Hybrid Prioritization
Scheduling needs change based on system load. While EDF is effective at low loads, Shortest Remaining Prompt First (SRPF) performs better during high-load scenarios. Niyama employs a hybrid priority formula that interpolates between these two strategies, maintaining fairness during normal operation while prioritizing efficiency during surges.
3. Eager Relegation and Selective Preemption
To handle extreme overloads, Niyama implements "eager relegation." It identifies a small fraction of requests (e.g., 5%) likely to miss their deadlines and proactively moves them to a relegated queue. This prevents a few failing requests from causing system-wide congestion, ensuring the vast majority of traffic still meets QoS targets. Additionally, Niyama uses selective preemption, only interrupting requests in the prefill stage to avoid the high memory overhead and latency penalties associated with preempting the decode stage.
Evaluation and Key Results
The researchers evaluated Niyama using diverse production traces, including Azure Conv (conversational AI) and Azure Code (coding assistants), testing against models like Llama3-8B on NVIDIA A100 GPUs.
- Serving Capacity: Niyama improves effective serving capacity by 12–32% compared to state-of-the-art siloed deployments like Sarathi-Serve.
- Goodput: In shared environments, Niyama achieves 1.5x to 2.4x higher goodput (requests served within SLO) than standard FCFS scheduling.
- Resilience: Under a 50% overload, Niyama maintained QoS for over 95% of requests, whereas baseline systems often saw over 80% of requests violate their deadlines.
- Cost Efficiency: By reducing the number of GPUs required for the same workload, Niyama offers significant operational cost savings for cloud providers.
Limitations and Future Work
While Niyama represents a significant step forward, it relies on a Random Forest model to predict decode lengths; highly erratic workloads may challenge these predictions. Furthermore, the "Eager Relegation" policy is most effective when provided with application-level priority hints (e.g., tier-based service). Future research will explore scaling these dynamic chunking and scheduling logic to massive, multi-node pipeline-parallel environments.
Summary updated