Skip to content

Omit Normalization Layer from MLP Class #1852

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

Closed

Conversation

ChristophReich1996
Copy link
Contributor

This pull request fixes issue #1851. The unused normalization layer is omitted from the Mlp class. Usage of the norm_layer argument is also omitted. Both BEiT(-v2) and EVA(-02) models are not affected by this change. EVA(-02) uses the norm_layer argument but since all configurations are using the SwiGLU instead if Mlp existing model weights are not affected. BEiT(-v2) sets in all configurations scale_mlp=False, meaning norm_layer was set to None, thus, also no affect here on existing models/weights.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@rwightman
Copy link
Collaborator

@ChristophReich1996 my bad on communication, I was assuming this'd go the other way, call the .norm() in forward() in case it's set, as this is a modification as per NormFormer https://arxiv.org/abs/2110.09456 ... as you noted it's only used in combo with the swiglu right now, but can be used in a non-gated MLP too

@rwightman rwightman closed this in 76d1669 Aug 3, 2023
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.

3 participants