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

[dygraph hybrid pp for interleave] The interleave scheduler for pipeline parallel #45497

Merged

Conversation

FeixLiu
Copy link
Contributor

@FeixLiu FeixLiu commented Aug 29, 2022

PR types

Others

PR changes

Others

Describe

Support interleave scheduler.
Main changes:

  1. Interleave scheduler for both pipeline training and evaluation.
  2. Under eager dygraph mode, use async comm methods (isend/irecv) instead of sync methods (send/recv).
  3. Add two new methods _get_p2p_next_rank(), _get_p2p_prev_rank() in class HybridCommunicateGroup to get the global rank of prev pp stage and next pp stage.
  4. In p2p communication, use the global rank to represent the prev pp stage and next pp stage instead of only use 0 or 1 to represent.

Note that: the interleave scheduler only supports eager dygraph mode.

All works for supporting interleave scheduler for pipeline:

@paddle-bot
Copy link

paddle-bot bot commented Aug 29, 2022

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

@FeixLiu FeixLiu changed the title update old ut [dygraph hybrid pp for interleave] The interleave scheduler for pipeline parallel Aug 29, 2022
@FeixLiu FeixLiu force-pushed the virtual_pipeline_interleave_schedule branch 2 times, most recently from 0a095e1 to 21aa3d6 Compare September 1, 2022 03:02
@FeixLiu FeixLiu force-pushed the virtual_pipeline_interleave_schedule branch 2 times, most recently from 2998491 to 4931d7e Compare September 2, 2022 03:24
Copy link
Contributor

@gongweibao gongweibao left a comment

Choose a reason for hiding this comment

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

I think we may split 1F1B pipeline and interleave pipe into two class.

Copy link
Contributor

@gongweibao gongweibao left a comment

Choose a reason for hiding this comment

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

Some comments.

@FeixLiu FeixLiu force-pushed the virtual_pipeline_interleave_schedule branch from 578dcdb to 8b1ca0a Compare September 5, 2022 08:14
Copy link
Contributor

@gongweibao gongweibao 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

@sneaxiy sneaxiy left a comment

Choose a reason for hiding this comment

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

LGTM

# init some data buffers for interleave scheduler
self.input_tensors = [[] for _ in range(self.num_model_chunks)]
self.output_tensors = [[] for _ in range(self.num_model_chunks)]
self.output_tensor_grads = [[] for _ in range(self.num_model_chunks)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not quite important: self.output_tensor_grads is not necessary when forward_only = True.

Copy link
Contributor

@XieYunshen XieYunshen left a comment

Choose a reason for hiding this comment

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

下个PR删除RUN_SERIAL 1参数

@FeixLiu FeixLiu merged commit 72b5b5b into PaddlePaddle:develop Sep 6, 2022
@FeixLiu FeixLiu deleted the virtual_pipeline_interleave_schedule branch September 6, 2022 04:00
Caozhou1995 pushed a commit to Caozhou1995/Paddle that referenced this pull request Sep 9, 2022
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.

4 participants