Apex: warning: integer conversion resulted in a change of sign

Created on 15 Oct 2019  路  1Comment  路  Source: NVIDIA/apex

Building apex on my system (Ubuntu 18.04) is successfull, but the building process is full of the following warning

warning: integer conversion resulted in a change of sign

I don't know anything about C++, but I would imagine that if in math the sign is changed unexpectedly, that could have grave consequences.

Most helpful comment

The same warning appears when I compile the torch cpp extension tests

$ cd pytorch_repo/test/cpp_extensions
$ python setup.py install

The first few extensions, compiled with gcc, do not show the warning, but two later extensions, compiled with nvcc, do show the warning.

So I don't think this has to do with apex and it doesn't appear to affect the operation. In fact, looking at the pytorch source where the warning comes from, it may be a deliberate hack to set repr_ to all 1s, since repr_ is an unsigned integer, and nvcc is being pedantic about warning us.

>All comments

The same warning appears when I compile the torch cpp extension tests

$ cd pytorch_repo/test/cpp_extensions
$ python setup.py install

The first few extensions, compiled with gcc, do not show the warning, but two later extensions, compiled with nvcc, do show the warning.

So I don't think this has to do with apex and it doesn't appear to affect the operation. In fact, looking at the pytorch source where the warning comes from, it may be a deliberate hack to set repr_ to all 1s, since repr_ is an unsigned integer, and nvcc is being pedantic about warning us.

Was this page helpful?
0 / 5 - 0 ratings