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

Add ProcessGroupNCCL for distributed training #39737

Merged
merged 21 commits into from
Feb 23, 2022

Conversation

ForFishes
Copy link
Member

@ForFishes ForFishes commented Feb 18, 2022

PR types

New features

PR changes

Others

Describe

增加ProcessGroup、ProcessGroupNCCL概念。屏蔽当前通信库中关于通信流和计算流概念。所有通信默认异步通信。
整体设计图:

TODO:

  1. 支持动静统一的底层通信模块
  2. 添加更易用的调试信息,遍于分布式调试
  3. 添加显存管理,解决显存提前释放问题
  4. 支持更多的通信API

@@ -1,5 +1,6 @@
if(NOT WITH_PSCORE)
add_subdirectory(fleet_executor)
add_subdirectory(collective)

Choose a reason for hiding this comment

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

这条语句加到第一行是不是就可以了,这样可以省略下面那行。

Copy link
Member Author

Choose a reason for hiding this comment

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

ok,done

namespace paddle {
namespace distributed {

ProcessGroup::Task::Task(int rank, const std::vector<Tensor>& inputTensors,

Choose a reason for hiding this comment

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

rank参数的意义是什么?是不是没有用到?

Copy link
Member Author

Choose a reason for hiding this comment

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

用于后面的debug调试,打印rank信息,我记一下todo吧

if (FLAGS_nccl_blocking_wait) {
// NOTE(shenliang03): It will block host for sync
while (!IsCompleted()) {
std::this_thread::sleep_for(std::chrono::milliseconds(10));

Choose a reason for hiding this comment

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

Make 10 a constexpr and easy to modify.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok,done

sandyhouse
sandyhouse previously approved these changes Feb 22, 2022
Copy link

@sandyhouse sandyhouse left a comment

Choose a reason for hiding this comment

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

LGTM

lanxianghit
lanxianghit previously approved these changes Feb 22, 2022
@ForFishes ForFishes dismissed stale reviews from lanxianghit and sandyhouse via b8176b3 February 22, 2022 09:39
Copy link

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

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

LGTM for ‘set_tests_properties(test_collective_process_group PROPERTIES TIMEOUT 120)’

@ForFishes ForFishes merged commit 0b20581 into PaddlePaddle:develop Feb 23, 2022
@ForFishes ForFishes deleted the process_group_nccl branch February 23, 2022 13:38
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.

None yet

5 participants