-
Notifications
You must be signed in to change notification settings - Fork 661
【Hackathon 9th No.46】add test_fused_rotary_position_encoding #3848
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
Conversation
|
Thanks for your contribution! |
|
@yuanlehome pls review |
| query_np, key_np, position_ids_np, cos_sin_cache_np, head_size, is_neox=False | ||
| ) | ||
|
|
||
| self.assertEqual(query_out.shape, query_np.shape) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么这里只assert了shape
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, Thx.
| cos_np = np.random.rand(num_tokens, half_dim).astype("float32") | ||
| sin_np = np.random.rand(num_tokens, half_dim).astype("float32") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要使用真实的公示计算得出,不可以使用随机数,其他位置也一样,只能是input是随机数
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, Thx.
yuanlehome
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
add test_fused_rotary_position_encoding
source code: fused_rotary_position_encoding