Sequoia: Scalable, Robust, and Hardware-aware Speculative Decoding

As the usage of large language models (LLMs) grows, performing efficient inference with these models becomes increasingly important. While speculative decoding has recently emerged as a promising direction for speeding up inference, existing methods are limited in their ability to scale to larger sp...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Chen, Zhuoming, May, Avner, Svirschevski, Ruslan, Huang, Yuhsun, Ryabinin, Max, Jia, Zhihao, Chen, Beidi
Format: Artikel
Sprache:eng
Schlagworte:
Online-Zugang:Volltext bestellen
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
container_end_page
container_issue
container_start_page
container_title
container_volume
creator Chen, Zhuoming
May, Avner
Svirschevski, Ruslan
Huang, Yuhsun
Ryabinin, Max
Jia, Zhihao
Chen, Beidi
description As the usage of large language models (LLMs) grows, performing efficient inference with these models becomes increasingly important. While speculative decoding has recently emerged as a promising direction for speeding up inference, existing methods are limited in their ability to scale to larger speculation budgets, and adapt to different hyperparameters and hardware. This paper introduces Sequoia, a scalable, robust, and hardware-aware algorithm for speculative decoding. To attain better scalability, Sequoia introduces a dynamic programming algorithm to find the optimal tree structure for the speculated tokens. To achieve robust speculative performance, Sequoia uses a novel sampling and verification method that outperforms prior work across different decoding temperatures. Finally, Sequoia introduces a hardware-aware tree optimizer that maximizes speculative performance by automatically selecting the token tree size and depth for a given hardware platform. Evaluation shows that Sequoia improves the decoding speed of Llama2-7B, Llama2-13B, and Vicuna-33B on an A100 by up to $4.04\times$, $3.73\times$, and $2.27\times$. For offloading setting on L40, Sequoia achieves as low as 0.56 s/token for exact Llama2-70B inference latency, which is $9.96\times$ on our optimized offloading system (5.6 s/token), $9.7\times$ than DeepSpeed-Zero-Inference, $19.5\times$ than Huggingface Accelerate.
doi_str_mv 10.48550/arxiv.2402.12374
format Article
fullrecord <record><control><sourceid>arxiv_GOX</sourceid><recordid>TN_cdi_arxiv_primary_2402_12374</recordid><sourceformat>XML</sourceformat><sourcesystem>PC</sourcesystem><sourcerecordid>2402_12374</sourcerecordid><originalsourceid>FETCH-LOGICAL-a674-9a991ff31e88f31c959a1ca60ae7537d470257a589bfcbde898b51e48900532a3</originalsourceid><addsrcrecordid>eNotz71OwzAYhWEvDCjlApjwBTTBv7HNBoVSpEpIpHv02f5SWQpNcZtC7x5aurxnO9JDyC1nlbJas3vIP-lQCcVExYU06po8Nfg1DgkeaBOgB9_jlH4MftztpxQ2kS4gx2_IWMKptNliGHvYpwPSZwxDTJv1hFx10O_w5rIFWc1fVrNFuXx_fZs9LkuojSodOMe7TnK09q_BaQc8QM0AjZYmKsOENqCt813wEa2zXnNU1jGmpQBZkLv_2zOi3eb0CfnYnjDtGSN_ASLPQ3Y</addsrcrecordid><sourcetype>Open Access Repository</sourcetype><iscdi>true</iscdi><recordtype>article</recordtype></control><display><type>article</type><title>Sequoia: Scalable, Robust, and Hardware-aware Speculative Decoding</title><source>arXiv.org</source><creator>Chen, Zhuoming ; May, Avner ; Svirschevski, Ruslan ; Huang, Yuhsun ; Ryabinin, Max ; Jia, Zhihao ; Chen, Beidi</creator><creatorcontrib>Chen, Zhuoming ; May, Avner ; Svirschevski, Ruslan ; Huang, Yuhsun ; Ryabinin, Max ; Jia, Zhihao ; Chen, Beidi</creatorcontrib><description>As the usage of large language models (LLMs) grows, performing efficient inference with these models becomes increasingly important. While speculative decoding has recently emerged as a promising direction for speeding up inference, existing methods are limited in their ability to scale to larger speculation budgets, and adapt to different hyperparameters and hardware. This paper introduces Sequoia, a scalable, robust, and hardware-aware algorithm for speculative decoding. To attain better scalability, Sequoia introduces a dynamic programming algorithm to find the optimal tree structure for the speculated tokens. To achieve robust speculative performance, Sequoia uses a novel sampling and verification method that outperforms prior work across different decoding temperatures. Finally, Sequoia introduces a hardware-aware tree optimizer that maximizes speculative performance by automatically selecting the token tree size and depth for a given hardware platform. Evaluation shows that Sequoia improves the decoding speed of Llama2-7B, Llama2-13B, and Vicuna-33B on an A100 by up to $4.04\times$, $3.73\times$, and $2.27\times$. For offloading setting on L40, Sequoia achieves as low as 0.56 s/token for exact Llama2-70B inference latency, which is $9.96\times$ on our optimized offloading system (5.6 s/token), $9.7\times$ than DeepSpeed-Zero-Inference, $19.5\times$ than Huggingface Accelerate.</description><identifier>DOI: 10.48550/arxiv.2402.12374</identifier><language>eng</language><subject>Computer Science - Computation and Language</subject><creationdate>2024-02</creationdate><rights>http://arxiv.org/licenses/nonexclusive-distrib/1.0</rights><oa>free_for_read</oa><woscitedreferencessubscribed>false</woscitedreferencessubscribed></display><links><openurl>$$Topenurl_article</openurl><openurlfulltext>$$Topenurlfull_article</openurlfulltext><thumbnail>$$Tsyndetics_thumb_exl</thumbnail><link.rule.ids>228,230,776,881</link.rule.ids><linktorsrc>$$Uhttps://arxiv.org/abs/2402.12374$$EView_record_in_Cornell_University$$FView_record_in_$$GCornell_University$$Hfree_for_read</linktorsrc><backlink>$$Uhttps://doi.org/10.48550/arXiv.2402.12374$$DView paper in arXiv$$Hfree_for_read</backlink></links><search><creatorcontrib>Chen, Zhuoming</creatorcontrib><creatorcontrib>May, Avner</creatorcontrib><creatorcontrib>Svirschevski, Ruslan</creatorcontrib><creatorcontrib>Huang, Yuhsun</creatorcontrib><creatorcontrib>Ryabinin, Max</creatorcontrib><creatorcontrib>Jia, Zhihao</creatorcontrib><creatorcontrib>Chen, Beidi</creatorcontrib><title>Sequoia: Scalable, Robust, and Hardware-aware Speculative Decoding</title><description>As the usage of large language models (LLMs) grows, performing efficient inference with these models becomes increasingly important. While speculative decoding has recently emerged as a promising direction for speeding up inference, existing methods are limited in their ability to scale to larger speculation budgets, and adapt to different hyperparameters and hardware. This paper introduces Sequoia, a scalable, robust, and hardware-aware algorithm for speculative decoding. To attain better scalability, Sequoia introduces a dynamic programming algorithm to find the optimal tree structure for the speculated tokens. To achieve robust speculative performance, Sequoia uses a novel sampling and verification method that outperforms prior work across different decoding temperatures. Finally, Sequoia introduces a hardware-aware tree optimizer that maximizes speculative performance by automatically selecting the token tree size and depth for a given hardware platform. Evaluation shows that Sequoia improves the decoding speed of Llama2-7B, Llama2-13B, and Vicuna-33B on an A100 by up to $4.04\times$, $3.73\times$, and $2.27\times$. For offloading setting on L40, Sequoia achieves as low as 0.56 s/token for exact Llama2-70B inference latency, which is $9.96\times$ on our optimized offloading system (5.6 s/token), $9.7\times$ than DeepSpeed-Zero-Inference, $19.5\times$ than Huggingface Accelerate.</description><subject>Computer Science - Computation and Language</subject><fulltext>true</fulltext><rsrctype>article</rsrctype><creationdate>2024</creationdate><recordtype>article</recordtype><sourceid>GOX</sourceid><recordid>eNotz71OwzAYhWEvDCjlApjwBTTBv7HNBoVSpEpIpHv02f5SWQpNcZtC7x5aurxnO9JDyC1nlbJas3vIP-lQCcVExYU06po8Nfg1DgkeaBOgB9_jlH4MftztpxQ2kS4gx2_IWMKptNliGHvYpwPSZwxDTJv1hFx10O_w5rIFWc1fVrNFuXx_fZs9LkuojSodOMe7TnK09q_BaQc8QM0AjZYmKsOENqCt813wEa2zXnNU1jGmpQBZkLv_2zOi3eb0CfnYnjDtGSN_ASLPQ3Y</recordid><startdate>20240219</startdate><enddate>20240219</enddate><creator>Chen, Zhuoming</creator><creator>May, Avner</creator><creator>Svirschevski, Ruslan</creator><creator>Huang, Yuhsun</creator><creator>Ryabinin, Max</creator><creator>Jia, Zhihao</creator><creator>Chen, Beidi</creator><scope>AKY</scope><scope>GOX</scope></search><sort><creationdate>20240219</creationdate><title>Sequoia: Scalable, Robust, and Hardware-aware Speculative Decoding</title><author>Chen, Zhuoming ; May, Avner ; Svirschevski, Ruslan ; Huang, Yuhsun ; Ryabinin, Max ; Jia, Zhihao ; Chen, Beidi</author></sort><facets><frbrtype>5</frbrtype><frbrgroupid>cdi_FETCH-LOGICAL-a674-9a991ff31e88f31c959a1ca60ae7537d470257a589bfcbde898b51e48900532a3</frbrgroupid><rsrctype>articles</rsrctype><prefilter>articles</prefilter><language>eng</language><creationdate>2024</creationdate><topic>Computer Science - Computation and Language</topic><toplevel>online_resources</toplevel><creatorcontrib>Chen, Zhuoming</creatorcontrib><creatorcontrib>May, Avner</creatorcontrib><creatorcontrib>Svirschevski, Ruslan</creatorcontrib><creatorcontrib>Huang, Yuhsun</creatorcontrib><creatorcontrib>Ryabinin, Max</creatorcontrib><creatorcontrib>Jia, Zhihao</creatorcontrib><creatorcontrib>Chen, Beidi</creatorcontrib><collection>arXiv Computer Science</collection><collection>arXiv.org</collection></facets><delivery><delcategory>Remote Search Resource</delcategory><fulltext>fulltext_linktorsrc</fulltext></delivery><addata><au>Chen, Zhuoming</au><au>May, Avner</au><au>Svirschevski, Ruslan</au><au>Huang, Yuhsun</au><au>Ryabinin, Max</au><au>Jia, Zhihao</au><au>Chen, Beidi</au><format>journal</format><genre>article</genre><ristype>JOUR</ristype><atitle>Sequoia: Scalable, Robust, and Hardware-aware Speculative Decoding</atitle><date>2024-02-19</date><risdate>2024</risdate><abstract>As the usage of large language models (LLMs) grows, performing efficient inference with these models becomes increasingly important. While speculative decoding has recently emerged as a promising direction for speeding up inference, existing methods are limited in their ability to scale to larger speculation budgets, and adapt to different hyperparameters and hardware. This paper introduces Sequoia, a scalable, robust, and hardware-aware algorithm for speculative decoding. To attain better scalability, Sequoia introduces a dynamic programming algorithm to find the optimal tree structure for the speculated tokens. To achieve robust speculative performance, Sequoia uses a novel sampling and verification method that outperforms prior work across different decoding temperatures. Finally, Sequoia introduces a hardware-aware tree optimizer that maximizes speculative performance by automatically selecting the token tree size and depth for a given hardware platform. Evaluation shows that Sequoia improves the decoding speed of Llama2-7B, Llama2-13B, and Vicuna-33B on an A100 by up to $4.04\times$, $3.73\times$, and $2.27\times$. For offloading setting on L40, Sequoia achieves as low as 0.56 s/token for exact Llama2-70B inference latency, which is $9.96\times$ on our optimized offloading system (5.6 s/token), $9.7\times$ than DeepSpeed-Zero-Inference, $19.5\times$ than Huggingface Accelerate.</abstract><doi>10.48550/arxiv.2402.12374</doi><oa>free_for_read</oa></addata></record>
fulltext fulltext_linktorsrc
identifier DOI: 10.48550/arxiv.2402.12374
ispartof
issn
language eng
recordid cdi_arxiv_primary_2402_12374
source arXiv.org
subjects Computer Science - Computation and Language
title Sequoia: Scalable, Robust, and Hardware-aware Speculative Decoding
url https://sfx.bib-bvb.de/sfx_tum?ctx_ver=Z39.88-2004&ctx_enc=info:ofi/enc:UTF-8&ctx_tim=2025-02-02T16%3A59%3A00IST&url_ver=Z39.88-2004&url_ctx_fmt=infofi/fmt:kev:mtx:ctx&rfr_id=info:sid/primo.exlibrisgroup.com:primo3-Article-arxiv_GOX&rft_val_fmt=info:ofi/fmt:kev:mtx:journal&rft.genre=article&rft.atitle=Sequoia:%20Scalable,%20Robust,%20and%20Hardware-aware%20Speculative%20Decoding&rft.au=Chen,%20Zhuoming&rft.date=2024-02-19&rft_id=info:doi/10.48550/arxiv.2402.12374&rft_dat=%3Carxiv_GOX%3E2402_12374%3C/arxiv_GOX%3E%3Curl%3E%3C/url%3E&disable_directlink=true&sfx.directlink=off&sfx.report_link=0&rft_id=info:oai/&rft_id=info:pmid/&rfr_iscdi=true