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 vllm/engine/arg_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2051,7 +2051,7 @@ def create_engine_config(

device_config = DeviceConfig(device=cast(Device, current_platform.device_type))

envs.validate_environ(self.fail_on_environ_validation)
current_platform.validate_environ(self.fail_on_environ_validation)

# Check if the model is a speculator and override model/tokenizer/config
# BEFORE creating ModelConfig, so the config is created with the target model
Expand Down
9 changes: 0 additions & 9 deletions vllm/envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2249,15 +2249,6 @@ def is_set(name: str):
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")


def validate_environ(hard_fail: bool) -> None:
for env in os.environ:
if env.startswith("VLLM_") and env not in environment_variables:
if hard_fail:
raise ValueError(f"Unknown vLLM environment variable detected: {env}")
else:
logger.warning("Unknown vLLM environment variable detected: %s", env)


def compile_factors() -> dict[str, object]:
"""Return env vars used for torch.compile cache keys.

Expand Down
18 changes: 18 additions & 0 deletions vllm/platforms/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,24 @@ def is_arch_support_pdl(cls) -> bool:
"""
return False

@classmethod
def validate_environ(cls, hard_fail: bool) -> None:
"""
Validate environment variables for the current platform.
"""
from vllm import envs

for env in os.environ:
if env.startswith("VLLM_") and env not in envs.environment_variables:
if hard_fail:
raise ValueError(
f"Unknown vLLM environment variable detected: {env}"
)
else:
logger.warning(
"Unknown vLLM environment variable detected: %s", env
)


class UnspecifiedPlatform(Platform):
_enum = PlatformEnum.UNSPECIFIED
Expand Down
Loading