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

Fix bug in index_put kernel when fallbacking to cpu #61842

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

Tongkaio
Copy link
Member

PR types

Bug fixes

PR changes

Others

Description

修复IndexPutKernel的bug:当其他设备如npu调用index_put_时,因为index_put_是原地修改,所以输入x和out会指向同一个地址,当npu检查到缺少index_put_算子而fallback到cpu时,此时输入x被copy到cpu,而输出out仍留在npu,IndexPutKerne中并未对这种情况进行判断,导致out的数据并未被拷贝过来。于是加上判断并将数据拷贝到cpu,问题修复。

Copy link

paddle-bot bot commented Feb 20, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@YanhuiDua YanhuiDua left a comment

Choose a reason for hiding this comment

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

LGTM

@YanhuiDua YanhuiDua merged commit e1c7b56 into PaddlePaddle:develop Feb 21, 2024
30 checks passed
@Tongkaio Tongkaio deleted the fix_index_put branch April 1, 2024 05:26
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.

2 participants