Tons of compiler warnings since PyTorch 1.3.0

username: marcman411
cooked: <p>Ever since PyTorch 1.3.0 (I think), I get a bunch of compiler warnings around <code>torch/csrc/api/include/torch/nn/functional/padding.h</code> and <code>/torch/csrc/autograd/profiler.h</code> when compiling C++ and CUDA extensions. What’s the issue here? Is it something I can address or is this a PyTorch issue? It doesn’t seem to affect functionality when using the compiled extensions, but the compiler warnings are kind of annoying. At the very least, I’m hoping to understand where they’re coming from.</p>
<p>Here is an example output for a module:</p>
<pre><code class="lang-auto">building '_my_extension' extension
gcc -pthread -B /path/to/my/extension/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iext_modules/include -I/path/to/my/extension/lib/python3.7/site-packages/torch/include -I/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/path/to/my/extension/lib/python3.7/site-packages/torch/include/TH -I/path/to/my/extension/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/path/to/my/extension/include/python3.7m -c ext_modules/src/nn/cpp/convolution_layer.cpp -o build/temp.linux-x86_64-3.7/ext_modules/src/nn/cpp/convolution_layer.o -fopenmp -O3 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_my_extension -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
/usr/local/cuda/bin/nvcc -Iext_modules/include -I/path/to/my/extension/lib/python3.7/site-packages/torch/include -I/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/path/to/my/extension/lib/python3.7/site-packages/torch/include/TH -I/path/to/my/extension/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/path/to/my/extension/include/python3.7m -c ext_modules/src/nn/cuda/convolution_layer.cu -o build/temp.linux-x86_64-3.7/ext_modules/src/nn/cuda/convolution_layer.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' --gpu-architecture=compute_61 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_my_extension -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
/path/to/my/extension/lib/python3.7/site-packages/torch/include/c10/core/TensorTypeSet.h(44): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(14): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(15): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(15): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(15): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(18): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(19): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(19): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(19): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(23): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(24): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(24): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(24): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/autograd/profiler.h(97): warning: attribute "__visibility__" does not apply here

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/autograd/profiler.h(112): warning: attribute "__visibility__" does not apply here

/path/to/my/extension/lib/python3.7/site-packages/torch/include/c10/core/TensorTypeSet.h(44): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(14): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(15): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(15): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(15): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(18): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(19): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(19): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(19): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(23): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(24): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(24): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(24): warning: integer conversion resulted in a change of sign

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/autograd/profiler.h(97): warning: attribute "__visibility__" does not apply here

/path/to/my/extension/lib/python3.7/site-packages/torch/include/torch/csrc/autograd/profiler.h(112): warning: attribute "__visibility__" does not apply here
</code></pre>

username: albanD
cooked: <p>cc <a class="mention" href="/u/yf225">@yf225</a> is the idea here that these should be fixed and we would accept PR fixing them?</p>

username: yf225
cooked: <p><a class="mention" href="/u/alband">@albanD</a> Yes 100% <img src="https://discuss.pytorch.org/images/emoji/apple/smiley.png?v=9" title=":smiley:" class="emoji" alt=":smiley:"> <a class="mention" href="/u/marcman411">@marcman411</a> Please let us know if you are interested in submitting a PR to fix them, thanks!</p>

username: yifita
cooked: <p>same here. I still get tons of warnings from version 1.5.0<br>
I’ve got no idea where they are from.</p>

username: tsap
cooked: <p>Hello,<br>
is this still not solved?<br>
I also have this warning when creating docker image with pytorch 1.4.0 in it.</p>

username: albanD
cooked: <p>Unfortunately, at this point, most of them actually come from third party libraries that are compiled at the same time as pytorch. And there is little we can do about these warnings <img src="https://discuss.pytorch.org/images/emoji/apple/confused.png?v=9" title=":confused:" class="emoji" alt=":confused:"></p>

username: tsap
cooked: <p>that’s unfortunate… but thank very much for your response <img src="https://discuss.pytorch.org/images/emoji/apple/pray.png?v=9" title=":pray:" class="emoji" alt=":pray:"></p>