Sorry for late, I mean I setup DDP for model_a and setup DDP for model_b in the same time:
Looks like:
setup()
model_a = DDP(model_a)
setup()
model_b = DDP(model_b)

This will cause an error.
So I need to change like that:
setup()
model_a = DDP(model_a)
cleanup()
setup()
model_b = DDP(model_b)

but, after the cleanup, the program will be blocked.