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

[OPT] FlashAttention && ModelParallel #51617

Merged
merged 3 commits into from
Mar 21, 2023
Merged

Conversation

ForFishes
Copy link
Member

PR types

Performance optimization

PR changes

Others

Describe

opt gpt performace

@paddle-bot
Copy link

paddle-bot bot commented Mar 14, 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.

phi::TensorFromVector<int64_t>(seed_offset_vec, ctx, seed_offset);
paddle::platform::CPUPlace cpu_place;
seed_offset->Resize({2});
auto* seed_offset_data = seed_offset->mutable_data<uint64_t>(cpu_place);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use auto* seed_offset_data = ctx.template HostAlloc<uint64_t>(seed_offset) instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

done, thx

@staticmethod
def forward(ctx, x, mp_degree):
out = paddle.scale(x, 1.0 / mp_degree)
ctx.mp_degree = mp_degree
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove this line.

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@ForFishes ForFishes changed the title opt gpt performace [OPT] FlashAttention && ModelParallel Mar 20, 2023
@ForFishes ForFishes merged commit 4640f4b into PaddlePaddle:develop Mar 21, 2023
@ForFishes ForFishes deleted the opt_mp branch March 21, 2023 06:32
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.

2 participants