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

[Hybrid Parallel] Add Topology for hybrid communicate #32011

Merged
merged 5 commits into from
Apr 6, 2021

Conversation

ForFishes
Copy link
Member

PR types

New features

PR changes

Others

Describe

[Hybrid Parallel] Add Topology for hybrid communicate

@paddle-bot-old
Copy link

paddle-bot-old bot commented Apr 1, 2021

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

self._dims = dims
self.coordinate = collections.namedtuple('Coordinate',
self._parallel_names)
self._word_size = reduce(lambda x, y: x * y, self._dims)
Copy link
Contributor

Choose a reason for hiding this comment

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

word or world?

Copy link
Member Author

Choose a reason for hiding this comment

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

fix it

sandyhouse
sandyhouse previously approved these changes Apr 1, 2021
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 for others

__all__ = ['CommunicateTopology', 'HybridCommunicateGroup']


class CommunicateTopology(object):

Choose a reason for hiding this comment

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

Add a comment to describe what it is?

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



class CommunicateTopology(object):
def __init__(self, hybrid_names, dims):

Choose a reason for hiding this comment

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

hybrid_names or group_names?


class CommunicateTopology(object):
def __init__(self, hybrid_names, dims):
self._parallel_names = hybrid_names

Choose a reason for hiding this comment

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

or group_names

self._rank2coord = dict(
zip(self._coord2rank.values(), self._coord2rank.keys()))

def get_parallel_names(self):

Choose a reason for hiding this comment

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

as above

ranks.sort()
return ranks

def get_dim_num(self, axis_name):

Choose a reason for hiding this comment

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

get_dim_size?

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

@ForFishes ForFishes merged commit 2e82b6c into PaddlePaddle:develop Apr 6, 2021
@ForFishes ForFishes deleted the add_topology branch April 6, 2021 03:28
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.

5 participants