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

Use latest apex internal API #8129

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def reset_parameters(self):
torch.nn.init.zeros_(self.bias)

def forward(self, x):
return _fast_layer_norm(x, self.weight + 1, self.bias, self.epsilon)
return _fast_layer_norm(x, self.weight + 1, self.bias, self.epsilon, memory_efficient=False)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this hardcoded to False? Instead it can be run by just passing self.memory_efficient as a parameter right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIU memory_efficient=False is the previous implementation of _fast_layer_norm. As non memory efficient implementation has been tested I left it like this.
We can make it switchable but I think it would be beneficial to test it first. What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, we can keep it as it is



else:
Expand Down
Loading