Saved in:
Bibliographic Details
Main Authors: Miao, Ruijie, Yan, Yihan, Yao, Xinshuo, Yang, Tong
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2407.20272
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913451429855232
author Miao, Ruijie
Yan, Yihan
Yao, Xinshuo
Yang, Tong
author_facet Miao, Ruijie
Yan, Yihan
Yao, Xinshuo
Yang, Tong
contents Building efficient inference framework has gained increasing interests for research community. Early-exit models, a variant of LLMs, improves the inference efficiency of LLMs by skipping rest layers and directly generate output tokens when they are confident enough. However, there is no work of LLM inference framework that takes early-exit models into consideration. This is non-trivial as prior art on LLM inference cannot be directly applied to early-exit models. In this work, we solves two key challenges in building efficient inference framework for early-exit models: (1) batch inference at iteration-level granularity; and (2) KV cache management. For the former, we propose to process the batch until all sequences surpass the early-exit confidence threshold. For the latter, we propose to fill the KV cache of rest layers before the iteration terminates. Our evaluation shows that, compared with the original vLLM operating at full layers, our solution achieves up to 1.25x speed up.
format Preprint
id arxiv_https___arxiv_org_abs_2407_20272
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle An Efficient Inference Framework for Early-exit Large Language Models
Miao, Ruijie
Yan, Yihan
Yao, Xinshuo
Yang, Tong
Computation and Language
Artificial Intelligence
Machine Learning
Building efficient inference framework has gained increasing interests for research community. Early-exit models, a variant of LLMs, improves the inference efficiency of LLMs by skipping rest layers and directly generate output tokens when they are confident enough. However, there is no work of LLM inference framework that takes early-exit models into consideration. This is non-trivial as prior art on LLM inference cannot be directly applied to early-exit models. In this work, we solves two key challenges in building efficient inference framework for early-exit models: (1) batch inference at iteration-level granularity; and (2) KV cache management. For the former, we propose to process the batch until all sequences surpass the early-exit confidence threshold. For the latter, we propose to fill the KV cache of rest layers before the iteration terminates. Our evaluation shows that, compared with the original vLLM operating at full layers, our solution achieves up to 1.25x speed up.
title An Efficient Inference Framework for Early-exit Large Language Models
topic Computation and Language
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2407.20272