lightvector / KataGo

GTP engine and self-play learning in Go
https://katagotraining.org/
Other
3.56k stars 564 forks source link

Building with CUDA has a condition with identical branches, is that Ok? #437

Open javierchan opened 3 years ago

javierchan commented 3 years ago

[ 39%] Building CXX object CMakeFiles/katago.dir/neuralnet/cudabackend.cpp.o In file included from /KataGo/cpp/neuralnet/cudabackend.cpp:12:0: /KataGo/cpp/neuralnet/../external/half-2.1.0/include/half.hpp: In function 'int half_float::ilogb(half_float::half)': /KataGo/cpp/neuralnet/../external/half-2.1.0/include/half.hpp:4235:44: warning: this condition has identical branches [-Wduplicated-branches] return !abs ? FP_ILOGB0 : (abs==0x7C00) ? INT_MAX : FP_ILOGBNAN; ^ [ 41%] Building CUDA object CMakeFiles/katago.dir/neuralnet/cudahelpers.cu.o

lightvector commented 3 years ago

Thanks for checking, this is probably okay, but if you are concerned, one could consider reporting this to http://half.sourceforge.net/ (see the very bottom of the page for contact info). KataGo relies on this library for fp16 <-> fp32 conversions.

Also, you can try verifying that KataGo runs properly by playing some games and analysis with it - making sure it outputs sensible moves and evaluations, and that it should output nearly the same things and behave nearly the same regardless of whether you have cudaUseFP16=auto or cudaUseFP16=false set in your config.

javierchan commented 3 years ago

👍 Thank you so much for comment!! really appreciated.