Compiling libtorch from Source on Mac Beyond v1.11.0
Labels: module: build, module: cpp, triaged, module: macos

### 🐛 Describe the bug

When building PyTorch from source using any commit past v1.11.0 - I get the same compiler errors from the aten package.

I'm using the command:

python setup.py develop

pytorch compiles fine from source when I use v1.11.0.

### Error logs

pytorch build errors

In file included from /Users/user/github/pytorch/aten/src/ATen/native/RNN.cpp:8:
In file included from /Users/user/github/pytorch/aten/src/ATen/native/quantized/cpu/qnnpack_utils.h:9:
/Users/user/github/pytorch/aten/src/ATen/native/quantized/cpu/xnnpack_utils.h:76:12: error: use of undeclared identifier 'xnn_create_deconvolution2d_nhwc_qs8'; did you mean 'xnn_create_convolution2d_nhwc_qs8'?
    return xnn_create_deconvolution2d_nhwc_qs8(
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           xnn_create_convolution2d_nhwc_qs8
/Users/user/gitlab/omg-pytorch-mac-arm64/torch/include/xnnpack.h:2004:17: note: 'xnn_create_convolution2d_nhwc_qs8' declared here
enum xnn_status xnn_create_convolution2d_nhwc_qs8(
                ^
In file included from /Users/user/github/pytorch/aten/src/ATen/native/RNN.cpp:8:
In file included from /Users/user/github/pytorch/aten/src/ATen/native/quantized/cpu/qnnpack_utils.h:9:
/Users/user/github/pytorch/aten/src/ATen/native/quantized/cpu/xnnpack_utils.h:183:12: error: use of undeclared identifier 'xnn_setup_deconvolution2d_nhwc_qs8'; did you mean 'xnn_setup_deconvolution2d_nhwc_qu8'?
    return xnn_setup_deconvolution2d_nhwc_qs8(
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           xnn_setup_deconvolution2d_nhwc_qu8
/Users/user/gitlab/omg-pytorch-mac-arm64/torch/include/xnnpack.h:2187:17: note: 'xnn_setup_deconvolution2d_nhwc_qu8' declared here
enum xnn_status xnn_setup_deconvolution2d_nhwc_qu8(
                ^
In file included from /Users/user/github/pytorch/aten/src/ATen/native/RNN.cpp:8:
In file included from /Users/user/github/pytorch/aten/src/ATen/native/quantized/cpu/qnnpack_utils.h:9:
/Users/user/github/pytorch/aten/src/ATen/native/quantized/cpu/xnnpack_utils.h:190:9: error: cannot initialize a parameter of type 'const uint8_t *' (aka 'const unsigned char *') with an lvalue of type 'const int8_t *' (aka 'const signed char *')
        inp,      /* const int8_t* input             */
        ^~~
/Users/user/gitlab/omg-pytorch-mac-arm64/torch/include/xnnpack.h:2194:18: note: passing argument to parameter 'input' here
  const uint8_t* input,
                 ^
[ 79%] Building CXX object caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/ReplicationPadding.cpp.o
[ 79%] Building CXX object caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/Resize.cpp.o
[ 79%] Building CXX object caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/RowwisePrune.cpp.o
3 errors generated.
gmake[2]: *** [caffe2/CMakeFiles/torch_cpu.dir/build.make:2871: caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/RNN.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:3516: caffe2/CMakeFiles/torch_cpu.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2




### Minified repro

_No response_

### Versions

Collecting environment information...
PyTorch version: 1.13.1
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 12.6 (arm64)
GCC version: Could not collect
Clang version: 13.0.0 (clang-1300.0.29.30)
CMake version: version 3.25.2
Libc version: N/A

Python version: 3.10.8 (main, Nov 24 2022, 08:08:27) [Clang 14.0.6 ] (64-bit runtime)
Python platform: macOS-12.6-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
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

CPU:
Apple M1

Versions of relevant libraries:
[pip3] numpy==1.23.5
[pip3] torch==1.13.1
[pip3] torchvision==0.14.1
[conda] numpy                     1.23.5          py310hb93e574_0
[conda] numpy-base                1.23.5          py310haf87e8b_0
[conda] pytorch                   1.13.1                 py3.10_0    pytorch
[conda] torch                     1.11.0a0+gitbc2c6ed           dev_0    <develop>
[conda] torchvision               0.14.1                py310_cpu    pytorch

cc @malfet @seemethere @jbschlosser @albanD @ezyang @soumith @msaroufim @wconstab @ngimel @bdhirsh