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
3 changes: 2 additions & 1 deletion tests/distributed/test_torchrun_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
tensor_parallel_size=2,
distributed_executor_backend="external_launcher",
gpu_memory_utilization=random.uniform(0.7, 0.9),
swap_space=random.randint(1, 4))
swap_space=random.randint(1, 4),
seed=0)

outputs = llm.generate(prompts, sampling_params)

Expand Down
3 changes: 2 additions & 1 deletion tests/entrypoints/llm/test_encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def llm():
max_num_batched_tokens=32768,
tensor_parallel_size=1,
gpu_memory_utilization=0.75,
enforce_eager=True)
enforce_eager=True,
seed=0)

with llm.deprecate_legacy_api():
yield weakref.proxy(llm)
Expand Down
2 changes: 1 addition & 1 deletion tests/entrypoints/llm/test_guided_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
def llm():
# pytest caches the fixture so we use weakref.proxy to
# enable garbage collection
llm = LLM(model=MODEL_NAME, max_model_len=1024)
llm = LLM(model=MODEL_NAME, max_model_len=1024, seed=0)

with llm.deprecate_legacy_api():
yield weakref.proxy(llm)
Expand Down
2 changes: 2 additions & 0 deletions tests/entrypoints/openai/test_chat_echo.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def server():
"4080",
"--chat-template",
DUMMY_CHAT_TEMPLATE,
"--seed",
"0",
]

with RemoteOpenAIServer(MODEL_NAME, args) as remote_server:
Expand Down
2 changes: 2 additions & 0 deletions tests/entrypoints/openai/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def default_server_args():
"--enforce-eager",
"--max-num-seqs",
"128",
"--seed",
"0",
]


Expand Down
2 changes: 2 additions & 0 deletions tests/entrypoints/openai/test_root_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def server():
"/" + ROOT_PATH,
"--chat-template",
DUMMY_CHAT_TEMPLATE,
"--seed",
"0",
]
envs = os.environ.copy()

Expand Down
2 changes: 1 addition & 1 deletion vllm/engine/arg_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class EngineArgs:
config_format: ConfigFormat = ConfigFormat.AUTO
dtype: str = 'auto'
kv_cache_dtype: str = 'auto'
seed: int = 0
seed: Optional[int] = None
max_model_len: Optional[int] = None
# Note: Specifying a custom executor backend by passing a class
# is intended for expert use only. The API may change without
Expand Down
2 changes: 1 addition & 1 deletion vllm/entrypoints/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def __init__(
quantization: Optional[str] = None,
revision: Optional[str] = None,
tokenizer_revision: Optional[str] = None,
seed: int = 0,
seed: Optional[int] = None,
gpu_memory_utilization: float = 0.9,
swap_space: float = 4,
cpu_offload_gb: float = 0,
Expand Down
4 changes: 2 additions & 2 deletions vllm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ def create_kv_caches_with_random_flash(
head_size: int,
cache_dtype: Optional[Union[str, torch.dtype]],
model_dtype: Optional[Union[str, torch.dtype]] = None,
seed: int = 0,
seed: Optional[int] = None,
device: Optional[str] = "cuda",
) -> tuple[list[torch.Tensor], list[torch.Tensor]]:
from vllm.platforms import current_platform
Expand Down Expand Up @@ -681,7 +681,7 @@ def create_kv_caches_with_random(
head_size: int,
cache_dtype: Optional[Union[str, torch.dtype]],
model_dtype: Optional[Union[str, torch.dtype]] = None,
seed: int = 0,
seed: Optional[int] = None,
device: Optional[str] = "cuda",
) -> tuple[list[torch.Tensor], list[torch.Tensor]]:

Expand Down