Thanks for your reply!
Yeah, I did what they said:
model = torch.nn.parallel.DistributedDataParallel(model, device_ids=[], output_device=[])

I also think I am able to specify CPU affinity,however I am failed.