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

[CustomDevice]fix == error with place #55173

Merged
merged 1 commit into from
Jul 7, 2023

Conversation

engineer1109
Copy link
Contributor

PR types

Bug fixes

PR changes

Others

Description

#54606
我之前这个PR里提交的判断GetPlace() 是否为CustomDevice的代码存在问题

instr.DeviceContext().GetPlace() == phi::CustomPlace()

phi::Place == 的重载是比较HashCode的数值
自定义的Custom类型HashCode数值与默认的phi::CustomPlace() 不一样
这种比较方式是不正确的。

追加的修正方案

instr.DeviceContext().GetPlace().GetType() == phi::AllocationType::CUSTOM

才能正确判断GetPlace()是否为CustomDevice

@paddle-bot
Copy link

paddle-bot bot commented Jul 5, 2023

你的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.

@engineer1109
Copy link
Contributor Author

@ronny1996 CI跑完了。Coverage需要豁免

Copy link
Contributor

@ronny1996 ronny1996 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 70df3aa into PaddlePaddle:develop Jul 7, 2023
26 of 27 checks passed
cqulilujia pushed a commit to cqulilujia/Paddle that referenced this pull request Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants