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

[XPU][PHI Kernels] support fused_rotary_position_embedding for xpu #59480

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

lj970926
Copy link
Contributor

@lj970926 lj970926 commented Nov 29, 2023

PR types

New features

PR changes

OPs

Description

support fused_rotary_position_embedding for xpu. Do not support use_neox_rotary_style=True temporarily

Copy link

paddle-bot bot commented Nov 29, 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 the contributor External developers label Nov 29, 2023
Copy link

paddle-bot bot commented Nov 29, 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.

if (use_neox_rotary_style) {
// TODO(lijin23): support rotary_embedding every_two.
PADDLE_THROW(phi::errors::Unimplemented(
"XPU do not support rotary_embedding with use_neox_rotary_style set."));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

相关API算子暂不支持fp16输入的sin、cos,待后续api支持后下个PR更新

p_fw, p_bw = self.get_forward_backward(
paddle_fused_rotary_position_embedding,
seed=self.seed,
use_neox_rotary_style=False,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

所有单测暂时指定use_neox_rotary_style=False,待后续支持后完善

from paddle.incubate.nn.functional import fused_rotary_position_embedding


def deal_qkv(init_q, init_k, init_v):
Copy link
Contributor

Choose a reason for hiding this comment

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

后续提交可以改个名字,permute_qkv类似这种

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

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

Copy link
Contributor

@ZibinGuo ZibinGuo left a comment

Choose a reason for hiding this comment

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

LGTM

@houj04 houj04 merged commit ce65ba3 into PaddlePaddle:develop Nov 30, 2023
30 checks passed
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.

4 participants