-
Notifications
You must be signed in to change notification settings - Fork 211
Fix top_p_sampling kernel #2231
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! |
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.
Pull request overview
This PR fixes the seed parameter type in TopPSamplingKernel implementations by changing it from int to int64_t. This improves type consistency and supports the full range of seed values, including the sentinel value -1 and larger positive seeds.
- Changed
seedparameter frominttoint64_tin two backend implementations - Ensures compatibility with internal usage where seed is converted to
uint64_tfor random number generation - Aligns with the expected interface for random seed parameters in sampling operations
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| backends/npu/kernels/fusion/topp_sampling_kernel.cc | Updated seed parameter type from int to int64_t in TopPSamplingKernel function signature |
| backends/iluvatar_gpu/kernels/ernie_core/top_p_sampling_kernel.cu | Updated seed parameter type from int to int64_t in TopPSamplingKernel function signature to match internal usage with uint64_t |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
[Metax] Fix DNN-related bugs (PaddlePaddle#194)
yongqiangma
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
Fix top_p_sampling kernel