[Feature] Warn about unrecognized environment variables (#33581)

Signed-off-by: Gregory Shtrasberg <Gregory.Shtrasberg@amd.com>
This commit is contained in:
Gregory Shtrasberg
2026-02-10 15:45:38 -06:00
committed by GitHub
parent 578977bb5e
commit f0ca0671c7
3 changed files with 45 additions and 0 deletions
+12
View File
@@ -593,6 +593,8 @@ class EngineArgs:
"weight_transfer_config",
)
fail_on_environ_validation: bool = False
def __post_init__(self):
# support `EngineArgs(compilation_config={...})`
# without having to manually construct a
@@ -1239,6 +1241,14 @@ class EngineArgs:
help="Log aggregate rather than per-engine statistics "
"when using data parallelism.",
)
parser.add_argument(
"--fail-on-environ-validation",
help="If set, the engine will raise an error if "
"environment validation fails.",
default=False,
action=argparse.BooleanOptionalAction,
)
return parser
@classmethod
@@ -1396,6 +1406,8 @@ class EngineArgs:
device_config = DeviceConfig(device=cast(Device, current_platform.device_type))
envs.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
# Skip speculator detection for cloud storage models (eg: S3, GCS) since