SpotServe: Serving Generative Large Language Models on Preemptible Instances
Paper · 2023 · Xupeng Miao, Chunan Shi, Jiangfei Duan et al.
Summary
SpotServe addresses the high cost of serving generative LLMs. It runs inference on preemptible cloud GPUs, such as AWS spot instances, which can be up to 90% cheaper than on-demand machines but can be reclaimed at any time. Earlier spot-based serving systems assumed that a model fits on one instance and handled preemptions by rerouting requests or adding redundancy. LLMs instead need data, tensor and pipeline parallelism across many machines, so one preemption disrupts a whole pipeline. SpotServe has three main components:
- Adaptive parallelization: it re-chooses the parallelization configuration whenever instance availability or request load changes.
- Cheap migration: it frames the assignment of surviving instances to the new layout as bipartite matching, solved with the Kuhn-Munkres algorithm, so existing parameters and key/value cache are reused.
- Grace-period use: it saves decoding progress token by token, so interrupted requests resume instead of restarting.
On real preemption traces and several LLMs, SpotServe cut P99 tail latency by 2.4–9.1× compared with existing serving systems. It also lowered monetary cost by 54% compared with on-demand-only deployment. This makes large-model serving more affordable for budget-limited teams.
Key points
- The authors describe SpotServe as the earliest system to serve generative LLMs in a distributed fashion using preemptible instances. It appeared at ASPLOS'24, and the code is available at github.com/Hsword/SpotServe.
- The paper illustrates the cost problem with two examples:
- Serving one GPT-3 (175B) pipeline on AWS needs more than 16 A100-40GB GPUs and costs over $66 per hour.
- Reloading a 120B-parameter GPT model from persistent storage on AWS takes more than 2 minutes, so restarting from scratch is expensive.
- AWS gives about 30 seconds of grace period before a spot instance is taken away. SpotServe uses this window through stateful inference recovery with a just-in-time decision on when to move the KV cache.
- Reported results:
- P99 tail latency is 2.4–9.1× lower than the best existing LLM serving systems.
- Cost is up to 54% lower than on-demand instances, with similar average latency.
- The authors found AlpaServe about 3× slower than FasterTransformer (C++) for serving a single LLM.
- The authors list several limitations:
- The system depends on the grace period.
- It targets single-type GPU instances.
- It optimizes only for latency, leaving strict-SLO or throughput goals, mixture-of-experts models, and multi-cloud or heterogeneous setups for future work.
Interesting ideas
- I1. Token-level checkpointing for autoregressive jobs. Saving progress after each generated token means a short shutdown window still preserves most of the work. The same idea suits any long-running generation job on unreliable hardware, such as large-scale corpus annotation or translation with an LLM.
- I2. Migration as an assignment problem. Treating "which old machine takes which new role" as weighted bipartite matching, solved with Kuhn-Munkres, minimizes how much state must be moved. This is a simple, optimal recipe for any resharding task where nodes already hold partial data.
- I3. Overlapping migration with pipeline order. Because pipeline stages run in sequence, state can be moved stage by stage while other stages keep computing. This hides downtime and could be borrowed for rolling updates of multi-stage processing pipelines.
- I4. Re-planning the configuration as conditions change. Instead of fixing one parallel layout, the system re-chooses it whenever available hardware or incoming load shifts, balancing latency, throughput and cost. This is a useful pattern for budget-constrained NLP serving that relies on cheap but volatile compute.
- I5. Applicability beyond cloud spot instances. The authors argue the same techniques apply whenever a scheduler can pull resources away, for example for urgent jobs on a shared cluster. Shared university or lab GPU clusters could benefit in the same way.
Institutions
Fields, topics and concepts
📚 Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 18,614 worksInformation Systems · 1,730 worksHardware and Architecture · 167 worksComputer Networks and Communications · 100 works
🧭 Topics 1Research subjects and languages the work is about.Language models & pretraining · 3,894 works
Cite
Cite as Xupeng Miao, Chunan Shi, Jiangfei Duan, Xiaoli Xi, Dahua Lin, Bin Cui and Zhihao Jia. 2023. SpotServe: Serving Generative Large Language Models on Preemptible Instances. arXiv:2311.15566.
@misc{miao2023spotserve,
title = {{SpotServe: Serving Generative Large Language Models on Preemptible Instances}},
author = {Xupeng Miao, Chunan Shi, Jiangfei Duan, Xiaoli Xi, Dahua Lin, Bin Cui and Zhihao Jia},
year = {2023},
doi = {10.48550/arxiv.2311.15566},
eprint = {2311.15566},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2311.15566}
}References
- Amazon ec2 spot instances. https://aws.amazon.com/ec2/spot/. ↗
- Nvidia triton inference server. https://developer.nvidia.com/nvidia-triton-inference-server. ↗
- Use azure spot virtual machines. https://learn.microsoft.com/en-us/ azure/virtual-machines/spot-vms. ↗
- Cuda ipc. https://docs.nvidia.com/cuda/cuda-runtime-api/group_ _CUDART__DEVICE.html, 2021. ↗
- Nvidia fastertransformer. https://github.com/NVIDIA/ FasterTransformer, 2021. ↗
- Nvidia nccl. https://developer.nvidia.com/nccl, 2021. ↗
- vllm: Easy, fast, and cheap llm serving with pagedattention. https://vllm.ai, 2023. ↗
- Martín Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, Manjunath Kudlur, Josh Levenberg, Rajat Monga, Sherry Moore, Derek G. Murray, Benoit Steiner, Paul Tucker, Vijay Vasudevan, Pete Warden, Martin Wicke, Yua… — TensorFlow: A system for large-scale machine learning
- Ahsan Ali, Riccardo Pinciroli, Feng Yan, and Evgenia Smirni. Batch: Machine learning inference serving on serverless platforms with adaptive batching. In SC20: International Conference for High Performance Computing, Networking, Storage and Analysis, pages 1–15, 2020. find
- Ahsan Ali, Riccardo Pinciroli, Feng Yan, and Evgenia Smirni. Optimizing inference serving on serverless platforms. Proceedings of the VLDB Endowment, 15(10), 2022. find
- Reza Yazdani Aminabadi, Samyam Rajbhandari, Ammar Ahmad Awan, Cheng Li, Du Li, Elton Zheng, Olatunji Ruwase, Shaden Smith, Minjia Zhang, Jeff Rasley, and Yuxiong He. Deepspeed- inference: Enabling efficient inference of transformer models at unprecedented scale. In SC22: International Conference for… find
- Sanjith Athlur, Nitika Saran, Muthian Sivathanu, Ramachandran Ramjee, and Nipun Kwatra. Varuna: scalable, low-cost training of massive deep learning models. In Proceedings of the Seventeenth European Conference on Computer Systems, pages 472–487, 2022. find
- Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter,… — Language Models are Few-Shot Learners
- Junguk Cho, Diman Zad Tootaghaj, Lianjie Cao, and Puneet Sharma. Sla-driven ml inference framework for clouds with heterogeneous accelerators. In D. Marculescu, Y. Chi, and C. Wu, editors, Proceedings of Machine Learning and Systems, volume 4, pages 20–32, 2022. find
- Daniel Crankshaw, Xin Wang, Guilio Zhou, Michael J. Franklin, Joseph E. Gonzalez, and Ion Stoica. Clipper: A Low-Latency online prediction serving system. In 14th USENIX Symposium on Networked Systems Design and Implementation (NSDI 17), pages 613–627, Boston, MA, March 2017. USENIX Association. find
- Dense Linear Algebra on GPUs. https://developer.nvidia.com/cublas, 2016. ↗
- Jiarui Fang, Yang Yu, Chengduo Zhao, and Jie Zhou. Turbotransformers: an efficient GPU serving system for transformer models. In Jaejin Lee and Erez Petrank, editors, PPoPP ’21: 26th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, Virtual Event, Republic of Korea, February… find
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/papers/miao-2023-spotserve-serving-generative-large-language/