diff --git a/python/paddle/distributed/auto_parallel/api.py b/python/paddle/distributed/auto_parallel/api.py index f5cb2246017ae7..811a90ab083720 100644 --- a/python/paddle/distributed/auto_parallel/api.py +++ b/python/paddle/distributed/auto_parallel/api.py @@ -3270,7 +3270,7 @@ class ShardDataloader: ShardDataloader converts a dataloader to a new dataloader which provided two capabilities: 1. split dataloader by shard_dim to do data parallel. 2. reshard the output of dataloader to distributed tensor. - if is_dataset_split is True, just need to do reshard. + if is_dataset_splitted is True, just need to do reshard. Args: dataloader (paddle.io.DataLoader): The dataloader to be sharded. @@ -3284,7 +3284,7 @@ class ShardDataloader: shard_dims (list|tuple|str|int]): The mesh dimension to shard the dataloader. Users can specify the shard_dim of each mesh or specify a single shard_dim for all meshes. Default: None, which means the data loader will not be split, i.e. mp. - is_dataset_split (bool): Whether the dataset has been split. + is_dataset_splitted (bool): Whether the dataset has been split. dense_tensor_idx (list): A paired 2D list specifies the index of the dense_tensor in the output of dataloader. It allows users to identify which elements within each output batch are dense_tensor. first dense_tensor: the dense_tensor return by dataloader. @@ -3299,13 +3299,13 @@ def __init__( meshes: ProcessMesh | list[ProcessMesh] | tuple[ProcessMesh], input_keys: list[str] | tuple[str] | None = None, shard_dims: list | tuple | str | int | None = None, - is_dataset_split: bool = False, + is_dataset_splitted: bool = False, dense_tensor_idx: list[list[int]] | None = None, ): # do some check - if is_dataset_split is True and shard_dims is None: + if is_dataset_splitted is True and shard_dims is None: raise ValueError( - "shard_dims must be set when is_dataset_split is True" + "shard_dims must be set when is_dataset_splitted is True" ) self._meshes = to_list(meshes) @@ -3332,7 +3332,7 @@ def __init__( dp_rank = mesh.get_rank_by_dim_and_process_id(shard_dim, process_id) dp_world_size = mesh.get_dim_size(shard_dim) - if is_dataset_split is True or shard_dims is None: + if is_dataset_splitted is True or shard_dims is None: self._dataloader = dataloader self.batch_size = dataloader.batch_sampler.batch_size else: @@ -3588,15 +3588,15 @@ def shard_dataloader( meshes: ProcessMesh | Sequence[ProcessMesh], input_keys: Sequence[str] | None = None, shard_dims: Sequence[str] | Sequence[int] | str | int | None = None, - is_dataset_split: bool = False, + is_dataset_splitted: bool = False, dense_tensor_idx: list[list[int]] | None = None, ) -> ShardDataloader: """ Convert the dataloader to a ShardDataloader which provided two capabilities: 1. split dataloader by shard_dim to do data parallel if it it not None. 2. reshard the output of dataloader to distributed tensor. - if is_dataset_split is True, it means that the dataset has been split by users, and just need to do reshard. - only if is_dataset_split is False and shard_dims is not None, it will do split. + if is_dataset_splitted is True, it means that the dataset has been split by users, and just need to do reshard. + only if is_dataset_splitted is False and shard_dims is not None, it will do split. Args: dataloader (paddle.io.DataLoader): The dataloader to be sharded. the output of dataloader @@ -3613,7 +3613,7 @@ def shard_dataloader( The mesh dimension to shard the dataloader. Users can specify the shard_dim of each mesh or specify a single shard_dim for all meshes. Default: None, which means the data loader will not be split, i.e. mp. - is_dataset_split (bool): Whether the dataset has been split, Default: False. + is_dataset_splitted (bool): Whether the dataset has been split, Default: False. dense_tensor_idx (list): A paired 2D list specifies the index of the dense_tensor in the output of dataloader. It allows users to identify which elements within each output batch are dense_tensor. first dense_tensor: the dense_tensor return by dataloader. @@ -3783,7 +3783,7 @@ def shard_dataloader( meshes, input_keys, shard_dims, - is_dataset_split, + is_dataset_splitted, dense_tensor_idx, ) diff --git a/test/auto_parallel/pir/while_unittest_pir.py b/test/auto_parallel/pir/while_unittest_pir.py index 84e86b74181adb..c074b3fd39bd19 100644 --- a/test/auto_parallel/pir/while_unittest_pir.py +++ b/test/auto_parallel/pir/while_unittest_pir.py @@ -95,7 +95,7 @@ def create_data_loader(self): meshes=mesh, shard_dims="x", input_keys=["inputs", "label"], - is_dataset_split=True, + is_dataset_splitted=True, ) return dist_dataloader