# Create a new member `flatten_device_meshes` to distinguish from original flatten methods (Because I'm not sure if there are functions that rely on the self.flatten())
global_rank (int, optional): the global rank of the process group. If not specified, the current process is used. (default: None)
"""
ifglobal_rankisNone:
global_rank=self._global_rank_of_current_process
elifself._is_init_from_process_group:
raiseRuntimeError(
"The logical device mesh is create with DeviceMesh.from_process_group, this method is not supported for this creation method as no global rank information is known."
global_rank (int, optional): the global rank of the process
"""
ifglobal_rankisNone:
global_rank=self._global_rank_of_current_process
elifself._is_init_from_process_group:
raiseRuntimeError(
"The logical device mesh is create with DeviceMesh.from_process_group, this method is not supported for this creation method as no global rank information is known."
Return the ranks in the process group on the specified axis.
Args:
axis (int): the axis of the process group.
global_rank (int, optional): the global rank of the process
"""
ifglobal_rankisNone:
global_rank=self._global_rank_of_current_process
elifself._is_init_from_process_group:
raiseRuntimeError(
"The logical device mesh is create with DeviceMesh.from_process_group, this method is not supported for this creation method as no global rank information is known."
Return the local rank of the given global rank in the logical device mesh.
Args:
rank (int): the global rank in the logical device mesh.
axis (int): the axis of the logical device mesh.
"""
ifself._is_init_from_process_group:
raiseRuntimeError(
"The logical device mesh is create with DeviceMesh.from_process_group, this method is not supported for this creation method as no global rank information is known."
Flatten the logical mesh into an effective 1d logical mesh,
"""
ifself._is_init_from_process_group:
raiseRuntimeError(
"The logical device mesh is create with DeviceMesh.from_process_group, this method is not supported for this creation method as no global rank information is known."