The official implementation of "SDSAT: Accelerating LLM Inference through Speculative Decoding with Semantic Adaptive Tokens" Including the decoding method of both greedy search and nucleus sampling.
📖 paper
SDSAT is an acceleration scheme for large language models (LLMs) through Speculative Decoding with Semantic Adaptive Tokens (SDSAT). The primary objective of this design is to enhance the LLM model’s ability to generate draft tokens more accurately without compromising the model’s accuracy. The core strategies involve:
conda create -n sdsat python=3.10
conda activate sdsat
pip install -r requirements.txt
Execute the following code for speed testing.
# greedy sampling of SDSAT-7B on GPU 0,1,2,3
bash start_greedy.sh ainergy/CodeLlama-SDSAT_L5_7B 0,1,2,3
# greedy sampling of SDSAT-13B on GPU 0,1,2,3
bash start_greedy.sh ainergy/CodeLlama-SDSAT_L7_13B 0,1,2,3
# nucleus sampling of SDSAT-7B with temperature 0.2 on GPU 0,1,2,3
bash start_nucleus.sh ainergy/CodeLlama-SDSAT_L5_7B 0,1,2,3 0.2
# nucleus sampling of SDSAT-7B with temperature 1.0 on GPU 0,1,2,3
bash start_nucleus.sh ainergy/CodeLlama-SDSAT_L5_7B 0,1,2,3 1.0
The speed test results will be stored in ./results, go check it
@misc{liu2024sdsat,
title={SDSAT: Accelerating LLM Inference through Speculative Decoding with Semantic Adaptive Tokens},
author={Chengbo Liu and Yong Zhu},
year={2024},
eprint={2403.18647},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
8 commits
Python
98.5%
Shell
1.5%
The official implementation of "SDSAT: Accelerating LLM Inference through Speculative Decoding with Semantic Adaptive Tokens" Including the decoding method of both greedy search and nucleus sampling.
📖 paper
SDSAT is an acceleration scheme for large language models (LLMs) through Speculative Decoding with Semantic Adaptive Tokens (SDSAT). The primary objective of this design is to enhance the LLM model’s ability to generate draft tokens more accurately without compromising the model’s accuracy. The core strategies involve:
conda create -n sdsat python=3.10
conda activate sdsat
pip install -r requirements.txt
Execute the following code for speed testing.
# greedy sampling of SDSAT-7B on GPU 0,1,2,3
bash start_greedy.sh ainergy/CodeLlama-SDSAT_L5_7B 0,1,2,3
# greedy sampling of SDSAT-13B on GPU 0,1,2,3
bash start_greedy.sh ainergy/CodeLlama-SDSAT_L7_13B 0,1,2,3
# nucleus sampling of SDSAT-7B with temperature 0.2 on GPU 0,1,2,3
bash start_nucleus.sh ainergy/CodeLlama-SDSAT_L5_7B 0,1,2,3 0.2
# nucleus sampling of SDSAT-7B with temperature 1.0 on GPU 0,1,2,3
bash start_nucleus.sh ainergy/CodeLlama-SDSAT_L5_7B 0,1,2,3 1.0
The speed test results will be stored in ./results, go check it
@misc{liu2024sdsat,
title={SDSAT: Accelerating LLM Inference through Speculative Decoding with Semantic Adaptive Tokens},
author={Chengbo Liu and Yong Zhu},
year={2024},
eprint={2403.18647},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
8 commits
Python
98.5%
Shell
1.5%