Has anyone encountered a similar problem?
The Python script could not exit by itself without Ctrl+C. I try to train a model on 2 GPU in a ubuntu server.
Training and evaluation are fine. But after “main()” finishing, the python process won’t terminate by itself. I checked the gpu( nvidia-smi ) and cpu usage ( htop ). The process still occupied those resources, which means the process group could not be kill by itself. And if I training with only one GPU, it’s fine.
Here’s my opinions:


group_process could not terminated for some reason? Except for initializaiton by torch.distributed.init_process_group(), I didn’t find any solutions in torch Documentation to termanate the group.
Deleting variable like model could not help it out.
Is this a bug for torch or python ?
Did I make mistakes in using multi-gpu?