mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-01 09:07:51 +00:00
[Feature] MoE Ulysses Support (#5918)
* moe sp support * moe sp bug solve * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -209,7 +209,7 @@ class ProcessGroupMesh:
|
||||
axis: Union[int, List[int]],
|
||||
indices_at_axis: Optional[Union[List[int], List[List[int]]]] = None,
|
||||
backend: Optional[str] = None,
|
||||
return_ranks_by_group: bool = False
|
||||
return_ranks_by_group: bool = False,
|
||||
) -> Union[ProcessGroup, List[Tuple[int, ...]]]:
|
||||
"""Create all process groups along the given axis, and return the one which the current process belongs to.
|
||||
|
||||
@@ -257,7 +257,11 @@ class ProcessGroupMesh:
|
||||
return target_group
|
||||
|
||||
def get_group_along_axis(
|
||||
self, axis: Union[int, List[int]], indices_at_axis: Optional[List[int]] = None, backend: Optional[str] = None, return_ranks_by_group: bool = False
|
||||
self,
|
||||
axis: Union[int, List[int]],
|
||||
indices_at_axis: Optional[List[int]] = None,
|
||||
backend: Optional[str] = None,
|
||||
return_ranks_by_group: bool = False,
|
||||
) -> Union[ProcessGroup, List[Tuple[int, ...]]]:
|
||||
"""Get the process group along the given axis which the current process belongs to. If the process group doesn't exist, it will be created.
|
||||
|
||||
|
Reference in New Issue
Block a user