How to get world_size and global_rank in custom LightningDataModule? 
I implement a custom DistributedSampler for my own Dataset, but global_rank and world_size are not accessible in LightningDataModule. These two arguments should be passed into a DistributedSampler instance used in train_dataloader and val_dataloader methods respectively.
Code
def train_dataloader(self):
    train_dataset = MultiChunkDataset(self.train_data_dir) 
    kwargs = self.distributed_sampler_kwargs
    sampler = MultiChunkDistributedSampler(train_dataset, **kwargs)
    return DataLoader(train_dataset, batch_size=self.batch_size, sampler=sampler, num_workers=self.num_workers, collate_fn=collate_data)

class MultiChunkDistributedSampler(DistributedSampler):
    def __init__(self, dataset: MultiChunkDataset, num_replicas: Optional[int] = None, rank: Optional[int] = None,                                                
                        shuffle: bool = True, seed: int = 0, drop_last: bool = False) -> None:
         ......