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] suport device_guard for custom device #53808

Merged

Conversation

YanhuiDua
Copy link
Contributor

@YanhuiDua YanhuiDua commented May 15, 2023

PR types

Others

PR changes

Others

Description

suport device_guard for custom device

@paddle-bot
Copy link

paddle-bot bot commented May 15, 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
Copy link

paddle-bot bot commented May 15, 2023

❌ The PR is not created using PR's template. You can refer to this Demo.
Please use PR's template, it helps save our maintainers' time so that more developers get helped.

@@ -400,6 +400,18 @@ void ApplyDeviceGuard(const OperatorBase* op_base,
}
VLOG(3) << "Switch into " << expected_kernel_key->place_
<< " by device_guard.";
} else if (op_device.find("npu") != std::string::npos &&
Copy link
Contributor

Choose a reason for hiding this comment

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

尽量不要使用硬编码的 "npu"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

'intel_gpu',
'mps',
'custom_cpu',
'',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里是否先添加了所有的custom device

Copy link
Contributor

Choose a reason for hiding this comment

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

这里也不用用硬编码,paddle.device.get_all_custom_device_type() 可以获取所有已注册的custom 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.

好的

'intel_gpu',
'mps',
'custom_cpu',
'',
Copy link
Contributor

Choose a reason for hiding this comment

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

这里也不用用硬编码,paddle.device.get_all_custom_device_type() 可以获取所有已注册的custom device设备类型

@YanhuiDua YanhuiDua force-pushed the support_device_guard_for_npu branch from 8d65ad1 to c8d6039 Compare May 15, 2023 09:19
@YanhuiDua YanhuiDua changed the title [CustomDevice] suport device_guard for npu [CustomDevice] suport device_guard for custom device May 15, 2023
@YanhuiDua YanhuiDua force-pushed the support_device_guard_for_npu branch from c8d6039 to ffae3d4 Compare May 15, 2023 09:23
ronny1996
ronny1996 previously approved these changes May 15, 2023
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

@YanhuiDua YanhuiDua force-pushed the support_device_guard_for_npu branch from 36f4759 to 245f669 Compare May 16, 2023 11:47
Copy link
Contributor

@qili93 qili93 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 9e045ee into PaddlePaddle:develop May 17, 2023
@YanhuiDua YanhuiDua deleted the support_device_guard_for_npu branch May 17, 2023 13:04
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