-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Performance]: vllm Eagle performance is worse than expected #9565
Comments
@LiuXiaoxuanPKU Hi, what is the acceptance rate based on your tests? I trained a draft model of DeepSeek-v2, and the acceptance rate from testing is less than 20%. Maybe you should use meta-llama/Meta-Llama-3-70B-Instruct to match with the draft model. |
@LiuXiaoxuanPKU Thanks for sharing the interesting result :) |
The eagle model looks inconsistent with the implementation version of the paper. |
@LiuXiaoxuanPKU Thanks for sharing this interesting result; I’m very interested in it as well. However, can yuhuili/EAGLE-LLaMA3-Instruct-70B be directly used as a draft model? In my experiments, I found it necessary to convert the trained EAGLE checkpoint to a vLLM-compatible version, similar to the process described here: eagle.py. Additionally, when using meta-llama/Meta-Llama-3-8B-Instruct as the target model and the converted yuhuili/EAGLE-LLaMA3-Instruct-8B as the draft model, I observed that with num_speculative_tokens set to 3, the acceptance rate was only around 29.6%. |
Some preliminary acceptance rate on ShareGPT with llama3-70B with the help @OliviaMimiChen: I think the numbers are wired because:
We are in the process of We will keep you guys posted, any discussion/comments are appeciated! |
Maybe I am missing something but isn't this expected? Generally, a draft model's ability to predict tokens at later time steps becomes worse. So if a draft model is predicting 2 spec tokens, and it gets just the first token right, the acceptance rate will be 0.5 where as if a draft model is predicting 3 spec tokens, and it gets just the first token right, the acceptance rate will be 0.33
I believe this is mostly because bonus token is included in the calculation of system efficiency where as it is not included in acceptance rate. |
It might be a bit confusing. In vllm, the token acceptance rate also includes tokens after 'wrong prediction'. For example, if 1 means the token is accepted, 0 means the token is not accepted, and after proposing 4 tokens, we have an acceptance vector of [1, 0, 1, 0], the token acceptance rate is 2 / 4 = 0.5, the system efficiency is (1+1) / (4+1) = 0.4. For system efficiency, 1+1 means the accepted token + the bonus token, 4 + 1 is the maximum number of tokens that can be generated in this forward pass. |
I appreciate your insights, @LiuXiaoxuanPKU. However, in Eagle and most speculative decoding methods, the proposal process still follows an autoregressive pattern, where the prediction of each subsequent token depends on the information from the previously predicted token. From my understanding, if an earlier token is predicted incorrectly (deviating from the target model), it is highly likely that subsequent tokens will also be predicted incorrectly. With this in mind, it appears problematic to calculate the acceptance rate for each token position independently, regardless of the proposal length. Additionally, I am very interested in understanding the time overhead associated with Eagle’s proposal stage. Would you be able to share any relevant test data? In my own testing, this overhead has been substantial, and as I understand it, this cost cannot be hidden and significantly impacts the efficiency of speculative decoding. |
I observed 20% lower acceptance length numbers compared to the official EAGLE code using LLaMA3-Instruct 8B as base model and abhigoyal/EAGLE-LLaMA3-Instruct-8B-vllm as draft model. I noticed that the vLLM EAGLE model code has 2 key differences compared to the official EAGLE model code:
After fixing these two issues, the acceptance length of vLLM is now very close to the official EAGLE code. |
Are these fixes implemented in a commit? Or did you do these locally. |
Can you teach me how to use EAGLE on vLLM, there is no documention that can clearly tell zhe usage of EAGLE, i already convert the draft model to vLLM format, but vLLM still can't load the weights of draft model, too hard to use! |
Hi @xiongqisong can you add some more details on 1) how you converted weights 2) how you are trying to start the vllm server with the converted checkpoint 3) what is the error you are getting? |
I am facing the same issue when running the EAGLE model. |
Thanks for @llsj14 shared the detailed commands/error messages...I think we can discuss the usage of EAGLE on vLLM in #11126 together @LiuXiaoxuanPKU @sroy745 I will share the clue of my situation, thanks for help aging~ |
Hi @awsvmaringa, could you please give some advice on how to modify the source code? I did the 2 changes you mentioned and added last residual to the hidden states, the draft accept rate increases a bit, but still too low, and still far from that of the official EAGLE code. Thank you ;_; model: meta-llama3-8b, draft tokens = 5, greedy decoding, sharegpt dataset Edit:According to the article, this table is also tested without tree attention |
I tried the following three approaches based on comments from this issue and #11126 (comment), as well as by reviewing the implementation of the EAGLE framework. Thank you all for your feedback in helping tackle this issue.
Below are the experimental results from the above trials.
The result from the second step did not improve the acceptance rate (in fact, it slightly worsened the acceptance rate by 1-2%). As a result, I only included the first and third steps in PR. I added more experiment results with other datasets, model combinations, and different values for num_speculative_tokens (K) into the PR. |
Proposal to improve performance
The spec dec performance of Eagleis worse than expected as shown below:
Model: meta-llama/Meta-Llama-3.1-70B-Instruct
Draft model: yuhuili/EAGLE-LLaMA3-Instruct-70B
Hardware: 4xH100
Target model TP=4
Dataset: ShareGPT
vllm version: v0.6.1.post2
Even at low QPS, the performance is far from 2x speedup reported in the original eagle paper (light blue line is the original, the solid lines are with SD). We need to understand the performance gap here. Possible reasons include but not limited to
Profiling is required to understand the issue. Open this issue to track the progress.
Report of performance regression
No response
Misc discussion on performance
No response
Your current environment (if you think it is necessary)
Before submitting a new issue...
The text was updated successfully, but these errors were encountered: