Repository: pytorch
Issue: Compile failed at allreduce without gloo
Labels: module: build,triaged

### 🐛 Describe the bug

```
(venv) home@daniel-tablet1:~/PycharmProjects/pytorch$ USE_GLOO=0 USE_VULKAN=1 USE_VULKAN_SHADERC_RUNTIME=1 USE_VULKAN_WRAPPER=0 CFLAGS='-Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=restrict' CXXFLAGS='-Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=restrict' python setup.py install
Building wheel torch-1.13.0a0+git3ee863c
-- Building version 1.13.0a0+git3ee863c
cmake --build . --target install --config Release
[5/225] Building CXX object third_party/kineto/libkineto/CMakeFiles/kineto_base.dir/src/AbstractConfig.cpp.o
In file included from /usr/include/c++/12/bits/stl_tree.h:63,
                 from /usr/include/c++/12/map:60,
                 from /home/home/PycharmProjects/pytorch/third_party/kineto/libkineto/include/AbstractConfig.h:6,
                 from /home/home/PycharmProjects/pytorch/third_party/kineto/libkineto/src/AbstractConfig.cpp:3:
In static member function ‘static _Tp* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(const _Tp*, const _Tp*, _Tp*) [with _Tp = char; bool _IsMove = false]’,
    inlined from ‘_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = const char*; _OI = char*]’ at /usr/include/c++/12/bits/stl_algobase.h:495:30,
    inlined from ‘_OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = const char*; _OI = char*]’ at /usr/include/c++/12/bits/stl_algobase.h:522:42,
    inlined from ‘_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = const char*; _OI = char*]’ at /usr/include/c++/12/bits/stl_algobase.h:529:31,
    inlined from ‘_OI std::copy(_II, _II, _OI) [with _II = const char*; _OI = char*]’ at /usr/include/c++/12/bits/stl_algobase.h:620:7,
    inlined from ‘OutputIt fmt::v7::detail::copy_str(InputIt, InputIt, OutputIt) [with OutChar = char; InputIt = const char*; OutputIt = char*; typename std::enable_if<(! std::integral_constant<bool, (std::is_same<typename std::iterator_traits<_II>::value_type, char>::value && std::is_same<OutChar, char8_type>::value)>::value), int>::type <anonymous> = 0]’ at /home/home/PycharmProjects/pytorch/third_party/fmt/include/fmt/format.h:548:19,
    inlined from ‘It fmt::v7::detail::float_writer<Char>::prettify(It) const [with It = char*; Char = char]’ at /home/home/PycharmProjects/pytorch/third_party/fmt/include/fmt/format.h:1128:26,
    inlined from ‘It fmt::v7::detail::float_writer<Char>::operator()(It) const [with It = char*; Char = char]’ at /home/home/PycharmProjects/pytorch/third_party/fmt/include/fmt/format.h:1213:20,
    inlined from ‘OutputIt fmt::v7::detail::write(OutputIt, T) [with Char = char; OutputIt = std::back_insert_iterator<buffer<char> >; T = double; typename std::enable_if<std::is_floating_point<T>::value, int>::type <anonymous> = 0]’ at /home/home/PycharmProjects/pytorch/third_party/fmt/include/fmt/format.h:1702:23:
/usr/include/c++/12/bits/stl_algobase.h:431:30: warning: ‘void* __builtin_memmove(void*, const void*, long unsigned int)’ specified bound between 18446744071562067967 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
  431 |             __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
      |             ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[12/225] Building CXX object third_party/kineto/libkineto/CMakeFiles/kineto_base.dir/src/Logger.cpp.o
/home/home/PycharmProjects/pytorch/third_party/kineto/libkineto/src/Logger.cpp:28:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
   28 | #pragma GCC diagnostic ignored "-Wglobal-constructors"
      |                                ^~~~~~~~~~~~~~~~~~~~~~~
/home/home/PycharmProjects/pytorch/third_party/kineto/libkineto/src/Logger.cpp:28:32: note: did you mean ‘-felide-constructors’?
[16/225] Building CXX object test_cpp_c10d/CMakeFiles/example_allreduce.dir/example/allreduce.cpp.o
FAILED: test_cpp_c10d/CMakeFiles/example_allreduce.dir/example/allreduce.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DHAVE_MALLOC_USABLE_SIZE=1 -DHAVE_MMAP=1 -DHAVE_SHM_OPEN=1 -DHAVE_SHM_UNLINK=1 -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -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 -I/home/home/PycharmProjects/pytorch/build/aten/src -I/home/home/PycharmProjects/pytorch/aten/src -I/home/home/PycharmProjects/pytorch/build -I/home/home/PycharmProjects/pytorch -I/home/home/PycharmProjects/pytorch/cmake/../third_party/benchmark/include -I/home/home/PycharmProjects/pytorch/third_party/onnx -I/home/home/PycharmProjects/pytorch/build/third_party/onnx -I/home/home/PycharmProjects/pytorch/third_party/foxi -I/home/home/PycharmProjects/pytorch/build/third_party/foxi -I/home/home/PycharmProjects/pytorch/torch/csrc/distributed -I/home/home/PycharmProjects/pytorch/torch/csrc/api -I/home/home/PycharmProjects/pytorch/torch/csrc/api/include -I/home/home/PycharmProjects/pytorch/c10/.. -isystem /home/home/PycharmProjects/pytorch/cmake/../third_party/googletest/googlemock/include -isystem /home/home/PycharmProjects/pytorch/cmake/../third_party/googletest/googletest/include -isystem /home/home/PycharmProjects/pytorch/third_party/protobuf/src -isystem /home/home/PycharmProjects/pytorch/third_party/gemmlowp -isystem /home/home/PycharmProjects/pytorch/third_party/neon2sse -isystem /home/home/PycharmProjects/pytorch/third_party/XNNPACK/include -isystem /home/home/PycharmProjects/pytorch/cmake/../third_party/eigen -isystem /home/home/PycharmProjects/pytorch/third_party/ideep/mkl-dnn/third_party/oneDNN/include -isystem /home/home/PycharmProjects/pytorch/third_party/ideep/include -isystem /home/home/PycharmProjects/pytorch/third_party/ideep/mkl-dnn/include -Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=restrict -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_VULKAN -DUSE_VULKAN_API -DUSE_VULKAN_SHADERC_RUNTIME -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-unused-parameter -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 -fPIE -DTH_HAVE_THREAD -std=gnu++14 -MD -MT test_cpp_c10d/CMakeFiles/example_allreduce.dir/example/allreduce.cpp.o -MF test_cpp_c10d/CMakeFiles/example_allreduce.dir/example/allreduce.cpp.o.d -o test_cpp_c10d/CMakeFiles/example_allreduce.dir/example/allreduce.cpp.o -c /home/home/PycharmProjects/pytorch/test/cpp/c10d/example/allreduce.cpp
/home/home/PycharmProjects/pytorch/test/cpp/c10d/example/allreduce.cpp: In function ‘int main(int, char**)’:
/home/home/PycharmProjects/pytorch/test/cpp/c10d/example/allreduce.cpp:11:3: error: ‘ProcessGroupGloo’ was not declared in this scope
   11 |   ProcessGroupGloo pg(store, rank, size);
      |   ^~~~~~~~~~~~~~~~
/home/home/PycharmProjects/pytorch/test/cpp/c10d/example/allreduce.cpp:18:13: error: ‘ones’ is not a member of ‘at’
   18 |         at::ones({1000, 16 * (i + 1)}, at::TensorOptions(at::CPU(at::kFloat)));
      |             ^~~~
/home/home/PycharmProjects/pytorch/test/cpp/c10d/example/allreduce.cpp:18:62: error: ‘CPU’ is not a member of ‘at’
   18 |         at::ones({1000, 16 * (i + 1)}, at::TensorOptions(at::CPU(at::kFloat)));
      |                                                              ^~~
/home/home/PycharmProjects/pytorch/test/cpp/c10d/example/allreduce.cpp:18:62: note: suggested alternatives:
In file included from /home/home/PycharmProjects/pytorch/c10/core/Layout.h:3,
                 from /home/home/PycharmProjects/pytorch/build/aten/src/ATen/core/TensorBody.h:12,
                 from /home/home/PycharmProjects/pytorch/aten/src/ATen/core/jit_type.h:5,
                 from /home/home/PycharmProjects/pytorch/aten/src/ATen/core/function_schema.h:6,
                 from /home/home/PycharmProjects/pytorch/aten/src/ATen/core/function.h:3,
                 from /home/home/PycharmProjects/pytorch/aten/src/ATen/core/builtin_function.h:3,
                 from /home/home/PycharmProjects/pytorch/torch/custom_class.h:3,
                 from /home/home/PycharmProjects/pytorch/torch/csrc/distributed/c10d/Store.hpp:10,
                 from /home/home/PycharmProjects/pytorch/torch/csrc/distributed/c10d/FileStore.hpp:8,
                 from /home/home/PycharmProjects/pytorch/test/cpp/c10d/example/allreduce.cpp:2:
/home/home/PycharmProjects/pytorch/c10/core/Backend.h:30:3: note:   ‘c10::Backend::CPU’
   30 |   CPU,
      |   ^~~
In file included from /home/home/PycharmProjects/pytorch/c10/core/Backend.h:4:
/home/home/PycharmProjects/pytorch/c10/core/DispatchKey.h:401:3: note:   ‘c10::DispatchKey::CPU’
  401 |   CPU, // registered at build/aten/src/ATen/RegisterCPU.cpp
      |   ^~~
In file included from /home/home/PycharmProjects/pytorch/c10/core/Device.h:3,
                 from /home/home/PycharmProjects/pytorch/build/aten/src/ATen/core/TensorBody.h:11:
/home/home/PycharmProjects/pytorch/c10/core/DeviceType.h:16:3: note:   ‘c10::DeviceType::CPU’
   16 |   CPU = 0,
      |   ^~~
/home/home/PycharmProjects/pytorch/test/cpp/c10d/example/allreduce.cpp:23:34: error: ‘ProcessGroup’ was not declared in this scope
   23 |   std::vector<c10::intrusive_ptr<ProcessGroup::Work>> pending;
      |                                  ^~~~~~~~~~~~
/home/home/PycharmProjects/pytorch/test/cpp/c10d/example/allreduce.cpp:23:52: error: template argument 1 is invalid
   23 |   std::vector<c10::intrusive_ptr<ProcessGroup::Work>> pending;
      |                                                    ^~
/home/home/PycharmProjects/pytorch/test/cpp/c10d/example/allreduce.cpp:23:52: error: template argument 2 is invalid
/home/home/PycharmProjects/pytorch/test/cpp/c10d/example/allreduce.cpp:23:55: error: template argument 1 is invalid
   23 |   std::vector<c10::intrusive_ptr<ProcessGroup::Work>> pending;
      |                                                       ^~~~~~~
/home/home/PycharmProjects/pytorch/test/cpp/c10d/example/allreduce.cpp:23:55: error: template argument 2 is invalid
/home/home/PycharmProjects/pytorch/test/cpp/c10d/example/allreduce.cpp:26:5: error: ‘pending’ was not declared in this scope
   26 |     pending.push_back(pg.allreduce(tmp));
      |     ^~~~~~~
/home/home/PycharmProjects/pytorch/test/cpp/c10d/example/allreduce.cpp:26:23: error: ‘pg’ was not declared in this scope
   26 |     pending.push_back(pg.allreduce(tmp));
      |                       ^~
/home/home/PycharmProjects/pytorch/test/cpp/c10d/example/allreduce.cpp:30:21: error: ‘pending’ was not declared in this scope
   30 |   for (auto& work : pending) {
      |                     ^~~~~~~
/home/home/PycharmProjects/pytorch/test/cpp/c10d/example/allreduce.cpp:8:7: warning: unused variable ‘rank’ [-Wunused-variable]
    8 |   int rank = atoi(getenv("RANK"));
      |       ^~~~
[25/225] Building CXX object test_api/CMakeFiles/test_api.dir/autograd.cpp.o
ninja: build stopped: subcommand failed.
```

```
(venv) home@daniel-tablet1:~/PycharmProjects/pytorch$ git rev-parse HEAD
3ee863cb7c07699b94e36715a82a25744560f2d9
(venv) home@daniel-tablet1:~/PycharmProjects/pytorch$ git submodule status --recursive
 7e1e1fe3858c63c251c637ae41a20de425dde96f android/libs/fbjni (v0.1.0-12-g7e1e1fe)
 4dfe081cf6bcd15db339cf2680b9281b8451eeb3 third_party/FP16 (4dfe081)
 b408327ac2a15ec3e43352421954f5b1967701d1 third_party/FXdiv (b408327)
 c07e3a0400713d546e0dea2d5466dd22ea389c73 third_party/NNPACK (heads/master)
 7d2a4e9931a82adc3814275b6219a03e24e36b4c third_party/QNNPACK (heads/master)
 ae108ef49aa5623b896fc93d4298c49d1750d9ba third_party/XNNPACK (remotes/origin/test_294865623-2079-gae108ef49)
 e991355c02b93fe17713efe04cbc2e278e00fdbd third_party/benchmark (v1.5.5)
 5916273f79a21551890fd3d56fc5375a78d1598d third_party/cpuinfo (5916273)
 d106ddb991a56c3df1b6d51b2409e36ba8181ce4 third_party/cub (1.9.10)
 43709ab96c47e26eebcdac72f93f946d44ceffa8 third_party/cudnn_frontend (v0.5-4-g43709ab)
 3147391d946bb4b6c68edd901f2add6ac1f31f8c third_party/eigen (3.4.0)
 2e9be65810107a9595da717f95d21924b73be833 third_party/fbgemm (v0.2.0~102)
 8b35b4cffb62ecb58a903bf91cb7537d7a672211 third_party/fbgemm/third_party/asmjit (8b35b4c)
 ed8b86a253800bafdb7b25c5c399f91bff9cb1f3 third_party/fbgemm/third_party/cpuinfo (ed8b86a)
 cbf019de22c8dd37b2108da35b2748fd702d1796 third_party/fbgemm/third_party/googletest (release-1.8.0-2102-gcbf019de)
 d0cede9c90c5257537c293517a21376408b549fa third_party/flatbuffers (v2.0.5)
 cd4af11efc9c622896a3e4cb599fa28668ca3d05 third_party/fmt (7.0.3)
 c278588e34e535f0bb8f00df3880d26928038cad third_party/foxi (heads/master)
 3fb5c176c17c765a3492cd2f0321b0dab712f350 third_party/gemmlowp/gemmlowp (remotes/origin/revert-87-master-135-g3fb5c17)
 c22a5cfba94edf8ea4f53a174d38aa0c629d070f third_party/gloo (c22a5cf)
 e2239ee6043f73722e7aa812a459f54a28552929 third_party/googletest (release-1.8.0-2745-ge2239ee6)
 02b17c5748c9349dcc586c359af800c684d9b1ab third_party/ideep (pytorch-rls-v2.6.0)
 888a87a954e4fddb4d81fd10858eb834f2441b46 third_party/ideep/mkl-dnn (graph-v0.5)
 52b5f107dd9cf10910aaa19cb47f3abf9b349815 third_party/ideep/mkl-dnn/third_party/oneDNN (v0.1-rc-8734-g52b5f107d)
 8abaed637d56f1337d6e1d2c4026e25c1eade724 third_party/ios-cmake (heads/master)
 f708eb0cb8b97c54ef631ba48c8e2ca76ff6c62e third_party/kineto (f708eb0)
 2591ab91c3898c9f6544fff04660276537d32ffd third_party/kineto/libkineto/third_party/fmt (7.0.3-165-g2591ab91)
 7aca84427f224eeed3144123d5230d5871e93347 third_party/kineto/libkineto/third_party/googletest (release-1.8.0-2484-g7aca8442)
 7e515921295adaab72adf56ea71a0fafb0ecb5f3 third_party/nccl/nccl (v2.10.3-1)
 97a126f08ce318023be604d03f88bf0820a9464a third_party/neon2sse (97a126f)
 96046b8ccfb8e6fa82f6b2b34b3d56add2e8849c third_party/onnx (v1.11.0)
 e776aa0275e293707b6a0901e0e8d8a8a3679508 third_party/onnx/third_party/benchmark (v1.4.0-19-ge776aa0)
 59a2ac2745d8a57ac94c6accced73620d59fb844 third_party/onnx/third_party/pybind11 (v2.6.0)
 c153211418a7c57ce071d9ce2a41f8d1c85a878f third_party/onnx-tensorrt (release/6.0-2-gc153211)
 765f5ee823a67a866f4bd28a9860e81f3c811ce8 third_party/onnx-tensorrt/third_party/onnx (v1.3.0-142-g765f5ee8)
 e776aa0275e293707b6a0901e0e8d8a8a3679508 third_party/onnx-tensorrt/third_party/onnx/third_party/benchmark (v1.4.0-19-ge776aa0)
 a1041190c8b8ff0cd9e2f0752248ad5e3789ea0c third_party/onnx-tensorrt/third_party/onnx/third_party/pybind11 (v2.0.0-353-ga1041190)
 6a00cbc4a9b8e68b71caf7f774b3f9c753ae84d5 third_party/onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang (6a00cbc)
 ea778e37710c07723435b1be58235996d1d43a5a third_party/pocketfft (release_for_eigen)
 d1eca4e4b421cd2997495c4b4e65cea6be4e9b8a third_party/protobuf (v3.7.0-rc.2-1279-gd1eca4e4b)
 5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8 third_party/protobuf/third_party/benchmark (v1.2.0)
 5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081 third_party/protobuf/third_party/googletest (release-1.8.0-1696-g5ec7f0c4)
 072586a71b55b7f8c584153d223e95687148a900 third_party/psimd (heads/master)
 a134dd5d4cee80cce15db81a72e7f929d71dd413 third_party/pthreadpool (0.1-128-ga134dd5)
 8de7772cc72daca8e947b79b83fea46214931604 third_party/pybind11 (v2.6.2)
 4cfedc426c4e2fc52e3f5c2b4297e15ed8d6b8c7 third_party/python-enum (heads/master)
 f45429b087dd7d5bc78bb40dc7cf06425c252d67 third_party/python-peachpy (remotes/origin/pre-generated)
 15e31431af97e5e64b80af0a3f598d382bcdd49a third_party/python-six (1.11.0)
 e0a003ee838b75d11763aa9c3ef17bf71a725bff third_party/sleef (3.5.1-30-ge0a003e)
 a51a90bc609bb73db8ea13841b5cf7aa4344d4a9 third_party/tbb (2018_U6)
 52791a2fd214b2a9dc5759d36725909c1daa7f2e third_party/tensorpipe (remotes/origin/gh/beauby/37/base)
 aee0f9d9b5b87796ee8a0ab26b7587ec30e8858e third_party/tensorpipe/third_party/googletest (release-1.8.0-2420-gaee0f9d9)
 910b55815be16109f04f4180e9adee14fb4ce281 third_party/tensorpipe/third_party/libnop (910b558)
 1dff88e5161cba5c59276d2070d2e304e4dcb242 third_party/tensorpipe/third_party/libuv (v1.41.0)
 a23996fce38ff6ccfbcdc09f1e63f2c4be5ea2ef third_party/tensorpipe/third_party/pybind11 (v2.2.4-1-ga23996fc)
 6a00cbc4a9b8e68b71caf7f774b3f9c753ae84d5 third_party/tensorpipe/third_party/pybind11/tools/clang (6a00cbc)
 aec56a52fbab207fc639a1937d1e708a282edca8 third_party/zstd (fuzz-corpora-170-gaec56a52)
(venv) home@daniel-tablet1:~/PycharmProjects/pytorch$ pip freeze
astunparse==1.6.3
certifi==2022.9.24
cffi==1.15.1
charset-normalizer==2.1.1
cmake==3.24.1.1
dataclasses==0.6
ffmpeg-python==0.2.0
filelock==3.8.0
future==0.18.2
huggingface-hub==0.10.0
idna==3.4
intel-openmp==2022.2.0
mkl==2022.2.0
mkl-include==2022.2.0
more-itertools==8.14.0
ninja==1.10.2.4
numpy==1.23.3
packaging==21.3
pycparser==2.21
pyparsing==3.0.9
PyYAML==6.0
regex==2022.9.13
requests==2.28.1
six==1.16.0
tbb==2021.7.0
tokenizers==0.12.1
torch==1.12.1
tqdm==4.64.1
transformers==4.22.2
typing_extensions==4.4.0
urllib3==1.26.12
-e git+ssh://git@github.com/openai/whisper.git@9e653bd0ea0f1e9493cb4939733e9de249493cfb#egg=whisper
```

### Versions

```
(venv) home@daniel-tablet1:~/PycharmProjects$ python3 ./collect_env.py
Collecting environment information...
PyTorch version: 1.12.1+cu102
Is debug build: False
CUDA used to build PyTorch: 10.2
ROCM used to build PyTorch: N/A

OS: Ubuntu Kinetic Kudu (development branch) (x86_64)
GCC version: (Ubuntu 12.2.0-3ubuntu1) 12.2.0
Clang version: 14.0.6-2
CMake version: version 3.24.1
Libc version: glibc-2.36

Python version: 3.10.7 (main, Sep  8 2022, 14:34:29) [GCC 12.2.0] (64-bit runtime)
Python platform: Linux-5.19.13-surface-x86_64-with-glibc2.36
Is CUDA available: False
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.23.3
[pip3] torch==1.12.1
[conda] Could not collect
```

I get a different error replacing `USE_GLOO=0` with `USE_DISTRIBUTED=0`:

```
(venv) home@daniel-tablet1:~/PycharmProjects/pytorch$ USE_DISTRIBUTED=0 USE_VULKAN=1 USE_VULKAN_SHADERC_RUNTIME=1 USE_VULKAN_WRAPPER=0 CFLAGS='-Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=restrict' CXXFLAGS='-Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=restrict' python setup.py install
Building wheel torch-1.13.0a0+git3ee863c
-- Building version 1.13.0a0+git3ee863c
cmake --build . --target install --config Release
[28/156] Building CXX object test_api/CMakeFiles/test_api.dir/dataloader.cpp.o
FAILED: test_api/CMakeFiles/test_api.dir/dataloader.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DHAVE_MALLOC_USABLE_SIZE=1 -DHAVE_MMAP=1 -DHAVE_SHM_OPEN=1 -DHAVE_SHM_UNLINK=1 -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DUSE_EXTERNAL_MZCRC -D_FILE_OFFSET_BITS=64 -I/home/home/PycharmProjects/pytorch/build/aten/src -I/home/home/PycharmProjects/pytorch/aten/src -I/home/home/PycharmProjects/pytorch/build -I/home/home/PycharmProjects/pytorch -I/home/home/PycharmProjects/pytorch/cmake/../third_party/benchmark/include -I/home/home/PycharmProjects/pytorch/third_party/onnx -I/home/home/PycharmProjects/pytorch/build/third_party/onnx -I/home/home/PycharmProjects/pytorch/third_party/foxi -I/home/home/PycharmProjects/pytorch/build/third_party/foxi -I/home/home/PycharmProjects/pytorch/build/caffe2/../aten/src -I/home/home/PycharmProjects/pytorch/torch/csrc/api -I/home/home/PycharmProjects/pytorch/torch/csrc/api/include -I/home/home/PycharmProjects/pytorch/c10/.. -isystem /home/home/PycharmProjects/pytorch/cmake/../third_party/googletest/googlemock/include -isystem /home/home/PycharmProjects/pytorch/cmake/../third_party/googletest/googletest/include -isystem /home/home/PycharmProjects/pytorch/third_party/protobuf/src -isystem /home/home/PycharmProjects/pytorch/third_party/gemmlowp -isystem /home/home/PycharmProjects/pytorch/third_party/neon2sse -isystem /home/home/PycharmProjects/pytorch/third_party/XNNPACK/include -isystem /home/home/PycharmProjects/pytorch/cmake/../third_party/eigen -isystem /home/home/PycharmProjects/pytorch/third_party/ideep/mkl-dnn/third_party/oneDNN/include -isystem /home/home/PycharmProjects/pytorch/third_party/ideep/include -isystem /home/home/PycharmProjects/pytorch/third_party/ideep/mkl-dnn/include -isystem /home/home/PycharmProjects/pytorch/third_party/googletest/googletest/include -isystem /home/home/PycharmProjects/pytorch/third_party/googletest/googletest -Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=restrict -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_VULKAN -DUSE_VULKAN_API -DUSE_VULKAN_SHADERC_RUNTIME -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-unused-parameter -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 -fPIE -DTH_HAVE_THREAD -Wno-unused-variable -Wno-maybe-uninitialized -Wno-unused-but-set-parameter -std=gnu++14 -MD -MT test_api/CMakeFiles/test_api.dir/dataloader.cpp.o -MF test_api/CMakeFiles/test_api.dir/dataloader.cpp.o.d -o test_api/CMakeFiles/test_api.dir/dataloader.cpp.o -c /home/home/PycharmProjects/pytorch/test/cpp/api/dataloader.cpp
In file included from /usr/include/c++/12/memory:63,
                 from /home/home/PycharmProjects/pytorch/third_party/googletest/googletest/include/gtest/gtest.h:57,
                 from /home/home/PycharmProjects/pytorch/test/cpp/api/dataloader.cpp:1:
In static member function ‘static _Tp* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(const _Tp*, const _Tp*, _Tp*) [with _Tp = long unsigned int; bool _IsMove = false]’,
    inlined from ‘_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = const long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/12/bits/stl_algobase.h:495:30,
    inlined from ‘_OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = const long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/12/bits/stl_algobase.h:522:42,
    inlined from ‘_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = __gnu_cxx::__normal_iterator<const long unsigned int*, vector<long unsigned int> >; _OI = __gnu_cxx::__normal_iterator<long unsigned int*, vector<long unsigned int> >]’ at /usr/include/c++/12/bits/stl_algobase.h:529:31,
    inlined from ‘_OI std::copy(_II, _II, _OI) [with _II = __gnu_cxx::__normal_iterator<const long unsigned int*, vector<long unsigned int> >; _OI = __gnu_cxx::__normal_iterator<long unsigned int*, vector<long unsigned int> >]’ at /usr/include/c++/12/bits/stl_algobase.h:620:7,
    inlined from ‘std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = long unsigned int; _Alloc = std::allocator<long unsigned int>]’ at /usr/include/c++/12/bits/vector.tcc:244:21:
/usr/include/c++/12/bits/stl_algobase.h:431:30: error: argument 1 null where non-null expected [-Werror=nonnull]
  431 |             __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
      |             ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/stl_algobase.h:431:30: note: in a call to built-in function ‘void* __builtin_memmove(void*, const void*, long unsigned int)’
cc1plus: some warnings being treated as errors
[37/156] Building CXX object test_lazy/CMakeFiles/test_lazy.dir/test_lazy_ops.cpp.o
/home/home/PycharmProjects/pytorch/test/cpp/lazy/test_lazy_ops.cpp: In lambda function:
/home/home/PycharmProjects/pytorch/test/cpp/lazy/test_lazy_ops.cpp:967:25: warning: ‘bool c10::isIntegralType(ScalarType)’ is deprecated: isIntegralType is deprecated. Please use the overload with 'includeBool' parameter instead. [-Wdeprecated-declarations]
  967 |           isIntegralType(type) ? torch::Scalar(1) : torch::Scalar(1.0);
      |           ~~~~~~~~~~~~~~^~~~~~
In file included from /home/home/PycharmProjects/pytorch/c10/core/Scalar.h:11,
                 from /home/home/PycharmProjects/pytorch/build/aten/src/ATen/core/TensorBody.h:16,
                 from /home/home/PycharmProjects/pytorch/aten/src/ATen/core/Tensor.h:3,
                 from /home/home/PycharmProjects/pytorch/aten/src/ATen/Tensor.h:3,
                 from /home/home/PycharmProjects/pytorch/torch/csrc/lazy/backend/backend_device.h:7,
                 from /home/home/PycharmProjects/pytorch/test/cpp/lazy/test_lazy_ops_util.h:4,
                 from /home/home/PycharmProjects/pytorch/test/cpp/lazy/test_lazy_ops.cpp:6:
/home/home/PycharmProjects/pytorch/c10/core/ScalarType.h:239:20: note: declared here
  239 | static inline bool isIntegralType(ScalarType t) {
      |                    ^~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
```

To avoid spamming, I pasted the error above instead of another issue and will try `BUILD_TEST=0`.

cc @malfet @seemethere