Skip to content

Commit f182460

Browse files
authored
fix: make layernorm_epsilon configurable in with megatron backend (#1046)
Signed-off-by: ashors1 <[email protected]>
1 parent 4821ef8 commit f182460

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

nemo_rl/models/policy/megatron_policy_worker.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,9 @@ def __init__(
561561
"moe_router_bias_update_rate"
562562
]
563563

564+
if "layernorm_epsilon" in self.cfg["megatron_cfg"]:
565+
model_cfg.layernorm_epsilon = self.cfg["megatron_cfg"]["layernorm_epsilon"]
566+
564567
model_cfg.sequence_parallel = self.cfg["megatron_cfg"]["sequence_parallel"]
565568
model_cfg.bf16 = self.dtype == torch.bfloat16
566569
model_cfg.fp16 = self.dtype == torch.float16

0 commit comments

Comments
 (0)