Fix lora requests when dp with vllm #2433
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Following some investigation, I believe there is a fix to be made inside the
VLLM
class's_model_generate()
method. I stumbled across an inconsistency when trying to evaluate some LoRA adapters with vLLM as the backend inlm_eval
, see this issue as a reference.Specifically, there the evaluation results were exactly the same (greedy decoding) for a trained LoRA adapter and its base model. When we merged the adapter into the model, we got quite different results. After snooping a bit around I believe the issue has to do with how requests are sent to the vLLM model at test time, when we set
data_parallel_size>1
andlora_request
the prior behavior would have issued regular base model requests, without using the adapter.This PR provides a solution for that issue, and routes requests through the LoRA adapter even when using data parallelism.