We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following is your implementation of the MsPoELlamaRotaryEmbedding:
def forward(self, x, seq_len=None): # x: [bs, num_attention_heads, seq_len, head_size] if seq_len > self.max_seq_len_cached: self._set_cos_sin_cache(seq_len=seq_len, device=x.device, dtype=x.dtype) return ( self.cos_cached[:,:seq_len].to(dtype=x.dtype), self.sin_cached[:,:seq_len].to(dtype=x.dtype), )
However due to the x`s shape of the [bs, num_attention_heads, seq_len, head_size], does the right implementation is:
def forward(self, x, seq_len=None): # x: [bs, num_attention_heads, seq_len, head_size] if seq_len > self.max_seq_len_cached: self._set_cos_sin_cache(seq_len=seq_len, device=x.device, dtype=x.dtype) return ( self.cos_cached[:, :, :seq_len, ...].to(dtype=x.dtype), self.sin_cached[:, :, :seq_len, ...].to(dtype=x.dtype), )
, which is also align with the original implementation of the Rope Embedding of LLama.
The text was updated successfully, but these errors were encountered:
if the batch_size=1,it is ok !
Sorry, something went wrong.
No branches or pull requests
The following is your implementation of the MsPoELlamaRotaryEmbedding:
However due to the x`s shape of the [bs, num_attention_heads, seq_len, head_size], does the right implementation is:
,
which is also align with the original implementation of the Rope Embedding of LLama.
The text was updated successfully, but these errors were encountered: