Repository: pytorch
Issue: Some system-installed headers are mistakenly used.
Labels: module: build,triaged

### 🐛 Describe the bug

When building with CMake+Ninja, as you can see in the log, some mismatching headers are in /usr/local/include, which was previously installed.
PyTorch should always use its own header.

```
FAILED: caffe2/torch/CMakeFiles/aot_compiler.dir/csrc/jit/mobile/nnc/aot_compiler.cpp.o 
ccache /opt/rh/devtoolset-9/root/usr/bin/g++ -DBUILDING_TESTS -DHAVE_MALLOC_USABLE_SIZE=1 -DHAVE_MMAP=1 -DHAVE_SHM_OPEN=1 -DHAVE_SHM_UNLINK=1 -DIDEEP_USE_MKL -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DTH_BLAS_MKL -DUSE_EXTERNAL_MZCRC -D_FILE_OFFSET_BITS=64 -Daot_compiler_EXPORTS -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/aten/src -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/aten/src -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build -I/media/Scratch/tmp.CbTC7vOeVV/pytorch -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/benchmark/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/cudnn_frontend/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/caffe2/contrib/aten -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/onnx -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/onnx -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/foxi -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/foxi -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/gloo -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/gloo -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/googletest/googlemock/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/googletest/googletest/include -isystem /opt/intel/oneapi/mkl/latest/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/gemmlowp -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/neon2sse -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/XNNPACK/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party -isystem /usr/local/include/opencv4 -isystem /usr/local/include/eigen3 -isystem /usr/include/python3.6m -isystem /usr/local/lib64/python3.6/site-packages/numpy/core/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/pybind11/include -isystem /usr/local/cuda/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/ideep/mkl-dnn/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/ideep/include -fdebug-prefix-map='/media/Scratch/tmp.CbTC7vOeVV'='/usr/local/src' -g1 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -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 -Wno-stringop-overflow -DHAVE_AVX512_CPU_DEFINITION -DHAVE_AVX2_CPU_DEFINITION -O3 -DNDEBUG -DNDEBUG -fPIC   -march=native -DCAFFE2_USE_GLOO -DCUDA_HAS_FP16=1 -DHAVE_GCC_GET_CPUID -DUSE_AVX -DUSE_AVX2 -DTH_HAVE_THREAD -std=gnu++14 -MD -MT caffe2/torch/CMakeFiles/aot_compiler.dir/csrc/jit/mobile/nnc/aot_compiler.cpp.o -MF caffe2/torch/CMakeFiles/aot_compiler.dir/csrc/jit/mobile/nnc/aot_compiler.cpp.o.d -o caffe2/torch/CMakeFiles/aot_compiler.dir/csrc/jit/mobile/nnc/aot_compiler.cpp.o -c /media/Scratch/tmp.CbTC7vOeVV/pytorch/torch/csrc/jit/mobile/nnc/aot_compiler.cpp
In file included from ../aten/src/ATen/Tensor.h:3,
                 from ../aten/src/ATen/Context.h:4,
                 from ../aten/src/ATen/ATen.h:9,
                 from ../torch/csrc/jit/ir/attributes.h:2,
                 from ../torch/csrc/jit/ir/ir.h:3,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.h:4,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.cpp:1:
/usr/local/include/ATen/core/TensorBody.h: In member function ‘const at::Tensor& at::Tensor::fw_grad(uint64_t) const’:
/usr/local/include/ATen/core/TensorBody.h:607:19: error: ‘struct c10::TensorImpl’ has no member named ‘fw_grad’; did you mean ‘_fw_grad’?
  607 |     return impl_->fw_grad(level, *this);
      |                   ^~~~~~~
      |                   _fw_grad
/usr/local/include/ATen/core/TensorBody.h: In member function ‘void at::Tensor::set_fw_grad(const at::Tensor&, uint64_t, bool)’:
/usr/local/include/ATen/core/TensorBody.h:615:12: error: ‘struct c10::TensorImpl’ has no member named ‘set_fw_grad’; did you mean ‘_set_fw_grad’?
  615 |     impl_->set_fw_grad(new_grad, *this, level, is_inplace_op);
      |            ^~~~~~~~~~~
      |            _set_fw_grad
In file included from ../aten/src/ATen/core/Formatting.h:4,
                 from ../aten/src/ATen/Formatting.h:1,
                 from ../aten/src/ATen/Utils.h:5,
                 from ../aten/src/ATen/Context.h:5,
                 from ../aten/src/ATen/ATen.h:9,
                 from ../torch/csrc/jit/ir/attributes.h:2,
                 from ../torch/csrc/jit/ir/ir.h:3,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.h:4,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.cpp:1:
../aten/src/ATen/core/Tensor.h: In constructor ‘at::OptionalTensorRef::OptionalTensorRef(const at::TensorBase&)’:
../aten/src/ATen/core/Tensor.h:16:22: error: ‘unsafe_borrow_t’ is not a member of ‘at::Tensor’
   16 |       : ref_(Tensor::unsafe_borrow_t{}, src) {
      |                      ^~~~~~~~~~~~~~~
In file included from ../c10/core/Device.h:5,
                 from ../c10/core/Allocator.h:6,
                 from ../aten/src/ATen/ATen.h:7,
                 from ../torch/csrc/jit/ir/attributes.h:2,
                 from ../torch/csrc/jit/ir/ir.h:3,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.h:4,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.cpp:1:
../aten/src/ATen/core/Tensor.h:17:38: error: invalid use of incomplete type ‘const class at::TensorBase’
   17 |     TORCH_INTERNAL_ASSERT_DEBUG_ONLY(src.defined());
      |                                      ^~~
../c10/util/Exception.h:241:39: note: in definition of macro ‘C10_EXPAND_MSVC_WORKAROUND’
  241 | #define C10_EXPAND_MSVC_WORKAROUND(x) x
      |                                       ^
../c10/util/Exception.h:261:34: note: in expansion of macro ‘C10_UNLIKELY’
  261 | #define C10_UNLIKELY_OR_CONST(e) C10_UNLIKELY(e)
      |                                  ^~~~~~~~~~~~
../c10/util/Exception.h:313:7: note: in expansion of macro ‘C10_UNLIKELY_OR_CONST’
  313 |   if (C10_UNLIKELY_OR_CONST(!(cond))) {                                         \
      |       ^~~~~~~~~~~~~~~~~~~~~
../c10/util/Exception.h:467:30: note: in expansion of macro ‘TORCH_INTERNAL_ASSERT’
  467 |   C10_EXPAND_MSVC_WORKAROUND(TORCH_INTERNAL_ASSERT(__VA_ARGS__))
      |                              ^~~~~~~~~~~~~~~~~~~~~
../aten/src/ATen/core/Tensor.h:17:5: note: in expansion of macro ‘TORCH_INTERNAL_ASSERT_DEBUG_ONLY’
   17 |     TORCH_INTERNAL_ASSERT_DEBUG_ONLY(src.defined());
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/ATen/core/TensorBody.h:13,
                 from ../aten/src/ATen/Tensor.h:3,
                 from ../aten/src/ATen/Context.h:4,
                 from ../aten/src/ATen/ATen.h:9,
                 from ../torch/csrc/jit/ir/attributes.h:2,
                 from ../torch/csrc/jit/ir/ir.h:3,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.h:4,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.cpp:1:
../c10/core/TensorImpl.h:41:7: note: forward declaration of ‘class at::TensorBase’
   41 | class TensorBase;
      |       ^~~~~~~~~~
In file included from ../aten/src/ATen/core/Formatting.h:4,
                 from ../aten/src/ATen/Formatting.h:1,
                 from ../aten/src/ATen/Utils.h:5,
                 from ../aten/src/ATen/Context.h:5,
                 from ../aten/src/ATen/ATen.h:9,
                 from ../torch/csrc/jit/ir/attributes.h:2,
                 from ../torch/csrc/jit/ir/ir.h:3,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.h:4,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.cpp:1:
../aten/src/ATen/core/Tensor.h: In copy constructor ‘at::OptionalTensorRef::OptionalTensorRef(const at::OptionalTensorRef&)’:
../aten/src/ATen/core/Tensor.h:21:22: error: ‘unsafe_borrow_t’ is not a member of ‘at::Tensor’
   21 |       : ref_(Tensor::unsafe_borrow_t{}, rhs.ref_) {}
      |                      ^~~~~~~~~~~~~~~
../aten/src/ATen/core/Tensor.h: At global scope:
../aten/src/ATen/core/Tensor.h:53:6: error: redefinition of ‘at::Tensor::hook_return_void_t<T> at::Tensor::register_hook(T&&) const’
   53 | auto Tensor::register_hook(T&& hook) const -> Tensor::hook_return_void_t<T> {
      |      ^~~~~~
In file included from ../aten/src/ATen/Tensor.h:3,
                 from ../aten/src/ATen/Context.h:4,
                 from ../aten/src/ATen/ATen.h:9,
                 from ../torch/csrc/jit/ir/attributes.h:2,
                 from ../torch/csrc/jit/ir/ir.h:3,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.h:4,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.cpp:1:
/usr/local/include/ATen/core/TensorBody.h:1441:6: note: ‘at::Tensor::hook_return_void_t<T> at::Tensor::register_hook(T&&) const’ previously declared here
 1441 | auto Tensor::register_hook(T&& hook) const -> Tensor::hook_return_void_t<T> {
      |      ^~~~~~
In file included from ../aten/src/ATen/core/Formatting.h:4,
                 from ../aten/src/ATen/Formatting.h:1,
                 from ../aten/src/ATen/Utils.h:5,
                 from ../aten/src/ATen/Context.h:5,
                 from ../aten/src/ATen/ATen.h:9,
                 from ../torch/csrc/jit/ir/attributes.h:2,
                 from ../torch/csrc/jit/ir/ir.h:3,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.h:4,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.cpp:1:
../aten/src/ATen/core/Tensor.h:66:6: error: redefinition of ‘at::Tensor::hook_return_var_t<T> at::Tensor::register_hook(T&&) const’
   66 | auto Tensor::register_hook(T&& hook) const -> Tensor::hook_return_var_t<T> {
      |      ^~~~~~
In file included from ../aten/src/ATen/Tensor.h:3,
                 from ../aten/src/ATen/Context.h:4,
                 from ../aten/src/ATen/ATen.h:9,
                 from ../torch/csrc/jit/ir/attributes.h:2,
                 from ../torch/csrc/jit/ir/ir.h:3,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.h:4,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.cpp:1:
/usr/local/include/ATen/core/TensorBody.h:1452:6: note: ‘at::Tensor::hook_return_var_t<T> at::Tensor::register_hook(T&&) const’ previously declared here
 1452 | auto Tensor::register_hook(T&& hook) const -> Tensor::hook_return_var_t<T> {
      |      ^~~~~~
In file included from ../c10/util/intrusive_ptr.h:6,
                 from ../c10/core/StorageImpl.h:6,
                 from ../c10/core/Storage.h:3,
                 from /usr/local/include/ATen/core/TensorBody.h:11,
                 from ../aten/src/ATen/Tensor.h:3,
                 from ../aten/src/ATen/Context.h:4,
                 from ../aten/src/ATen/ATen.h:9,
                 from ../torch/csrc/jit/ir/attributes.h:2,
                 from ../torch/csrc/jit/ir/ir.h:3,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.h:4,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.cpp:1:
../c10/util/MaybeOwned.h: In instantiation of ‘class c10::MaybeOwned<at::Tensor>’:
../aten/src/ATen/ExpandUtils.h:83:92:   required from here
../c10/util/MaybeOwned.h:61:9: error: invalid use of incomplete type ‘struct c10::MaybeOwnedTraits<at::Tensor>’
   61 |   using borrow_type = typename MaybeOwnedTraits<T>::borrow_type;
      |         ^~~~~~~~~~~
../c10/util/MaybeOwned.h:49:8: note: declaration of ‘struct c10::MaybeOwnedTraits<at::Tensor>’
   49 | struct MaybeOwnedTraits;
      |        ^~~~~~~~~~~~~~~~
../c10/util/MaybeOwned.h:62:9: error: invalid use of incomplete type ‘struct c10::MaybeOwnedTraits<at::Tensor>’
   62 |   using owned_type = typename MaybeOwnedTraits<T>::owned_type;
      |         ^~~~~~~~~~
../c10/util/MaybeOwned.h:49:8: note: declaration of ‘struct c10::MaybeOwnedTraits<at::Tensor>’
   49 | struct MaybeOwnedTraits;
      |        ^~~~~~~~~~~~~~~~
In file included from ../torch/csrc/utils/variadic.h:4,
                 from ../torch/csrc/jit/ir/named_value.h:6,
                 from ../torch/csrc/jit/ir/ir.h:5,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.h:4,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.cpp:1:
../torch/csrc/autograd/variable.h: In function ‘torch::autograd::Variable torch::autograd::make_variable(at::Tensor, bool, bool)’:
../torch/csrc/autograd/variable.h:692:29: error: ‘class at::Tensor’ has no member named ‘unsafeReleaseIntrusivePtr’
  692 |       auto data_impl = data.unsafeReleaseIntrusivePtr();
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../c10/util/intrusive_ptr.h:6,
                 from ../c10/core/StorageImpl.h:6,
                 from ../c10/core/Storage.h:3,
                 from /usr/local/include/ATen/core/TensorBody.h:11,
                 from ../aten/src/ATen/Tensor.h:3,
                 from ../aten/src/ATen/Context.h:4,
                 from ../aten/src/ATen/ATen.h:9,
                 from ../torch/csrc/jit/ir/attributes.h:2,
                 from ../torch/csrc/jit/ir/ir.h:3,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.h:4,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.cpp:1:
../c10/util/MaybeOwned.h: In instantiation of ‘static c10::MaybeOwned<T> c10::MaybeOwned<T>::borrowed(const T&) [with T = at::Tensor]’:
../aten/src/ATen/ExpandUtils.h:85:37:   required from here
../c10/util/MaybeOwned.h:161:12: error: no matching function for call to ‘c10::MaybeOwned<at::Tensor>::MaybeOwned(const at::Tensor&)’
  161 |     return MaybeOwned(t);
      |            ^~~~~~~~~~~~~
../c10/util/MaybeOwned.h:124:3: note: candidate: ‘c10::MaybeOwned<T>::MaybeOwned(c10::MaybeOwned<T>&&) [with T = at::Tensor]’
  124 |   MaybeOwned(MaybeOwned&& rhs) noexcept(
      |   ^~~~~~~~~~
../c10/util/MaybeOwned.h:124:27: note:   no known conversion for argument 1 from ‘const at::Tensor’ to ‘c10::MaybeOwned<at::Tensor>&&’
  124 |   MaybeOwned(MaybeOwned&& rhs) noexcept(
      |              ~~~~~~~~~~~~~^~~
../c10/util/MaybeOwned.h:91:3: note: candidate: ‘c10::MaybeOwned<T>::MaybeOwned(const c10::MaybeOwned<T>&) [with T = at::Tensor]’
   91 |   MaybeOwned(const MaybeOwned& rhs) : isBorrowed_(rhs.isBorrowed_) {
      |   ^~~~~~~~~~
../c10/util/MaybeOwned.h:91:32: note:   no known conversion for argument 1 from ‘const at::Tensor’ to ‘const c10::MaybeOwned<at::Tensor>&’
   91 |   MaybeOwned(const MaybeOwned& rhs) : isBorrowed_(rhs.isBorrowed_) {
      |              ~~~~~~~~~~~~~~~~~~^~~
../c10/util/MaybeOwned.h:85:12: note: candidate: ‘c10::MaybeOwned<T>::MaybeOwned() [with T = at::Tensor]’
   85 |   explicit MaybeOwned() : isBorrowed_(true), borrow_() {}
      |            ^~~~~~~~~~
../c10/util/MaybeOwned.h:85:12: note:   candidate expects 0 arguments, 1 provided
../c10/util/MaybeOwned.h:81:12: note: candidate: ‘template<class ... Args> c10::MaybeOwned<T>::MaybeOwned(c10::in_place_t, Args&& ...)’
   81 |   explicit MaybeOwned(in_place_t, Args&&... args)
      |            ^~~~~~~~~~
../c10/util/MaybeOwned.h:81:12: note:   template argument deduction/substitution failed:
../c10/util/MaybeOwned.h:161:12: note:   cannot convert ‘t’ (type ‘const at::Tensor’) to type ‘c10::in_place_t’
  161 |     return MaybeOwned(t);
      |            ^~~~~~~~~~~~~
../c10/util/MaybeOwned.h:75:12: note: candidate: ‘c10::MaybeOwned<T>::MaybeOwned(T&&) [with T = at::Tensor]’ <near match>
   75 |   explicit MaybeOwned(T&& t) noexcept(
      |            ^~~~~~~~~~
../c10/util/MaybeOwned.h:75:12: note:   conversion of argument 1 would be ill-formed:
../c10/util/MaybeOwned.h:161:12: error: cannot bind rvalue reference of type ‘at::Tensor&&’ to lvalue of type ‘const at::Tensor’
  161 |     return MaybeOwned(t);
      |            ^~~~~~~~~~~~~
../c10/util/MaybeOwned.h: In instantiation of ‘c10::MaybeOwned<T>::~MaybeOwned() [with T = at::Tensor]’:
../aten/src/ATen/ExpandUtils.h:85:55:   required from here
../c10/util/MaybeOwned.h:176:7: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::own_’
  176 |       own_.~T();
      |       ^~~~
../c10/util/MaybeOwned.h:178:41: error: incomplete type ‘c10::MaybeOwnedTraits<at::Tensor>’ used in nested name specifier
  178 |       MaybeOwnedTraits<T>::destroyBorrow(borrow_);
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
../c10/util/MaybeOwned.h:178:42: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::borrow_’
  178 |       MaybeOwnedTraits<T>::destroyBorrow(borrow_);
      |                                          ^~~~~~~
../c10/util/MaybeOwned.h: In instantiation of ‘c10::MaybeOwned<T>::MaybeOwned(c10::MaybeOwned<T>&&) [with T = at::Tensor]’:
../aten/src/ATen/ExpandUtils.h:85:55:   required from here
../c10/util/MaybeOwned.h:128:40: error: incomplete type ‘c10::MaybeOwnedTraits<at::Tensor>’ used in nested name specifier
  128 |       MaybeOwnedTraits<T>::assignBorrow(borrow_, rhs.borrow_);
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
../c10/util/MaybeOwned.h:128:41: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::borrow_’
  128 |       MaybeOwnedTraits<T>::assignBorrow(borrow_, rhs.borrow_);
      |                                         ^~~~~~~
../c10/util/MaybeOwned.h:128:54: error: ‘class c10::MaybeOwned<at::Tensor>’ has no member named ‘borrow_’; did you mean ‘borrowed’?
  128 |       MaybeOwnedTraits<T>::assignBorrow(borrow_, rhs.borrow_);
      |                                                  ~~~~^~~~~~~
      |                                                  borrowed
../c10/util/MaybeOwned.h:130:13: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::own_’
  130 |       new (&own_) T(std::move(rhs.own_));
      |             ^~~~
../c10/util/MaybeOwned.h:130:35: error: ‘class c10::MaybeOwned<at::Tensor>’ has no member named ‘own_’
  130 |       new (&own_) T(std::move(rhs.own_));
      |                               ~~~~^~~~
../c10/util/MaybeOwned.h: In instantiation of ‘c10::MaybeOwned<T>::MaybeOwned() [with T = at::Tensor]’:
../aten/src/ATen/TensorIterator.h:71:17:   required from here
../c10/util/MaybeOwned.h:85:54: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::borrow_’
   85 |   explicit MaybeOwned() : isBorrowed_(true), borrow_() {}
      |                                                      ^
In file included from ../c10/core/Device.h:5,
                 from ../c10/core/Allocator.h:6,
                 from ../aten/src/ATen/ATen.h:7,
                 from ../torch/csrc/jit/ir/attributes.h:2,
                 from ../torch/csrc/jit/ir/ir.h:3,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.h:4,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.cpp:1:
../c10/util/MaybeOwned.h: In instantiation of ‘const T* c10::MaybeOwned<T>::operator->() const [with T = at::Tensor]’:
../aten/src/ATen/TensorIterator.h:73:15:   required from here
../c10/util/MaybeOwned.h:201:7: error: incomplete type ‘c10::MaybeOwnedTraits<at::Tensor>’ used in nested name specifier
  201 |       TORCH_INTERNAL_ASSERT_DEBUG_ONLY(
../c10/util/MaybeOwned.h:201:7: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::borrow_’
  201 |       TORCH_INTERNAL_ASSERT_DEBUG_ONLY(
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../c10/util/intrusive_ptr.h:6,
                 from ../c10/core/StorageImpl.h:6,
                 from ../c10/core/Storage.h:3,
                 from /usr/local/include/ATen/core/TensorBody.h:11,
                 from ../aten/src/ATen/Tensor.h:3,
                 from ../aten/src/ATen/Context.h:4,
                 from ../aten/src/ATen/ATen.h:9,
                 from ../torch/csrc/jit/ir/attributes.h:2,
                 from ../torch/csrc/jit/ir/ir.h:3,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.h:4,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.cpp:1:
../c10/util/MaybeOwned.h:205:49: error: incomplete type ‘c10::MaybeOwnedTraits<at::Tensor>’ used in nested name specifier
  205 |         ? MaybeOwnedTraits<T>::pointerFromBorrow(borrow_)
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
../c10/util/MaybeOwned.h:205:50: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::borrow_’
  205 |         ? MaybeOwnedTraits<T>::pointerFromBorrow(borrow_)
      |                                                  ^~~~~~~
../c10/util/MaybeOwned.h:206:12: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::own_’
  206 |         : &own_;
      |            ^~~~
In file included from ../c10/core/Device.h:5,
                 from ../c10/core/Allocator.h:6,
                 from ../aten/src/ATen/ATen.h:7,
                 from ../torch/csrc/jit/ir/attributes.h:2,
                 from ../torch/csrc/jit/ir/ir.h:3,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.h:4,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.cpp:1:
../c10/util/MaybeOwned.h: In instantiation of ‘const T& c10::MaybeOwned<T>::operator*() const & [with T = at::Tensor]’:
../aten/src/ATen/TensorIterator.h:202:64:   required from here
../c10/util/MaybeOwned.h:191:7: error: incomplete type ‘c10::MaybeOwnedTraits<at::Tensor>’ used in nested name specifier
  191 |       TORCH_INTERNAL_ASSERT_DEBUG_ONLY(
../c10/util/MaybeOwned.h:191:7: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::borrow_’
  191 |       TORCH_INTERNAL_ASSERT_DEBUG_ONLY(
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../c10/util/intrusive_ptr.h:6,
                 from ../c10/core/StorageImpl.h:6,
                 from ../c10/core/Storage.h:3,
                 from /usr/local/include/ATen/core/TensorBody.h:11,
                 from ../aten/src/ATen/Tensor.h:3,
                 from ../aten/src/ATen/Context.h:4,
                 from ../aten/src/ATen/ATen.h:9,
                 from ../torch/csrc/jit/ir/attributes.h:2,
                 from ../torch/csrc/jit/ir/ir.h:3,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.h:4,
                 from ../torch/csrc/jit/mobile/nnc/aot_compiler.cpp:1:
../c10/util/MaybeOwned.h:195:51: error: incomplete type ‘c10::MaybeOwnedTraits<at::Tensor>’ used in nested name specifier
  195 |         ? MaybeOwnedTraits<T>::referenceFromBorrow(borrow_)
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
../c10/util/MaybeOwned.h:195:52: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::borrow_’
  195 |         ? MaybeOwnedTraits<T>::referenceFromBorrow(borrow_)
      |                                                    ^~~~~~~
../c10/util/MaybeOwned.h:196:11: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::own_’
  196 |         : own_;
      |           ^~~~
../c10/util/MaybeOwned.h: In instantiation of ‘c10::MaybeOwned<T>::MaybeOwned(T&&) [with T = at::Tensor]’:
../c10/util/MaybeOwned.h:166:12:   required from ‘static c10::MaybeOwned<T> c10::MaybeOwned<T>::owned(T&&) [with T = at::Tensor]’
../aten/src/ATen/ExpandUtils.h:87:73:   required from here
../c10/util/MaybeOwned.h:77:46: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::own_’
   77 |       : isBorrowed_(false), own_(std::move(t)) {}
      |                                              ^
../c10/util/MaybeOwned.h: In instantiation of ‘c10::MaybeOwned<T>::MaybeOwned(c10::in_place_t, Args&& ...) [with Args = {}; T = at::Tensor]’:
../c10/util/MaybeOwned.h:171:12:   required from ‘static c10::MaybeOwned<T> c10::MaybeOwned<T>::owned(c10::in_place_t, Args&& ...) [with Args = {}; T = at::Tensor]’
../aten/src/ATen/TensorIterator.h:93:89:   required from here
../c10/util/MaybeOwned.h:82:61: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::own_’
   82 |       : isBorrowed_(false), own_(std::forward<Args>(args)...) {}
      |                                                             ^
../c10/util/MaybeOwned.h: In instantiation of ‘c10::MaybeOwned<T>& c10::MaybeOwned<T>::operator=(const c10::MaybeOwned<T>&) [with T = at::Tensor]’:
../aten/src/ATen/TensorIterator.h:69:18:   required from ‘static _OI std::__copy_move<false, false, std::random_access_iterator_tag>::__copy_m(_II, _II, _OI) [with _II = const at::OperandInfo*; _OI = at::OperandInfo*]’
/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/stl_algobase.h:404:30:   required from ‘_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = const at::OperandInfo*; _OI = at::OperandInfo*]’
/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/stl_algobase.h:441:30:   required from ‘_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = const at::OperandInfo*; _OI = at::OperandInfo*]’
/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/stl_algobase.h:474:7:   required from ‘_OI std::copy(_II, _II, _OI) [with _II = const at::OperandInfo*; _OI = at::OperandInfo*]’
../c10/util/SmallVector.h:827:25:   required from ‘c10::SmallVectorImpl<T>& c10::SmallVectorImpl<T>::operator=(const c10::SmallVectorImpl<T>&) [with T = at::OperandInfo]’
../c10/util/SmallVector.h:995:36:   required from ‘c10::SmallVector<T, N>::SmallVector(const c10::SmallVector<T, N>&) [with T = at::OperandInfo; unsigned int N = 4]’
../aten/src/ATen/TensorIterator.h:142:18:   required from here
../c10/util/MaybeOwned.h:105:9: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::own_’
  105 |         own_.~T();
      |         ^~~~
../c10/util/MaybeOwned.h:106:42: error: incomplete type ‘c10::MaybeOwnedTraits<at::Tensor>’ used in nested name specifier
  106 |         MaybeOwnedTraits<T>::assignBorrow(borrow_, rhs.borrow_);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
../c10/util/MaybeOwned.h:106:43: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::borrow_’
  106 |         MaybeOwnedTraits<T>::assignBorrow(borrow_, rhs.borrow_);
      |                                           ^~~~~~~
../c10/util/MaybeOwned.h:106:56: error: ‘const class c10::MaybeOwned<at::Tensor>’ has no member named ‘borrow_’; did you mean ‘borrowed’?
  106 |         MaybeOwnedTraits<T>::assignBorrow(borrow_, rhs.borrow_);
      |                                                    ~~~~^~~~~~~
      |                                                    borrowed
../c10/util/MaybeOwned.h:109:9: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::own_’
  109 |         own_ = rhs.own_;
      |         ^~~~
../c10/util/MaybeOwned.h:109:20: error: ‘const class c10::MaybeOwned<at::Tensor>’ has no member named ‘own_’
  109 |         own_ = rhs.own_;
      |                ~~~~^~~~
../c10/util/MaybeOwned.h:113:42: error: incomplete type ‘c10::MaybeOwnedTraits<at::Tensor>’ used in nested name specifier
  113 |         MaybeOwnedTraits<T>::assignBorrow(borrow_, rhs.borrow_);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
../c10/util/MaybeOwned.h:113:43: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::borrow_’
  113 |         MaybeOwnedTraits<T>::assignBorrow(borrow_, rhs.borrow_);
      |                                           ^~~~~~~
../c10/util/MaybeOwned.h:113:56: error: ‘const class c10::MaybeOwned<at::Tensor>’ has no member named ‘borrow_’; did you mean ‘borrowed’?
  113 |         MaybeOwnedTraits<T>::assignBorrow(borrow_, rhs.borrow_);
      |                                                    ~~~~^~~~~~~
      |                                                    borrowed
../c10/util/MaybeOwned.h:115:43: error: incomplete type ‘c10::MaybeOwnedTraits<at::Tensor>’ used in nested name specifier
  115 |         MaybeOwnedTraits<T>::destroyBorrow(borrow_);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
../c10/util/MaybeOwned.h:115:44: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::borrow_’
  115 |         MaybeOwnedTraits<T>::destroyBorrow(borrow_);
      |                                            ^~~~~~~
../c10/util/MaybeOwned.h:116:15: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::own_’
  116 |         new (&own_) T(rhs.own_);
      |               ^~~~
../c10/util/MaybeOwned.h:116:27: error: ‘const class c10::MaybeOwned<at::Tensor>’ has no member named ‘own_’
  116 |         new (&own_) T(rhs.own_);
      |                       ~~~~^~~~
../c10/util/MaybeOwned.h: In instantiation of ‘c10::MaybeOwned<T>::MaybeOwned(const c10::MaybeOwned<T>&) [with T = at::Tensor]’:
../aten/src/ATen/TensorIterator.h:69:18:   required from ‘void std::_Construct(_T1*, _Args&& ...) [with _T1 = at::OperandInfo; _Args = {const at::OperandInfo&}]’
/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/stl_uninitialized.h:83:18:   required from ‘static _ForwardIterator std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const at::OperandInfo*; _ForwardIterator = at::OperandInfo*; bool _TrivialValueTypes = false]’
/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/stl_uninitialized.h:140:15:   required from ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const at::OperandInfo*; _ForwardIterator = at::OperandInfo*]’
../c10/util/SmallVector.h:265:28:   required from ‘static void c10::SmallVectorTemplateBase<T, isPodLike>::uninitialized_copy(It1, It1, It2) [with It1 = const at::OperandInfo*; It2 = at::OperandInfo*; T = at::OperandInfo; bool isPodLike = false]’
../c10/util/SmallVector.h:854:3:   required from ‘c10::SmallVectorImpl<T>& c10::SmallVectorImpl<T>::operator=(const c10::SmallVectorImpl<T>&) [with T = at::OperandInfo]’
../c10/util/SmallVector.h:995:36:   required from ‘c10::SmallVector<T, N>::SmallVector(const c10::SmallVector<T, N>&) [with T = at::OperandInfo; unsigned int N = 4]’
../aten/src/ATen/TensorIterator.h:142:18:   required from here
../c10/util/MaybeOwned.h:93:40: error: incomplete type ‘c10::MaybeOwnedTraits<at::Tensor>’ used in nested name specifier
   93 |       MaybeOwnedTraits<T>::assignBorrow(borrow_, rhs.borrow_);
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
../c10/util/MaybeOwned.h:93:41: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::borrow_’
   93 |       MaybeOwnedTraits<T>::assignBorrow(borrow_, rhs.borrow_);
      |                                         ^~~~~~~
../c10/util/MaybeOwned.h:93:54: error: ‘const class c10::MaybeOwned<at::Tensor>’ has no member named ‘borrow_’; did you mean ‘borrowed’?
   93 |       MaybeOwnedTraits<T>::assignBorrow(borrow_, rhs.borrow_);
      |                                                  ~~~~^~~~~~~
      |                                                  borrowed
../c10/util/MaybeOwned.h:95:13: error: using invalid field ‘c10::MaybeOwned<T>::<unnamed union>::own_’
   95 |       new (&own_) T(rhs.own_);
      |             ^~~~
../c10/util/MaybeOwned.h:95:25: error: ‘const class c10::MaybeOwned<at::Tensor>’ has no member named ‘own_’
   95 |       new (&own_) T(rhs.own_);
      |                     ~~~~^~~~
[4039/6529] ccache /opt/rh/devtoolset-9/root/usr/bin/g++ -DDNNL_DLL -DDNNL_DLL_EXPORTS -DDNNL_ENABLE_CONCURRENT_EXEC -DDNNL_ENABLE_CPU_ISA_HINTS -DDNNL_ENABLE_ITT_TASKS -DDNNL_ENABLE_MAX_CPU_ISA -DDNNL_X64=1 -DIDEEP_USE_MKL -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DTH_BLAS_MKL -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/benchmark/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/cudnn_frontend/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/caffe2/contrib/aten -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/onnx -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/onnx -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/foxi -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/foxi -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/ideep/mkl-dnn/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/ideep/mkl-dnn/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/ideep/mkl-dnn/src -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/gloo -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/gloo -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/googletest/googlemock/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/googletest/googletest/include -isystem /opt/intel/oneapi/mkl/latest/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/gemmlowp -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/neon2sse -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/XNNPACK/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party -isystem /usr/local/include/opencv4 -isystem /usr/local/include/eigen3 -isystem /usr/include/python3.6m -isystem /usr/local/lib64/python3.6/site-packages/numpy/core/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/pybind11/include -isystem /usr/local/cuda/include -fdebug-prefix-map='/media/Scratch/tmp.CbTC7vOeVV'='/usr/local/src' -g1 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -fopenmp -fvisibility-inlines-hidden  -Wall -Wno-unknown-pragmas -fvisibility=internal -msse4.1 -fPIC -Wformat -Wformat-security -fstack-protector-strong -std=c++11  -Wmissing-field-initializers  -Wno-strict-overflow  -O3 -DNDEBUG -DNDEBUG -D_FORTIFY_SOURCE=2 -fPIC   -march=native -DCAFFE2_USE_GLOO -DCUDA_HAS_FP16=1 -DHAVE_GCC_GET_CPUID -DUSE_AVX -DUSE_AVX2 -std=gnu++14 -MD -MT third_party/ideep/mkl-dnn/src/cpu/CMakeFiles/dnnl_cpu.dir/rnn/ref_rnn.cpp.o -MF third_party/ideep/mkl-dnn/src/cpu/CMakeFiles/dnnl_cpu.dir/rnn/ref_rnn.cpp.o.d -o third_party/ideep/mkl-dnn/src/cpu/CMakeFiles/dnnl_cpu.dir/rnn/ref_rnn.cpp.o -c /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/ideep/mkl-dnn/src/cpu/rnn/ref_rnn.cpp
[4040/6529] ccache /opt/rh/devtoolset-9/root/usr/bin/g++ -DDNNL_DLL -DDNNL_DLL_EXPORTS -DDNNL_ENABLE_CONCURRENT_EXEC -DDNNL_ENABLE_CPU_ISA_HINTS -DDNNL_ENABLE_ITT_TASKS -DDNNL_ENABLE_MAX_CPU_ISA -DDNNL_X64=1 -DIDEEP_USE_MKL -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DTH_BLAS_MKL -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/benchmark/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/cudnn_frontend/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/caffe2/contrib/aten -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/onnx -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/onnx -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/foxi -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/foxi -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/ideep/mkl-dnn/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/ideep/mkl-dnn/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/ideep/mkl-dnn/src -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/gloo -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/gloo -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/googletest/googlemock/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/googletest/googletest/include -isystem /opt/intel/oneapi/mkl/latest/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/gemmlowp -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/neon2sse -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/XNNPACK/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party -isystem /usr/local/include/opencv4 -isystem /usr/local/include/eigen3 -isystem /usr/include/python3.6m -isystem /usr/local/lib64/python3.6/site-packages/numpy/core/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/pybind11/include -isystem /usr/local/cuda/include -fdebug-prefix-map='/media/Scratch/tmp.CbTC7vOeVV'='/usr/local/src' -g1 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -fopenmp -fvisibility-inlines-hidden  -Wall -Wno-unknown-pragmas -fvisibility=internal -msse4.1 -fPIC -Wformat -Wformat-security -fstack-protector-strong -std=c++11  -Wmissing-field-initializers  -Wno-strict-overflow  -O3 -DNDEBUG -DNDEBUG -D_FORTIFY_SOURCE=2 -fPIC   -march=native -DCAFFE2_USE_GLOO -DCUDA_HAS_FP16=1 -DHAVE_GCC_GET_CPUID -DUSE_AVX -DUSE_AVX2 -std=gnu++14 -MD -MT third_party/ideep/mkl-dnn/src/cpu/x64/CMakeFiles/dnnl_cpu_x64.dir/jit_uni_x8s8s32x_1x1_convolution.cpp.o -MF third_party/ideep/mkl-dnn/src/cpu/x64/CMakeFiles/dnnl_cpu_x64.dir/jit_uni_x8s8s32x_1x1_convolution.cpp.o.d -o third_party/ideep/mkl-dnn/src/cpu/x64/CMakeFiles/dnnl_cpu_x64.dir/jit_uni_x8s8s32x_1x1_convolution.cpp.o -c /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/ideep/mkl-dnn/src/cpu/x64/jit_uni_x8s8s32x_1x1_convolution.cpp
[4041/6529] ccache /opt/rh/devtoolset-9/root/usr/bin/g++ -DHAVE_MALLOC_USABLE_SIZE=1 -DHAVE_MMAP=1 -DHAVE_SHM_OPEN=1 -DHAVE_SHM_UNLINK=1 -DIDEEP_USE_MKL -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DTH_BLAS_MKL -DTORCH_API="" -DUSE_EXTERNAL_MZCRC -D_FILE_OFFSET_BITS=64 -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/aten/src -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/aten/src -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build -I/media/Scratch/tmp.CbTC7vOeVV/pytorch -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/benchmark/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/cudnn_frontend/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/caffe2/contrib/aten -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/onnx -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/onnx -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/foxi -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/foxi -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/gloo -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/gloo -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/googletest/googlemock/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/googletest/googletest/include -isystem /opt/intel/oneapi/mkl/latest/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/gemmlowp -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/neon2sse -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/XNNPACK/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party -isystem /usr/local/include/opencv4 -isystem /usr/local/include/eigen3 -isystem /usr/include/python3.6m -isystem /usr/local/lib64/python3.6/site-packages/numpy/core/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/pybind11/include -isystem /usr/local/cuda/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/ideep/mkl-dnn/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/ideep/include -fdebug-prefix-map='/media/Scratch/tmp.CbTC7vOeVV'='/usr/local/src' -g1 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -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 -Wno-stringop-overflow -DHAVE_AVX512_CPU_DEFINITION -DHAVE_AVX2_CPU_DEFINITION -O3 -DNDEBUG -DNDEBUG -fPIC   -march=native -DCAFFE2_USE_GLOO -DCUDA_HAS_FP16=1 -DHAVE_GCC_GET_CPUID -DUSE_AVX -DUSE_AVX2 -DTH_HAVE_THREAD -std=gnu++14 -MD -MT caffe2/proto/CMakeFiles/Caffe2_PROTO.dir/caffe2.pb.cc.o -MF caffe2/proto/CMakeFiles/Caffe2_PROTO.dir/caffe2.pb.cc.o.d -o caffe2/proto/CMakeFiles/Caffe2_PROTO.dir/caffe2.pb.cc.o -c /media/Scratch/tmp.CbTC7vOeVV/pytorch/build/caffe2/proto/caffe2.pb.cc
[4042/6529] ccache /opt/rh/devtoolset-9/root/usr/bin/g++ -DGFLAGS_IS_A_DLL=0 -DGOOGLE_GLOG_DLL_DECL="" -DGOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS="" -DHAVE_MALLOC_USABLE_SIZE=1 -DHAVE_MMAP=1 -DHAVE_SHM_OPEN=1 -DHAVE_SHM_UNLINK=1 -DIDEEP_USE_MKL -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DTH_BLAS_MKL -DUSE_EXTERNAL_MZCRC -D_FILE_OFFSET_BITS=64 -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/aten/src -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/aten/src -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build -I/media/Scratch/tmp.CbTC7vOeVV/pytorch -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/benchmark/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/cudnn_frontend/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/caffe2/contrib/aten -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/onnx -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/onnx -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/foxi -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/foxi -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/c10/.. -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/gloo -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/gloo -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/googletest/googlemock/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/googletest/googletest/include -isystem /opt/intel/oneapi/mkl/latest/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/gemmlowp -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/neon2sse -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/XNNPACK/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party -isystem /usr/local/include/opencv4 -isystem /usr/local/include/eigen3 -isystem /usr/include/python3.6m -isystem /usr/local/lib64/python3.6/site-packages/numpy/core/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/pybind11/include -isystem /usr/local/cuda/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/ideep/mkl-dnn/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/ideep/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/googletest/googlemock/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/googletest/googlemock -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/googletest/googletest/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/googletest/googletest -fdebug-prefix-map='/media/Scratch/tmp.CbTC7vOeVV'='/usr/local/src' -g1 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -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 -Wno-stringop-overflow -O3 -DNDEBUG -DNDEBUG -fPIE   -march=native -DCAFFE2_USE_GLOO -DCUDA_HAS_FP16=1 -DHAVE_GCC_GET_CPUID -DUSE_AVX -DUSE_AVX2 -DTH_HAVE_THREAD -pthread -std=gnu++14 -MD -MT c10/test/CMakeFiles/c10_either_test.dir/util/either_test.cpp.o -MF c10/test/CMakeFiles/c10_either_test.dir/util/either_test.cpp.o.d -o c10/test/CMakeFiles/c10_either_test.dir/util/either_test.cpp.o -c /media/Scratch/tmp.CbTC7vOeVV/pytorch/c10/test/util/either_test.cpp
[4043/6529] ccache /opt/rh/devtoolset-9/root/usr/bin/g++ -DGFLAGS_IS_A_DLL=0 -DGOOGLE_GLOG_DLL_DECL="" -DGOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS="" -DHAVE_MALLOC_USABLE_SIZE=1 -DHAVE_MMAP=1 -DHAVE_SHM_OPEN=1 -DHAVE_SHM_UNLINK=1 -DIDEEP_USE_MKL -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DTH_BLAS_MKL -DUSE_EXTERNAL_MZCRC -D_FILE_OFFSET_BITS=64 -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/aten/src -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/aten/src -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build -I/media/Scratch/tmp.CbTC7vOeVV/pytorch -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/benchmark/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/cudnn_frontend/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/caffe2/contrib/aten -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/onnx -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/onnx -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/foxi -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/foxi -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/c10/.. -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/build/third_party/gloo -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/gloo -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/googletest/googlemock/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/googletest/googletest/include -isystem /opt/intel/oneapi/mkl/latest/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/gemmlowp -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/neon2sse -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/XNNPACK/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party -isystem /usr/local/include/opencv4 -isystem /usr/local/include/eigen3 -isystem /usr/include/python3.6m -isystem /usr/local/lib64/python3.6/site-packages/numpy/core/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/pybind11/include -isystem /usr/local/cuda/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/ideep/mkl-dnn/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/ideep/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/googletest/googlemock/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/googletest/googlemock -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/googletest/googletest/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/googletest/googletest -fdebug-prefix-map='/media/Scratch/tmp.CbTC7vOeVV'='/usr/local/src' -g1 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -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 -Wno-stringop-overflow -O3 -DNDEBUG -DNDEBUG -fPIE   -march=native -DCAFFE2_USE_GLOO -DCUDA_HAS_FP16=1 -DHAVE_GCC_GET_CPUID -DUSE_AVX -DUSE_AVX2 -DTH_HAVE_THREAD -pthread -std=gnu++14 -MD -MT c10/test/CMakeFiles/c10_intrusive_ptr_test.dir/util/intrusive_ptr_test.cpp.o -MF c10/test/CMakeFiles/c10_intrusive_ptr_test.dir/util/intrusive_ptr_test.cpp.o.d -o c10/test/CMakeFiles/c10_intrusive_ptr_test.dir/util/intrusive_ptr_test.cpp.o -c /media/Scratch/tmp.CbTC7vOeVV/pytorch/c10/test/util/intrusive_ptr_test.cpp
[4044/6529] cd /media/Scratch/tmp.CbTC7vOeVV/pytorch && /usr/bin/python3 -m tools.codegen.gen --source-path /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../aten/src/ATen --install_dir /media/Scratch/tmp.CbTC7vOeVV/pytorch/build/aten/src/ATen
[4045/6529] ccache /opt/rh/devtoolset-9/root/usr/bin/g++ -DFBGEMM_STATIC -DTH_BLAS_MKL -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/cpuinfo/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/fbgemm/third_party/asmjit/src -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/fbgemm/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/fbgemm -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/benchmark/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/googletest/googlemock/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/googletest/googletest/include -isystem /opt/intel/oneapi/mkl/latest/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/gemmlowp -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/neon2sse -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/XNNPACK/include -fdebug-prefix-map='/media/Scratch/tmp.CbTC7vOeVV'='/usr/local/src' -g1 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -O3 -DNDEBUG -fPIC -fvisibility=hidden   -march=native -m64 -mavx2 -mf16c -mfma -std=c++14 -MD -MT third_party/fbgemm/CMakeFiles/fbgemm_avx2.dir/src/FbgemmI8DepthwiseAvx2.cc.o -MF third_party/fbgemm/CMakeFiles/fbgemm_avx2.dir/src/FbgemmI8DepthwiseAvx2.cc.o.d -o third_party/fbgemm/CMakeFiles/fbgemm_avx2.dir/src/FbgemmI8DepthwiseAvx2.cc.o -c /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/fbgemm/src/FbgemmI8DepthwiseAvx2.cc
[4046/6529] ccache /opt/rh/devtoolset-9/root/usr/bin/g++ -DFBGEMM_STATIC -DTH_BLAS_MKL -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/cpuinfo/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/fbgemm/third_party/asmjit/src -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/fbgemm/include -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/fbgemm -I/media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/benchmark/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/googletest/googlemock/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/cmake/../third_party/googletest/googletest/include -isystem /opt/intel/oneapi/mkl/latest/include -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/gemmlowp -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/neon2sse -isystem /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/XNNPACK/include -fdebug-prefix-map='/media/Scratch/tmp.CbTC7vOeVV'='/usr/local/src' -g1 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -O3 -DNDEBUG -fPIC -fvisibility=hidden   -march=native -m64 -mavx2 -mf16c -mfma -std=c++14 -MD -MT third_party/fbgemm/CMakeFiles/fbgemm_avx2.dir/src/FbgemmI8Depthwise3DAvx2.cc.o -MF third_party/fbgemm/CMakeFiles/fbgemm_avx2.dir/src/FbgemmI8Depthwise3DAvx2.cc.o.d -o third_party/fbgemm/CMakeFiles/fbgemm_avx2.dir/src/FbgemmI8Depthwise3DAvx2.cc.o -c /media/Scratch/tmp.CbTC7vOeVV/pytorch/third_party/fbgemm/src/FbgemmI8Depthwise3DAvx2.cc
ninja: build stopped: subcommand failed.
```

### Versions

This is specific to PyTorch v1.10 (We don't hav this issue in 1.8, not sure about 1.9)

cc @malfet @seemethere