Skip to content

Commit 767bc29

Browse files
warn on unknown runopt passed via command-line
Differential Revision: D70562266 Pull Request resolved: #1013
1 parent a6cef12 commit 767bc29

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

torchx/specs/api.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@
6363
# (most recent call first):
6464
_EMBEDDED_ERROR_MESSAGE_RE: Pattern[str] = re.compile(r"(?P<msg>.+)\nException.*")
6565

66+
YELLOW_BOLD = "\033[1;33m"
67+
RESET = "\033[0m"
68+
6669

6770
# ========================================
6871
# ==== Distributed AppDef API =======
@@ -937,6 +940,10 @@ def _cast_to_type(value: str, opt_type: Type[CfgVal]) -> CfgVal:
937940
runopt_ = self.get(key)
938941
if runopt_:
939942
cfg[key] = _cast_to_type(val, runopt_.opt_type)
943+
else:
944+
logger.warning(
945+
f"{YELLOW_BOLD}Unknown run option passed to scheduler: {key}={val}{RESET}"
946+
)
940947
return cfg
941948

942949
def cfg_from_json_repr(self, json_repr: str) -> Dict[str, CfgVal]:

0 commit comments

Comments
 (0)