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 recompute not support bug on xpu #54367

Merged
merged 1 commit into from Jun 6, 2023

Conversation

HarperCy
Copy link
Contributor

@HarperCy HarperCy commented Jun 5, 2023

PR types

Bug fixes

PR changes

Others

Description

fix recompute not support bug on xpu

@paddle-bot
Copy link

paddle-bot bot commented Jun 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.

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Jun 5, 2023
@@ -224,6 +224,8 @@ def _recompute_without_reentrant(
cur_device = paddle.get_device()
if 'gpu:' in cur_device:
fw_cuda_rng_state = paddle.get_cuda_rng_state()
elif 'xpu:' in cur_device:
fw_cuda_rng_state = paddle.get_rng_state()
Copy link
Contributor

Choose a reason for hiding this comment

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

需要像下面custom device一样加上cur_device参数么

Copy link
Contributor Author

Choose a reason for hiding this comment

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

试了,不需要

Copy link
Contributor Author

Choose a reason for hiding this comment

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

get_rng_state()不传参则里面自动获取device信息

Copy link
Contributor

@XiaociZhang XiaociZhang left a comment

Choose a reason for hiding this comment

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

lgtm

@QingshuChen QingshuChen merged commit 58fe161 into PaddlePaddle:develop Jun 6, 2023
24 of 25 checks passed
@paddle-bot
Copy link

paddle-bot bot commented Jun 6, 2023

你的PR已合入Paddle库,请关注后续测试结果。
Your PR has been merged into the repository. An official integration test will be conducted later. Stay tuned.

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

3 participants