Skip to content

Conversation

@Echo-Nie
Copy link
Contributor

@Echo-Nie Echo-Nie commented Sep 3, 2025

add test_fused_rotary_position_encoding

source code: fused_rotary_position_encoding

@paddle-bot
Copy link

paddle-bot bot commented Sep 3, 2025

Thanks for your contribution!

@Echo-Nie
Copy link
Contributor Author

@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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么这里只assert了shape

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, Thx.

Comment on lines 32 to 33
cos_np = np.random.rand(num_tokens, half_dim).astype("float32")
sin_np = np.random.rand(num_tokens, half_dim).astype("float32")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

要使用真实的公示计算得出,不可以使用随机数,其他位置也一样,只能是input是随机数

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, Thx.

@Echo-Nie Echo-Nie requested a review from yuanlehome September 17, 2025 13:37
Copy link
Collaborator

@yuanlehome yuanlehome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@luotao1 luotao1 merged commit cc6e14d into PaddlePaddle:develop Sep 19, 2025
15 of 17 checks passed
@Echo-Nie Echo-Nie deleted the 46hac branch October 17, 2025 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants