-
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
[AMP][Custom Device] add fp16 op detection for custom device #56053
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@zyfncg Could you help review this PR? |
@zhangting2020 Please help review this PR~🙏🏻 |
@ronny1996 @zhangting2020 Could you give some comments? |
Note that similar work #56176 merged, very appreciate it. But it still not workable: >>> import paddle
I0811 00:41:31.618554 1720908 init.cc:239] ENV [CUSTOM_DEVICE_ROOT]=/home/afas/miniconda3/envs/youzhi_ernie/lib/python3.10/site-packages/paddle_custo m_device
I0811 00:41:31.618577 1720908 init.cc:145] Try loading custom device libs from: [/home/afas/miniconda3/envs/youzhi_ernie/lib/python3.10/site-packages/paddle_custom_device]
I0811 00:41:31.711321 1720908 custom_device.cc:1112] Successed in loading custom runtime in lib: /home/afas/miniconda3/envs/youzhi_ernie/lib/python3.10/site-packages/paddle_custom_device/libpaddle-custom-intel-gpu.so
I0811 00:41:31.711938 1720908 custom_kernel.cc:76] Successed in loading 94 custom kernel(s) from loaded lib(s), will be used like native ones.
I0811 00:41:31.711964 1720908 init.cc:157] Finished in LoadCustomDevice with libs_path: [/home/afas/miniconda3/envs/youzhi_ernie/lib/python3.10/site-packages/paddle_custom_device]
I0811 00:41:31.711975 1720908 init.cc:245] CustomDevice: intel_gpu, visible devices count: 4
>>> from paddle.fluid import core
>>> dt = core.VarDesc.VarType.FP16
>>> core.op_supported_infos('intel_gpu', dt)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: (InvalidArgument) The argument `place` should be 'GPU', 'CPU', 'XPU', but got 'intel_gpu'.
[Hint: Expected is_target_place.count(query_place) != 0, but received is_target_place.count(query_place):0 == 0:0.] (at /home/afas/youzhi/pd-main/paddle/fluid/imperative/amp_auto_cast.cc:56)
>>> exit() I propose to adopt a more compatible way, rather than hard code as 'CUSTOM_DEVICE' for custom device's name. |
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
…addle#56053) * [AMP] add fp16 op detection for custom device * resolve conflicts
…addle#56053) * [AMP] add fp16 op detection for custom device * resolve conflicts
PR types
Function optimization
PR changes
Others
Description
Aim to support the fp16 dtype op detection in AMP for custom device.