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 Report] Global and Local Attn layer order of Gemma2 is wrong? #778

Open
huangxt39 opened this issue Nov 9, 2024 · 0 comments
Open
Labels
complexity-moderate Moderately complicated issues for people who have intermediate experience with the code implementation-inaccuracy Any issues related to our implementation being off from the official version

Comments

@huangxt39
Copy link

huangxt39 commented Nov 9, 2024

Describe the bug
In huggingface's implementation, the attention layers of Gemma2-2b are [local, global, local, ...]. However, the configuration of Gemma2-2b in transformer_lens is [global, local, global, ...]

Code example

from transformer_lens import HookedTransformer
model = HookedTransformer.from_pretrained("google/gemma-2-2b")
print(model.cfg)

On the other side, you can check the huggingface code here
https://github.com/huggingface/transformers/blob/a06a0d12636756352494b99b5b264ac9955bc735/src/transformers/models/gemma2/modeling_gemma2.py#L505

Additional context
I'm using transformer_lens-2.8.1

Checklist

  • [√] I have checked that there is no similar issue in the repo (required)
@bryce13950 bryce13950 added complexity-moderate Moderately complicated issues for people who have intermediate experience with the code implementation-inaccuracy Any issues related to our implementation being off from the official version labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity-moderate Moderately complicated issues for people who have intermediate experience with the code implementation-inaccuracy Any issues related to our implementation being off from the official version
Projects
None yet
Development

No branches or pull requests

2 participants