You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
), "The placement on sharding_mesh_axis should be Replicate"
689
+
687
690
# check the sharding degree since it has already been set
688
-
ifany(
689
-
isinstance(placement, dist.Shard)
690
-
forplacementinplacements
691
-
):
692
-
foridx, placementinenumerate(placements):
693
-
ifisinstance(placement, dist.Replicate):
694
-
assert (
695
-
mesh.dim_size(idx) ==self._sharding_degree
696
-
), "The sharding degree of all parameters must be equal currently."
691
+
assert (
692
+
mesh.dim_size(self._sharding_mesh_axis)
693
+
==self._sharding_degree
694
+
), "The sharding degree of all parameters must be equal currently."
697
695
698
696
assert (
699
697
self._sharding_degreeisnotNone
@@ -889,7 +887,7 @@ class ShardingStage1(_ShardingStageBase):
889
887
A builtin shard_fn for shard_optimizer interface, users can pass it to shard_optimizer to implement sharding optimization with stage 1.
890
888
891
889
Args:
892
-
mesh(paddle.distributed.ProcessMesh): The `ProcessMesh` object describes the Cartesian topology of the used processes.
890
+
mesh(None|paddle.distributed.ProcessMesh): If mesh is not None, the `ProcessMesh` object describes the Cartesian topology of the used processes for dense type parameters. Note: Currently, only one mesh configuration is supported for all dense parameters. If there is a need for multiple mesh configurations, please configure them yourself in the upper layer networking code.
893
891
894
892
Examples:
895
893
.. code-block:: python
@@ -922,7 +920,7 @@ class ShardingStage1(_ShardingStageBase):
@@ -950,7 +948,7 @@ class ShardingStage2(_ShardingStageBase):
950
948
A builtin shard_fn for shard_optimizer interface, users can pass it to shard_optimizer to implement sharding optimization with stage 2.
951
949
952
950
Args:
953
-
mesh(paddle.distributed.ProcessMesh): The `ProcessMesh` object describes the Cartesian topology of the used processes.
951
+
mesh(None|paddle.distributed.ProcessMesh): If mesh is not None, the `ProcessMesh` object describes the Cartesian topology of the used processes for dense type parameters. Note: Currently, only one mesh configuration is supported for all dense parameters. If there is a need for multiple mesh configurations, please configure them yourself in the upper layer networking code.
954
952
955
953
Examples:
956
954
.. code-block:: python
@@ -983,7 +981,7 @@ class ShardingStage2(_ShardingStageBase):
A builtin shard_fn for shard_optimizer interface, users can pass it to shard_optimizer to implement sharding optimization with stage 3.
1037
1035
1038
1036
Args:
1039
-
mesh(paddle.distributed.ProcessMesh): The `ProcessMesh` object describes the Cartesian topology of the used processes.
1037
+
mesh(None|paddle.distributed.ProcessMesh): If mesh is not None, the `ProcessMesh` object describes the Cartesian topology of the used processes for dense type parameters. Note: Currently, only one mesh configuration is supported for all dense parameters. If there is a need for multiple mesh configurations, please configure them yourself in the upper layer networking code.
1040
1038
1041
1039
Examples:
1042
1040
.. code-block:: python
@@ -1069,30 +1067,33 @@ class ShardingStage3(_ShardingStageBase):
0 commit comments