Skip to content

Conversation

@YqGe585
Copy link
Member

@YqGe585 YqGe585 commented Nov 27, 2025

Fix top_p_sampling kernel

@paddle-bot
Copy link

paddle-bot bot commented Nov 27, 2025

Thanks for your contribution!

Copilot AI review requested due to automatic review settings December 2, 2025 02:53
Copilot finished reviewing on behalf of YqGe585 December 2, 2025 02:56
Copy link

Copilot AI left a 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 seed parameter from int to int64_t in two backend implementations
  • Ensures compatibility with internal usage where seed is converted to uint64_t for 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.

Copy link
Collaborator

@yongqiangma yongqiangma left a comment

Choose a reason for hiding this comment

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

LGTM

@YqGe585 YqGe585 merged commit d5172d9 into PaddlePaddle:develop Dec 3, 2025
28 of 29 checks passed
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

Successfully merging this pull request may close these issues.

5 participants