Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] fix xavier uniform init for output layers #814

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hjlee1371
Copy link

In TransformerConfig, initializations for the output layers should be specified as output_layer_init_method.

output_layer_init_method: Callable = None
"""Method to initialize weights of the output layer of both attention and MLP blocks. If None,
will be set to megatron.core.utils.scaled_init_method_normal(init_method_std) which is torch nn
init normal with mean=0.0 and std=init_method_std / math.sqrt(2.0 * num_layers)."""

But Xavier uniform initialization with --init-method-xavier-uniform utilizes scaled_init_method instead. This PR addresses the bugs encountered when utilizing Xavier uniform initialization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant