Skip to content

Commit

Permalink
fix gated_linear_unit config
Browse files Browse the repository at this point in the history
Signed-off-by: jiemingz <jiemingz@nvidia.com>
  • Loading branch information
jiemingz committed Jan 3, 2024
1 parent ae95cda commit be00d21
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ def build_transformer_config(self) -> TransformerConfig:
activation = self.cfg.get('activation', 'gelu')
# TODO: need to check which activation functions are supported in mcore
activation_func = activation_to_func(activation)
gated_linear_unit = activation.endswith('glu')

normalization = self.cfg.get('normalization', 'LayerNorm')

Expand Down Expand Up @@ -396,7 +397,7 @@ def build_transformer_config(self) -> TransformerConfig:
'apply_residual_connection_post_layernorm': False, # we don't use this in NeMo
'layernorm_zero_centered_gamma': False,
'add_bias_linear': add_bias_linear,
'gated_linear_unit': False,
'gated_linear_unit': gated_linear_unit,
'activation_func': activation_func,
'normalization': normalization,
'init_method': init_method,
Expand Down

0 comments on commit be00d21

Please sign in to comment.