Skip to content

Commit

Permalink
more cli arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangir-azerbayev committed Nov 20, 2023
1 parent d87e4a3 commit ede55f4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion megatron/neox_arguments/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ def consume_deepy_args(cls):
"--warmup_iters",
type=int,
)
group.add_argument(
"--lr",
type=float,
)
group.add_argument(
"--min_lr",
type=float,
)
group.add_argument(
"--lr_decay_iters",
type=int,
Expand Down Expand Up @@ -1031,10 +1039,12 @@ def calculate_derived(self):
self.update_values(
{
"optimizer_type": opt_params.get("type", OPT_DEFAULT),
"lr": opt_params["params"].get("lr", OPT_PARAMS_DEFAULTS["lr"]),
}
)

if not self.lr:
self.update_values({"lr": opt_params["params"].get("lr", OPT_PARAMS_DEFAULTS["lr"])})

if self.optimizer_type.lower() == "onebitadam":
# onebitadam needs to instantiated by deepspeed, and so we need to pass deepspeed scheduler args
# for all other optimizers, the scheduling is handled by megatron
Expand Down

0 comments on commit ede55f4

Please sign in to comment.