-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[CustomDevice] suport device_guard for custom device #53808
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
❌ The PR is not created using PR's template. You can refer to this Demo. |
@@ -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 && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
尽量不要使用硬编码的 "npu"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
… support_device_guard_for_npu
python/paddle/fluid/framework.py
Outdated
'intel_gpu', | ||
'mps', | ||
'custom_cpu', | ||
'', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是否先添加了所有的custom device
There was a problem hiding this comment.
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设备类型
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
python/paddle/fluid/framework.py
Outdated
'intel_gpu', | ||
'mps', | ||
'custom_cpu', | ||
'', |
There was a problem hiding this comment.
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设备类型
8d65ad1
to
c8d6039
Compare
c8d6039
to
ffae3d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
36f4759
to
245f669
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
Others
PR changes
Others
Description
suport device_guard for custom device