-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Conversation
Thanks for your contribution! |
self._dims = dims | ||
self.coordinate = collections.namedtuple('Coordinate', | ||
self._parallel_names) | ||
self._word_size = reduce(lambda x, y: x * y, self._dims) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
word
or world
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix it
There was a problem hiding this 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): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_dim_size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
New features
PR changes
Others
Describe
[Hybrid Parallel] Add Topology for hybrid communicate