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

Sequence Parallel Support Overlap #62284

Merged
merged 9 commits into from
Mar 18, 2024
Merged

Conversation

iosmers
Copy link
Contributor

@iosmers iosmers commented Mar 1, 2024

PR types

Performance optimization

PR changes

OPs

Description

1、本PR主要支持SP支持计算通信重叠功能
2、逐位对齐实验结果,在llama2 13B上开main_grad逐位对齐结果如下,bf16 main_grad, fp16 main_grad,bf16 no main_grad, fp16 no main_grad均能逐位对齐
image
3、更新前后的timeline结果对比

image image

Pcard-73145

Copy link

paddle-bot bot commented Mar 1, 2024

你的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.

ctx.model_parallel_group = model_parallel_group

world_size = model_parallel_group.nranks
is_mp = world_size > 1
Copy link
Contributor

Choose a reason for hiding this comment

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

这个是不是直接assert is_mp就行了?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

Copy link
Contributor

@Xreki Xreki left a comment

Choose a reason for hiding this comment

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

请完善下PR Tile和PR描述,PR描述中应说清楚本PR的工作内容,并且最好贴出修改前后的Timeline。

input_parallel = x
output = self.linear(
input_parallel, self.weight, self.bias, name=self._name
# sequence parallelism is same as model parallelis, if sequence parallel is true, input shape is [s, b, h],else input shape is [b, s, h]
Copy link
Contributor

Choose a reason for hiding this comment

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

mp_async_allreduce也会有单独开启的情况,即mp_async_allreduce=Truemp_fused_linear_param_grad_add=False?可以在下个PR支持下。

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

@iosmers iosmers changed the title Migrate sp Sequence Parallel Support Overlap Mar 18, 2024
@Xreki Xreki merged commit cfaa001 into PaddlePaddle:develop Mar 18, 2024
30 checks passed
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.

3 participants