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

question for Rotary class #22

Open
shao-shuai opened this issue Mar 6, 2025 · 0 comments
Open

question for Rotary class #22

shao-shuai opened this issue Mar 6, 2025 · 0 comments

Comments

@shao-shuai
Copy link

Hi, studying the code right now and got a question for Rotary class.

After q = q.view(B, T, self.config.n_head, C // self.config.n_head).transpose(1, 2), the shape of q is [batch_size, n_heads, seq_length, head_dim].

When applying rotary positional encoding on q, we are extracting seq_len with seq_len = q.shape[1], but now q.shape[1] should be n_heads not seq_length right? Shouldn't we do seq_len = q.shape[2] instead? Let me know if my understanding is wrong.

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

No branches or pull requests

1 participant