Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lighteval/main_vllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def vllm(
job_id=job_id,
dataset_loading_processes=dataset_loading_processes,
custom_tasks_directory=custom_tasks,
override_batch_size=-1, # Cannot override batch size when using VLLM
override_batch_size=-1, # Cannot override batch size when using vLLM; Configure `max_num_seqs` and `max_num_batched_tokens` in `VLLMModelConfig` instead.
num_fewshot_seeds=num_fewshot_seeds,
max_samples=max_samples,
use_chat_template=use_chat_template,
Expand Down
4 changes: 4 additions & 0 deletions src/lighteval/models/vllm/vllm_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ class VLLMModelConfig:
)
pairwise_tokenization: bool = False # whether to tokenize the context and continuation separately or together.
generation_parameters: GenerationParameters = None # sampling parameters to use for generation
max_num_seqs: int = 128 # maximum number of sequences per iteration; This variable and `max_num_batched_tokens` effectively control the batch size at prefill stage. See https://github.com/vllm-project/vllm/issues/2492 for detailed explaination.
max_num_batched_tokens: int = 2048 # maximum number of tokens per batch

subfolder: Optional[str] = None

Expand Down Expand Up @@ -183,6 +185,8 @@ def _create_auto_model(self, config: VLLMModelConfig, env_config: EnvConfig) ->
"max_model_len": self._max_length,
"swap_space": 4,
"seed": config.seed,
"max_num_seqs": int(config.max_num_seqs),
"max_num_batched_tokens": int(config.max_num_batched_tokens),
}
if int(config.data_parallel_size) > 1:
self.model_args["distributed_executor_backend"] = "ray"
Expand Down