Skip to content

Commit

Permalink
Pass in warmup_steps and alpha_f.
Browse files Browse the repository at this point in the history
  • Loading branch information
dwadden committed Aug 7, 2024
1 parent 00f20a0 commit 1cf3040
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions olmo/optim.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,10 +1007,12 @@ def build_scheduler(cfg: TrainConfig, sched_cfg: Optional[SchedulerConfig] = Non
)
elif sched_cfg.name == SchedulerType.cosine_linear_envelope:
return CosLinearEnvelope(
grad_clip_warmup_steps=None
if sched_cfg.grad_clip_warmup_steps is None
else int(sched_cfg.grad_clip_warmup_steps),
grad_clip_warmup_steps=(
None if sched_cfg.grad_clip_warmup_steps is None else int(sched_cfg.grad_clip_warmup_steps)
),
grad_clip_warmup_factor=sched_cfg.grad_clip_warmup_factor,
warmup_steps=int(sched_cfg.t_warmup),
alpha_f=sched_cfg.alpha_f,
t_max=None if sched_cfg.t_max is None else int(sched_cfg.t_max),
warmup_min_lr=sched_cfg.warmup_min_lr,
)
Expand Down

0 comments on commit 1cf3040

Please sign in to comment.