Skip to content

Commit 2489551

Browse files
Fix DP>1 & TP>1 evals with vllm (#841)
* fix vllm evals using dp>1 and tp>1 * Update vllm dependency version to 0.8.5.post1 in pyproject.toml * should fix case --------- Co-authored-by: Clémentine Fourrier <[email protected]>
1 parent 99bfd9f commit 2489551

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ nanotron = [
9494
"tensorboardX"
9595
]
9696
tensorboardX = ["tensorboardX"]
97-
vllm = ["vllm>=0.8.4", "ray", "more_itertools"]
97+
vllm = ["vllm>=0.8.5.post1", "ray", "more_itertools"]
9898
quality = ["ruff>=v0.11.0","pre-commit"]
9999
tests = ["pytest>=7.4.0","deepdiff"]
100100
dev = ["lighteval[accelerate,quality,tests,multilingual,math,extended_tasks,vllm]"]

src/lighteval/models/vllm/vllm_model.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -399,14 +399,8 @@ def _generate(
399399
sampling_params.detokenize = False
400400

401401
if self.data_parallel_size > 1:
402-
# vLLM hangs if tensor_parallel > 1 and resources are set in ray.remote
403-
# also seems to only work with decorator and not with ray.remote() fn
404-
# see https://github.com/vllm-project/vllm/issues/973
405-
# note: this has changed on 0.3.3, and it only works now if num_gpus are set.
406-
# but then tensor_parallel breaks
407-
# Hynek: With the newest vllm, it actually breaks when tensor_parallel_size == 1 and num_gpus not set,
408-
# as VLLM complains about no GPUs available.
409-
@ray.remote(num_gpus=1 if self.tensor_parallel_size == 1 else None)
402+
403+
@ray.remote(num_gpus=self.tensor_parallel_size)
410404
def run_inference_one_model(model_args: dict, sampling_params: SamplingParams, requests):
411405
llm = LLM(**model_args)
412406
return llm.generate(prompt_token_ids=requests, sampling_params=sampling_params)

0 commit comments

Comments
 (0)