I am sorry for taking so long time to reply you. I found the problem is not caused by DDP. It is caused by the __init__.py file in the torch directory.
I try to avoid load this __init__.py and the problem is disappeared. I think there are some library problem in my machine. Thanks for your reply.