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

support Kunlun2 #34459

Merged
merged 3 commits into from
Aug 3, 2021
Merged

support Kunlun2 #34459

merged 3 commits into from
Aug 3, 2021

Conversation

QingshuChen
Copy link
Contributor

@QingshuChen QingshuChen commented Jul 28, 2021

PR types

Others

PR changes

Others

Describe

Support Kunlun2.

@paddle-bot-old
Copy link

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

XPUDeviceContext::XPUDeviceContext() {
context_ = xpu::create_context();
xpu_version_ = get_xpu_version(place_.device);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

前面的文件是不是需要获取 L3的大小的接口,在下面可以传入L3的大小,根据卡的大小来设置?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

runtime有提供了这个接口xpu_get_device_attr,根据需要后面可以添加。

{"batch_norm", XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})},
{"batch_norm_grad",
XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})},
{"cast", XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})},
Copy link
Contributor

Choose a reason for hiding this comment

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

这个data_type是怎么确定的,kl1的cast只支持fp32吗

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个type data_type是REGISTER_OP_KERNEL时指定的type,应该是输入的类型。
KL1目前支持FP32, int32, int64,这边漏加了,下个PR我不上去。

Copy link
Contributor

Choose a reason for hiding this comment

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

嗯,应该还有挺多op的type需要补的,比如one_hot

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok,这个我下个PR再核验一下

Copy link
Contributor

@wangxicoding wangxicoding left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@raindrops2sea raindrops2sea left a comment

Choose a reason for hiding this comment

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

LGTM

@fuyinno4 fuyinno4 merged commit 2d0f3d9 into PaddlePaddle:develop Aug 3, 2021
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.

5 participants