-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
[V1][Usage] Refactor speculative decoding configuration and tests #14434
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
[V1][Usage] Refactor speculative decoding configuration and tests #14434
Conversation
Signed-off-by: Shangming Cai <caishangming@linux.alibaba.com>
Signed-off-by: Shangming Cai <caishangming@linux.alibaba.com>
Signed-off-by: Shangming Cai <caishangming@linux.alibaba.com>
Signed-off-by: Shangming Cai <caishangming@linux.alibaba.com>
Signed-off-by: Shangming Cai <caishangming@linux.alibaba.com>
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 🚀 |
# TODO: The user should be able to specify revision/max model len | ||
# for the draft model. It is not currently supported. | ||
draft_revision = None | ||
draft_code_revision = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost forgot to mention that I made these two parameters configurable. If these parameters are unnecessary as configurable options, I will remove them.
I am also considering shortening |
Signed-off-by: Shangming Cai <caishangming@linux.alibaba.com>
This pull request has merge conflicts that must be resolved before it can be |
This pull request has merge conflicts that must be resolved before it can be |
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: Shangming Cai <caishangming@linux.alibaba.com>
self.use_spec_decode = True | ||
# TODO: find a better way to check if we are using ngram. | ||
assert self.speculative_config.ngram_prompt_lookup_min, \ | ||
assert self.speculative_config.method == "ngram", \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@comaniac BTW, I think this new param kinda helps us if we want to check the speculative method type sometimes.
Signed-off-by: Shangming Cai <caishangming@linux.alibaba.com>
@LiuXiaoxuanPKU I see the ready label and the CI tests, happy that this PR is near the complete state. Just checked the failed CIs, and it seems there are some huggingface connection timeouts. Hoping that retriggering these tests should fix it and I haven't missed something important :) |
…lm-project#14434) Signed-off-by: Shangming Cai <caishangming@linux.alibaba.com>
…lm-project#14434) Signed-off-by: Shangming Cai <caishangming@linux.alibaba.com> Signed-off-by: Wes Medford <wryanmedford@gmail.com>
…lm-project#14434) Signed-off-by: Shangming Cai <caishangming@linux.alibaba.com> Signed-off-by: Louis Ulmer <ulmerlouis@gmail.com>
…lm-project#14434) Signed-off-by: Shangming Cai <caishangming@linux.alibaba.com>
…lm-project#14434) Signed-off-by: Shangming Cai <caishangming@linux.alibaba.com>
…lm-project#14434) Signed-off-by: Shangming Cai <caishangming@linux.alibaba.com> Signed-off-by: Mu Huai <tianbowen.tbw@antgroup.com>
This PR refactors the speculative decoding configuration and tests according to the discussion in #13601.
Major changes:
--speculative-config
. After the next release, I will submit a PR to remove all stale speculative-related CLI args and do some cleanup.SpeculativeConfig
, includes Configurable parameters and Non-configurable internal parameters. Configurable parameters mainly consist of all previous cli args, and are categorized into 3 types:--speculative_config
, prefixes like "speculative_" have been omitted for brevity and clarity. Several overly lengthy advanced parameter names that are self-explanatory have not been shortened. Please let me know if I should revert some unpropely changes. Or if there are other parameter names that need to be streamlined, I can modify them as well.Things want to achieve but meet some difficulty:
CompilationConfig
, usingBaseModel
and thefrom_cli
method. However, the unique nature of the speculative config requires that certain internal parameters, such as thetarget_model_config
, be passed during its initialization. This dependency implies that the initialization of speculative config must occur only after certain parameters have been initialized within the engine, making the direct use of abstractions likeBaseModel
and initialization methods such asfrom_cli
infeasible.Let me know if I should make more changes to make it perfect. I have run all spec-decode related tests in dir vllm/tests/spec_decode locally, and both the original and refactored test codes pass successfully.
CC List: @LiuXiaoxuanPKU @comaniac @WoosukKwon