Can you confirm that there are 4 GPUs available on your machine? You can find that through torch.cuda.device_count(). An alternative is to do this programmatically when starting DDP, you can try something like:
import torch
from absl import app

def launch_training_job(local_rank, world_size
                       processed_dataset):
    ### ddp ###
    torch.distributed.init_process_group(backend='nccl',
                                         world_size=world_size,
                                         rank=local_rank)
    torch.cuda.set_device(local_rank)
    print('[INFO] Starting nccl for ddp.')
    
    distributed_sampler = torch.utils.data.distributed.DistributedSampler(processed_dataset)
    
    processed_sms_dataloader = torch.utils.data.DataLoader(processed_dataset,
                                                           batch_size=32,
                                                           pin_memory=True,
                                                           num_workers=world_size,
                                                           sampler=distributed_sampler)

def main(argv):
    .......
    # world_size == number of GPUs
    world_size=torch.cuda.device_count()
    torch.multiprocessing.spawn(launch_training_job,
                                args=(processed_dataset, world_size),
                                nprocs=world_size)
if __name__ == "__main__":
    app.run(main)

If this does not help, perhaps you can try posting this in the data loader questions of the forums instead?