def METHOD_NAME(
    input_paths: List[str],
    batch_size: int,
    max_sequence_length: int,
    seed: int,
    dp_rank: int,
    dp_size: int,
    shuffle: bool = False,
    zipped: bool = True,
    use_last_file_only: bool = False,
    data_type: str = "GPT",
):
    if smp.pp_rank() == 0:
        if data_type == "GPT":
            data = GPTPretrainingDataset(
                input_paths=input_paths,
                max_sequence_length=max_sequence_length,
                zipped=zipped,
                use_last_file_only=use_last_file_only,
            )
        elif data_type == "BERT":
            if len(input_paths) > 1:
                print(
                    f"BERT data only support single file when calling create_pretraining_dataloader, reading the first file instead.."
                )
            data = BertPretrainingDataset(
                input_file=input_paths[0], max_pred_length=max_sequence_length
            )
        else:
            raise ValueError(f"Unsupported data type {data_type}")
        # TODO: set sampler.epoch to correctly shuffle across epochs, else same order will be used for all epochs
        # not relevant now as we have no epochs
        sampler = torch.utils.data.DistributedSampler(
            data,
            shuffle=shuffle,
            seed=seed,
            rank=dp_rank,
            num_replicas=dp_size,
            drop_last=True,
        )
        dataloader = torch.utils.data.DataLoader(
            data,
            sampler=sampler,
            batch_size=batch_size,
            num_workers=0,
            pin_memory=True,
            drop_last=True,
        )
        smp.broadcast(len(dataloader), smp.PP_GROUP)
    else:
        data_len = smp.recv_from(0, smp.RankType.PP_RANK)
        dataset = DummyDataset(data_len * batch_size, data_type=data_type)
        dataloader = torch.utils.data.DataLoader(dataset, batch_size=batch_size, drop_last=True)
    return dataloader