[Model] vllm v1 support mlp_speculator#21276
[Model] vllm v1 support mlp_speculator#21276skylee-01 wants to merge 8 commits intovllm-project:mainfrom
Conversation
Signed-off-by: skylee-01 <497627264@qq.com>
Signed-off-by: skylee-01 <497627264@qq.com>
Signed-off-by: skylee-01 <497627264@qq.com>
Signed-off-by: skylee-01 <497627264@qq.com>
Signed-off-by: skylee-01 <497627264@qq.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 🚀 |
There was a problem hiding this comment.
Code Review
This pull request adds support for the mlp_speculator speculative decoding method in vLLM's v1 architecture. The changes include a new proposer implementation for v1, modifications to the core MLPSpeculator model to support being used as a draft model, and integration into the GPUModelRunner. My review has identified several critical issues in the new implementation related to incorrect logic for processing proposal tokens, a crash in the dummy_run due to a missing argument, and flawed logic in the modified MLPSpeculator model. These issues need to be addressed to ensure correctness and prevent runtime errors.
|
The content is updated to the new PR, and the old PR is discarded. |
Signed-off-by: skylee-01 <497627264@qq.com>
|
Use the following script to test: # -*- coding: utf-8 -*-
import sys
import os
os.environ["VLLM_USE_V1"] = "1"
custom_vllm_path = '/path/to/your/vllm'
if custom_vllm_path not in sys.path:
sys.path.insert(0, custom_vllm_path)
from vllm import LLM, SamplingParams
prompts = [
"1+1= ",
]
sampling_params = SamplingParams(temperature=0, max_tokens=20)
model = "/path/to/your/model/Meta-Llama-3.1-8B-Instruct" # Please replace with your model path
llm = LLM(
model=model,
enforce_eager=True,
max_model_len=3000,
gpu_memory_utilization=0.9,
tensor_parallel_size=1,
speculative_config={
"method": "mlp_speculator",
"model": "/path/to/your/speculative/model/llama3-8b-accelerator/", # Please replace with your speculative model path
"draft_tensor_parallel_size": 1,
"num_speculative_tokens": 2,
},
)
import time
t1 = time.time()
for i in range(100):
print("************************************************")
outputs = llm.generate(prompts, sampling_params)
for output in outputs:
answer = output.outputs[0].text
print(f"answer:{answer}")
print("time:", time.time() - t1) |
|
I've increased the tests and updated the code to the latest vllm version. |
|
Thanks for reviewing the code, teacher. @WoosukKwon |
|
This pull request has been automatically marked as stale because it has not had any activity within 90 days. It will be automatically closed if no further activity occurs within 30 days. Leave a comment if you feel this pull request should remain open. Thank you! |
|
This pull request has been automatically closed due to inactivity. Please feel free to reopen if you intend to continue working on it. Thank you! |
There was a problem hiding this comment.
Can you rebase this PR? I can help you merge it if the tests pass.
Sorry for the delay, seems @WoosukKwon is too busy these days.
|
We may want to check whether this is still relevant first. I'm unsure whether MLPSpeculator models are still used. |
Of course, I would be very happy to do this job if needed. |
|
This pull request has merge conflicts that must be resolved before it can be |
|
This pull request has been automatically marked as stale because it has not had any activity within 90 days. It will be automatically closed if no further activity occurs within 30 days. Leave a comment if you feel this pull request should remain open. Thank you! |
|
The lack of interest suggests that we should close this PR and potentially remove |
|
Yeah sure |
|
This pull request has merge conflicts that must be resolved before it can be |
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.Purpose
vllm v1 support mlp_speculator
Test Plan
Test Result
(Optional) Documentation Update