[UX] Reject incompatible nested runtime overrides (#49247)

Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Taneem Ibrahim
2026-07-24 07:16:22 -07:00
committed by GitHub
co-authored by mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 8eac21a602
commit 7b40fb9645
4 changed files with 56 additions and 23 deletions
+6 -4
View File
@@ -5273,10 +5273,12 @@ class GPUModelRunner(
def update_config(self, overrides: dict[str, Any]) -> None:
allowed_config_names = {"load_config", "model_config"}
for config_name, config_overrides in overrides.items():
assert config_name in allowed_config_names, (
f"Config `{config_name}` not supported. "
f"Allowed configs: {allowed_config_names}"
)
if config_name not in allowed_config_names:
allowed = ", ".join(sorted(allowed_config_names))
raise ValueError(
f"Config override '{config_name}' is not supported. "
f"Supported configs: {allowed}"
)
config = getattr(self, config_name)
new_config = update_config(config, config_overrides)
setattr(self, config_name, new_config)