Assuming you main.py script assigns different MASTER_PORT for different experiments (so that processes in the sample experiment can successfully rendezvous).
It should work with GLOO backend. But if you are using NCCL backend, it could hang, because NCCL requires using one communicator per device at a time. If there are multiple processes operating on the same CUDA device, DDP instances in different processes might launch AllReduce concurrently. If you are lucky and the experiments do not hang, the result should still be correct I think.