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 for prepare phi OP #40033

Merged

Conversation

From00
Copy link
Contributor

@From00 From00 commented Mar 1, 2022

PR types

Bug fixes

PR changes

Others

Describe

PR #38979 adds some codes in prepared_operatoer.cc that reacquires a CPU DeviceContext from the DeviceContextPool when the expected_kernel_key.place_ is CPU place. This cannot handle all situations. When the expected_kernel_key.place_ is GPU place and the place parameter for PreparedImpl is CPU place, the DeviceContext also need to be reacquired, or a CPU DeviceContext will pass to a GPU kernel.
This bug is triggered after moving Compare OPs to phi in PR #39970 , which causes a random segmentation fault in case test_where.py in CE:
image
image

This PR fixes this bug.

@paddle-bot-old
Copy link

paddle-bot-old bot commented Mar 1, 2022

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

@chenwhql chenwhql merged commit fb0cadf into PaddlePaddle:develop Mar 2, 2022
@From00 From00 deleted the fix-bug-for-prepared-operator branch March 11, 2022 07:16
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