-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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] [Speculative decoding] Support draft model on different tensor-parallel size than target model #4933
base: main
Are you sure you want to change the base?
[Performance] [Speculative decoding] Support draft model on different tensor-parallel size than target model #4933
Conversation
Thanks! Ping when when this PR is ready! |
Great! I'm looking forward to this feature :) |
Not very familiar with distributed training and inference, so I spent some time reading the code base. @cadedaniel, I got two questions about the expected behavior. First question. For the proposal model, does its TP_size also need to conform Second question. If we do need to perform distributed inference of the draft model, since there are two models (scoring and proposal) now, that means the function
|
Let's leave out the PP case for now. In the future we can add more configurations that benefit PP latency. You can assume PP size is always 1.
Good question.. in my internal fork we had an ability to skip initialization the second time. See def init_model(self):
"""Initialize the model on all ranks.
This also creates a single-rank process group containing only the
self process.
"""
world_rank = torch.distributed.get_rank()
self._single_tp_group = torch.distributed.new_group([world_rank])
with patch_tensor_parallel_group(self._single_tp_group):
self._worker.init_model(should_init_distributed_env=False) Then in the spec decode worker we initialize the larger model first. vllm/vllm/spec_decode/spec_decode_worker.py Lines 160 to 163 in cafb8e0
|
FIX #4632