Repository: pytorch
Issue: PyTorch source code compile fail after "Built target fbgemm_avx2"
Labels: module: build,triaged

### 🐛 Describe the bug

configuration:

-- Will link against OpenMP libraries: /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/libgomp.so;/lib64/libpthread.so
-- Found CUDA: /usr/local/cuda (found version "10.2") 
-- Caffe2: CUDA detected: 10.2
-- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda
-- Caffe2: Header version is: 10.2
-- Found CUDNN: /usr/lib64/libcudnn.so  
-- Found cuDNN: v7.6.5  (include: /usr/include, library: /usr/lib64/libcudnn.so)

OS: centos7.6

**command to compile:**

PYTORCH_BUILD_VERSION=1.6.0+cu102 \
	       PYTORCH_BUILD_NUMBER=0 \
	       USE_CUDA=1 \
	       USE_CUDNN=1 \
	       CUDA_HOME=/usr/local/cuda \
	       CUDNN_LIB_DIR=/usr/local/cuda \
	       USE_SYSTEM_NCCL=1 \
	       NCCL_INCLUDE_DIR=/usr/include \
	       NCCL_INCLUDE=/usr/include  \
	       NCCL_LIB=/usr/lib64 \
	       NCCL_LIB_DIR=/usr/lib64 \
	       TORCH_CUDA_ARCH_LIST="3.5;3.7;5.2;6.0;6.1;7.0;7.5+PTX" \
	       CFLAGS="-Wno-error=deprecated-declarations" \
       python3.6 setup.py bdist_wheel


[  9%] Generating python/models/seq2seq/__init__.py
gmake[2]: *** [third_party/fbgemm/CMakeFiles/fbgemm_generic.dir/src/EmbeddingSpMDM.cc.o] Error 1
[  9%] Building C object confu-deps/pytorch_qnnpack/CMakeFiles/pytorch_qnnpack.dir/src/clamp.c.o
[  9%] Building CXX object third_party/fbgemm/asmjit/CMakeFiles/asmjit.dir/src/asmjit/core/zonestack.cpp.o
[  9%] Building CXX object confu-deps/pytorch_qnnpack/CMakeFiles/pytorch_qnnpack.dir/src/conv-prepack.cc.o
[  9%] Generating python/models/seq2seq/beam_search.py
[  9%] Building CXX object c10/CMakeFiles/c10.dir/util/SmallVector.cpp.o
[  9%] Building C object confu-deps/QNNPACK/CMakeFiles/qnnpack.dir/src/convolution.c.o
[  9%] Generating python/models/seq2seq/seq2seq_beam_search_test.py
[  9%] Building CXX object third_party/ideep/mkl-dnn/src/CMakeFiles/mkldnn.dir/cpu/gemm/gemm_utils.cpp.o
gmake[2]: *** [third_party/fbgemm/CMakeFiles/fbgemm_generic.dir/src/FbgemmI64.cc.o] Error 1
[  9%] Building C object confu-deps/pytorch_qnnpack/CMakeFiles/pytorch_qnnpack.dir/src/deconvolution.c.o
[  9%] Building C object confu-deps/pytorch_qnnpack/CMakeFiles/pytorch_qnnpack.dir/src/convolution.c.o
[  9%] Generating python/models/seq2seq/seq2seq_model_helper.py
[  9%] Building CXX object confu-deps/pytorch_qnnpack/CMakeFiles/pytorch_qnnpack.dir/src/fc-prepack.cc.o
[  9%] Building CXX object third_party/ideep/mkl-dnn/src/CMakeFiles/mkldnn.dir/cpu/gemm/jit_avx2_gemm_f32.cpp.o
[  9%] Building C object confu-deps/pytorch_qnnpack/CMakeFiles/pytorch_qnnpack.dir/src/fully-connected.c.o
[  9%] Generating python/models/seq2seq/seq2seq_model_helper_test.py
[  9%] Built target fmt
[  9%] Building CXX object third_party/fbgemm/asmjit/CMakeFiles/asmjit.dir/src/asmjit/core/zonetree.cpp.o
[  9%] Building CXX object third_party/fbgemm/asmjit/CMakeFiles/asmjit.dir/src/asmjit/core/zonevector.cpp.o
[  9%] Generating python/models/seq2seq/seq2seq_util.py
[  9%] Building CXX object third_party/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/stubs/stringpiece.cc.o
[  9%] Generating src/x86_64-fma/2d-fourier-8x8.py.o
[  9%] Building CXX object c10/CMakeFiles/c10.dir/util/StringUtil.cpp.o
[  9%] Generating python/models/seq2seq/train.py
[  9%] Building C object confu-deps/pytorch_qnnpack/CMakeFiles/pytorch_qnnpack.dir/src/global-average-pooling.c.o
[  9%] Generating python/models/seq2seq/translate.py
Scanning dependencies of target nnpack_reference_layers
Scanning dependencies of target cache
[  9%] Building CXX object third_party/fbgemm/asmjit/CMakeFiles/asmjit.dir/src/asmjit/arm/a64assembler.cpp.o
[  9%] Building CXX object third_party/fbgemm/asmjit/CMakeFiles/asmjit.dir/src/asmjit/arm/armformatter.cpp.o
/usr/local/bin/python3.6: Error while finding module specification for 'peachpy.x86_64' (ModuleNotFoundError: No module named 'peachpy')
[  9%] Building CXX object third_party/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/stubs/stringprintf.cc.o
[  9%] Generating python/models/shufflenet.py
gmake[2]: *** [confu-deps/NNPACK/src/x86_64-fma/2d-fourier-8x8.py.o] Error 1
[  9%] Building C object confu-deps/pytorch_qnnpack/CMakeFiles/pytorch_qnnpack.dir/src/hardsigmoid.c.o
gmake[1]: *** [confu-deps/NNPACK/CMakeFiles/nnpack.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....

[ 17%] Built target fbgemm_avx2
gmake: *** [all] Error 2
Traceback (most recent call last):
  File "setup.py", line 732, in <module>
    build_deps()
  File "setup.py", line 316, in build_deps
    cmake=cmake)
  File "/root/pytorch/pytorch/tools/build_pytorch_libs.py", line 62, in build_caffe2
    cmake.build(my_env)
  File "/root/pytorch/pytorch/tools/setup_helpers/cmake.py", line 345, in build
    self.run(build_args, my_env)
  File "/root/pytorch/pytorch/tools/setup_helpers/cmake.py", line 141, in run
    check_call(command, cwd=self.build_dir, env=env)
  File "/usr/local/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'install', '--config', 'Release', '--', '-j', '72']' returned non-zero exit status 2.




### Versions

torch = v1.6.0

cc @malfet @seemethere