Skip to content

Commit 2429e0b

Browse files
authored
Compute validation metrics at first step (#1508)
Currently, the first time validation metrics are computed is when `step == job_config.validation.freq`. I think it is preferable to always compute them for the first step as well.
1 parent a0fdaa3 commit 2429e0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchtitan/components/validate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def validate(self, model_parts: list[nn.Module]) -> dict[str, float]:
2828
raise NotImplementedError("validate method not implemented")
2929

3030
def should_validate(self, step: int) -> bool:
31-
return step % self.job_config.validation.freq == 0
31+
return step == 1 or step % self.job_config.validation.freq == 0
3232

3333

3434
class Validator(BaseValidator):

0 commit comments

Comments
 (0)