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

[ProcessGroup]add new comm primitive #40040

Merged
merged 1 commit into from Mar 2, 2022

Conversation

Baibaifan
Copy link
Contributor

@Baibaifan Baibaifan commented Mar 1, 2022

PR types

New features

PR changes

Others

Describe

  1. Add new comm primitive (barrier\send\recv)
with _test_eager_guard():
    paddle.set_device('gpu:%d' %
                      paddle.distributed.ParallelEnv().dev_id)
    pg = init_process_group()
    # test barrier
    # rank 0
    if pg.rank() == 0:
        task = pg.barrier()

    # test send/recv
    # rank 0
    x = np.random.random(self.shape).astype(self.dtype)
    tensor_x = paddle.to_tensor(x)
    if pg.rank() == 0:
        task = pg.send(tensor_x, dst=1)
        task.wait()
        paddle.device.cuda.synchronize()
    # rank 1
    else:
        y = np.random.random(self.shape).astype(self.dtype)
        tensor_y = paddle.to_tensor(y)
        task = pg.recv(tensor_y, src=0)
        task.wait()
        paddle.device.cuda.synchronize()

@paddle-bot-old
Copy link

paddle-bot-old bot commented Mar 1, 2022

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

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

@sandyhouse sandyhouse merged commit 4e00d2b into PaddlePaddle:develop Mar 2, 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.

None yet

2 participants