diff --git a/torchtitan/config/configs.py b/torchtitan/config/configs.py index 90c38afeaa..3f338fe217 100644 --- a/torchtitan/config/configs.py +++ b/torchtitan/config/configs.py @@ -60,6 +60,8 @@ def __post_init__(self) -> None: raise ValueError("num_tokens_per_train_step must be -1 or greater than 0.") if self.max_context_length <= 0: raise ValueError("max_context_length must be greater than 0.") + if self.max_norm < 0: + raise ValueError("max_norm must be greater than or equal to 0.") max_norm: float | int = 1.0 """Max norm for gradient clipping"""