I was able to address the above issue and now facing the issue of CUDA out of memory. The program runs fine with nn.DataParallel. My guess is pytorch is assigning complete data batch (size 8) to one GPU. Below I have written the script, let me know if you see detect some mistake?
batch file: CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch --nproc_per_node=2 train.py
training script:
def runTraining(args):
    torch.cuda.set_device(args.local_rank) 
    torch.distributed.init_process_group(backend='nccl',
                                     init_method='env://') 
.....
 train_sampler = torch.utils.data.distributed.DistributedSampler(train_set)

    train_loader = DataLoader(train_set,
                              batch_size=batch_size,
                              num_workers=args.num_workers,
                              shuffle=(train_sampler is None), sampler=train_sampler)
.....
if torch.cuda.is_available():
        device = 'cuda'
net = net.to(device)
if torch.cuda.is_available(): 
        net.cuda()
        softMax.cuda()
        CE_loss.cuda()
        Dice_loss.cuda()
    
net = nn.parallel.DistributedDataParallel(
net,device_ids[args.local_rank],find_unused_parameters=True)
.......
for i in range(epoch):
        train_sampler.set_epoch(epoch)


....
if __name__ == '__main__':
    parser=argparse.ArgumentParser()
     parser.add_argument("--local_rank", dest = 'local_rank',type=int, default=0)
     parser.add_argument('--num_workers', default = 4, type = int)
     args=parser.parse_args()
    runTraining(args)