Samplers are auto-added in DDP with no mechanism to override
🐛 Bug
Lightning automatically adds DistributedSampler when you turn on ddp, ddp2 or TPU: 
  
    
      pytorch-lightning/pytorch_lightning/trainer/data_loading.py
    
    
         Line 86
      in
      17f58d2
    
  
  
    

        
          
           def auto_add_sampler(self, dataloader: DataLoader, train: bool) -> DataLoader: 
        
    
  


This seems to be a recent change.
This is surprising behavior and not always something that's warranted. For example, it is common (at least in several of our large scale vision trainers) for each worker to read a specific partition of a large warehouse table. In this case, the automatic addition of the DistributedSampler will only provide access to a portion of the loaded data, which is unintended.
Worse, there's no mechanism at all to override this.
Possible fixes

At the very least, provide some way to override this functionality
If the dataset is iterable-style, never auto-add a Sampler