I tried again and solved the problem. When the compilation stops at 50%, just wait. After about 2.5h, the compilation will continue. Finally, the compilation is completed within 12h. Thank you for your patient help and guidance. @ptrblck
In addition, a suggestion: can the next version of PyTorch (perhaps version 1.11 or 1.10.1?) integrate NCCL2.11.4 so that all WSL2 users can directly pip3 install and use it without spending a lot of time compiling the source code.