Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation of BinaryOpsKernel.cpp using gcc-8.4.0 fails with INTERNAL compiler error after #46396 #47395

Closed
malfet opened this issue Nov 4, 2020 · 1 comment
Assignees
Labels
module: arm Related to ARM architectures builds of PyTorch. Includes Apple M1 module: build Build system issues triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@malfet
Copy link
Contributor

malfet commented Nov 4, 2020

To Reproduce

Steps to reproduce the behavior:

  1. Checkout PyTorch after PR Implement copysign #46396
  2. Try compiling it using gcc-8.4.0
    Compilation fails with the following error:
FAILED: caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/cpu/BinaryOpsKernel.cpp.DEFAULT.cpp.o 
/usr/bin/c++  -DCPUINFO_SUPPORTED_PLATFORM=1 -DFMT_HEADER_ONLY=1 -DFXDIV_USE_INLINE_ASSEMBLY=0 -DHAVE_MALLOC_USABLE_SIZE=1 -DHAVE_MMAP=1 -DHAVE_SHM_OPEN=1 -DHAVE_SHM_UNLINK=1 -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DNNP_CONVOLUTION_ONLY=0 -DNNP_INFERENCE_ONLY=0 -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DUSE_DISTRIBUTED -DUSE_EXTERNAL_MZCRC -DUSE_RPC -DUSE_TENSORPIPE -D_FILE_OFFSET_BITS=64 -Dtorch_cpu_EXPORTS -Iaten/src -I../aten/src -I. -I../ -isystem third_party/gloo -isystem ../cmake/../third_party/gloo -isystem ../cmake/../third_party/googletest/googlemock/include -isystem ../cmake/../third_party/googletest/googletest/include -isystem ../third_party/protobuf/src -isystem ../third_party/gemmlowp -isystem ../third_party/neon2sse -isystem ../third_party/XNNPACK/include -I../cmake/../third_party/benchmark/include -isystem ../cmake/../third_party/eigen -isystem /home/ubuntu/miniforge3/include/python3.8 -isystem /home/ubuntu/miniforge3/lib/python3.8/site-packages/numpy/core/include -isystem ../cmake/../third_party/pybind11/include -Icaffe2/contrib/aten -I../third_party/onnx -Ithird_party/onnx -I../third_party/foxi -Ithird_party/foxi -I../torch/csrc/api -I../torch/csrc/api/include -I../caffe2/aten/src/TH -Icaffe2/aten/src/TH -Icaffe2/aten/src -Icaffe2/../aten/src -Icaffe2/../aten/src/ATen -I../torch/csrc -I../third_party/miniz-2.0.8 -I../aten/src/TH -I../aten/../third_party/catch/single_include -I../aten/src/ATen/.. -Icaffe2/aten/src/ATen -I../caffe2/core/nomnigraph/include -isystem include -I../third_party/FXdiv/include -I../c10/.. -I../third_party/pthreadpool/include -I../third_party/cpuinfo/include -I../third_party/QNNPACK/include -I../aten/src/ATen/native/quantized/cpu/qnnpack/include -I../aten/src/ATen/native/quantized/cpu/qnnpack/src -I../third_party/cpuinfo/deps/clog/include -I../third_party/NNPACK/include -I../third_party/FP16/include -I../third_party/tensorpipe -Ithird_party/tensorpipe -I../third_party/tensorpipe/third_party/libnop/include -I../third_party/fmt/include -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_VULKAN_WRAPPER -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -DMISSING_ARM_VST1 -Wno-stringop-overflow -O3 -DNDEBUG -DNDEBUG -fPIC   -DCAFFE2_USE_GLOO -D__NEON__ -DUSE_GCC_GET_CPUID -DTH_HAVE_THREAD -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-write-strings -Wno-unknown-pragmas -Wno-missing-braces -Wno-maybe-uninitialized -fvisibility=hidden -O2 -fopenmp -DCAFFE2_BUILD_MAIN_LIB -pthread -std=gnu++14 -O3  -DCPU_CAPABILITY=DEFAULT -DCPU_CAPABILITY_DEFAULT -MD -MT caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/cpu/BinaryOpsKernel.cpp.DEFAULT.cpp.o -MF caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/cpu/BinaryOpsKernel.cpp.DEFAULT.cpp.o.d -o caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/cpu/BinaryOpsKernel.cpp.DEFAULT.cpp.o -c aten/src/ATen/native/cpu/BinaryOpsKernel.cpp.DEFAULT.cpp
during RTL pass: expand
In file included from ../c10/util/llvmMathExtras.h:19,
                 from ../c10/core/DispatchKeySet.h:4,
                 from ../c10/core/Backend.h:5,
                 from ../c10/core/Layout.h:3,
                 from aten/src/ATen/core/TensorBody.h:4,
                 from ../aten/src/ATen/Tensor.h:3,
                 from ../aten/src/ATen/Context.h:4,
                 from ../aten/src/ATen/ATen.h:9,
                 from ../aten/src/ATen/native/BinaryOps.h:3,
                 from aten/src/ATen/native/cpu/BinaryOpsKernel.cpp.DEFAULT.cpp:1:
/usr/include/c++/8/cmath: In static member function ‘static Ret c10::function_ref<Ret(Params ...)>::callback_fn(intptr_t, Params ...) [with Callable = at::native::{anonymous}::cpu_kernel(at::TensorIterator&, func_t&&) [with func_t = at::native::{anonymous}::copysign_kernel(at::TensorIterator&)::<lambda()>::<lambda()>::<lambda(scalar_t, scalar_t)>]::<lambda(char**, const int64_t*, int64_t)>; Ret = void; Params = {char**, const long int*, long int}]’:
/usr/include/c++/8/cmath:1287:31: internal compiler error: Segmentation fault
   { return __builtin_copysignf(__x, __y); }
            ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-8/README.Bugs> for instructions.

cc @malfet @seemethere @walterddr

@malfet malfet added module: arm Related to ARM architectures builds of PyTorch. Includes Apple M1 module: build Build system issues labels Nov 4, 2020
@ejguan ejguan added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Nov 4, 2020
@malfet
Copy link
Contributor Author

malfet commented Nov 4, 2020

Can be fixed by replacing

AT_DISPATCH_FLOATING_TYPES_AND2(kBFloat16, kHalf, iter.common_dtype(), "copysign_cpu", [&]() {

with AT_DISPATCH_FLOATING_TYPES(iter.common_dtype(), "copysign_cpu", [&]() {

@ejguan ejguan self-assigned this Nov 4, 2020
@malfet malfet assigned malfet and unassigned ejguan Nov 4, 2020
malfet added a commit that referenced this issue Nov 5, 2020
This also fixes internal compiler error exceptions on aarch64 platforms, see #47395
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: arm Related to ARM architectures builds of PyTorch. Includes Apple M1 module: build Build system issues triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants