Mcore optimizer configuration extending base OptimizerConfig. Args: optimizer (str): Optimizer name; default is "adam". lr (float): Learning rate. clip_grad (float): Gradient clipping norm. lr_warmup_init (float): Initial learning rate for warmup; defaults to 0.0
| 115 | |
| 116 | @dataclass |
| 117 | class McoreOptimizerConfig(OptimizerConfig): |
| 118 | """Mcore optimizer configuration extending base OptimizerConfig. |
| 119 | |
| 120 | Args: |
| 121 | optimizer (str): Optimizer name; default is "adam". |
| 122 | lr (float): Learning rate. |
| 123 | clip_grad (float): Gradient clipping norm. |
| 124 | lr_warmup_init (float): Initial learning rate for warmup; defaults to 0.0. |
| 125 | lr_decay_steps (Optional[int]): Number of decay steps. |
| 126 | lr_decay_style (str): LR decay style: "constant", "linear", "cosine", or "inverse_square_root". |
| 127 | min_lr (float): Minimum learning rate. |
| 128 | weight_decay_incr_style (str): Weight decay increment style: "constant" or "cosine". |
| 129 | lr_wsd_decay_style (str): Weight-standard-deviation decay style: "constant", "exponential", or "cosine". |
| 130 | lr_wsd_decay_steps (Optional[int]): Number of steps for weight-standard-deviation decay. |
| 131 | use_checkpoint_opt_param_scheduler (bool): Whether to use checkpoint optimizer parameter scheduler. |
| 132 | """ |
| 133 | |
| 134 | optimizer: str = "adam" |
| 135 | lr_warmup_init: float = 0.0 |
| 136 | lr_decay_steps: Optional[int] = None |
| 137 | lr_decay_style: str = "linear" |
| 138 | min_lr: float = 0.0 |
| 139 | weight_decay_incr_style: str = "constant" |
| 140 | lr_wsd_decay_style: str = "exponential" |
| 141 | lr_wsd_decay_steps: Optional[int] = None |
| 142 | use_checkpoint_opt_param_scheduler: bool = False |
| 143 | override_optimizer_config: Optional[dict] = None |
| 144 | |
| 145 | |
| 146 | def build_optimizer(parameters, config: FSDPOptimizerConfig): |
no outgoing calls