Skip to content
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

[Random op]optimize CUDA implementation of randperm OP #40464

Merged
merged 1 commit into from
Mar 15, 2022

Conversation

zhwesky2010
Copy link
Contributor

@zhwesky2010 zhwesky2010 commented Mar 11, 2022

PR types

Function optimization

PR changes

OPs

Describe

优化随机算子之随机排列(paddle.randperm) 的CUDA随机数生成方式,原实现为 将CPU拷贝到GPU,新的实现为使用cub库cub::DeviceRadixSort::SortPairs 来实现,对OP性能有大幅提升。参考 #38611

另外,当前默认状态暂时通过 FLAGS_use_curand=OFF 关闭,以避免随机数值变换的风险。

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@jeff41404 jeff41404 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@chenwhql chenwhql left a comment

Choose a reason for hiding this comment

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

LGTM for HostAlloc

@zhwesky2010 zhwesky2010 merged commit 813f61d into PaddlePaddle:develop Mar 15, 2022
@zhwesky2010 zhwesky2010 changed the title change CUDA implementation of randperm OP [Random op]change CUDA implementation of randperm OP Apr 2, 2022
@zhwesky2010 zhwesky2010 changed the title [Random op]change CUDA implementation of randperm OP [Random op] optimize CUDA implementation of randperm OP Apr 2, 2022
@zhwesky2010 zhwesky2010 changed the title [Random op] optimize CUDA implementation of randperm OP [Random op]optimize CUDA implementation of randperm OP Apr 2, 2022
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.

3 participants