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] layer norm called multiple times with same parameters #14

Open
erlebach opened this issue Oct 12, 2024 · 2 comments
Open

[BUG] layer norm called multiple times with same parameters #14

erlebach opened this issue Oct 12, 2024 · 2 comments
Assignees
Labels
bug Something isn't working no-issue-activity

Comments

@erlebach
Copy link

erlebach commented Oct 12, 2024

In the module: MambaTransformer/mamba_transformer, you execute the following in class MambaTransformerblock:

       # Layernorm
        self.norm = nn.LayerNorm(dim)

    def forward(self, x: Tensor) -> Tensor:
        for mamba, attn, ffn in zip(
            self.mamba_blocks,
            self.transformer_blocks,
            self.ffn_blocks,
        ):
            x = self.norm(x)
            x = mamba(x) + x
            x = self.norm(x)
            x = attn(x) + x
            x = self.norm(x)
            x = ffn(x) + x

        return x

Since the layerNorm has trainable parameter, you appear to be calling three layer norms in the forward function with tied parameters. Is that what you really want?

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@erlebach erlebach added the bug Something isn't working label Oct 12, 2024
Copy link

Hello there, thank you for opening an Issue ! 🙏🏻 The team was notified and they will get back to you asap.

Copy link

Stale issue message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working no-issue-activity
Projects
None yet
Development

No branches or pull requests

2 participants