larq / compute-engine

Highly optimized inference engine for Binarized Neural Networks
https://docs.larq.dev/compute-engine
Apache License 2.0
242 stars 34 forks source link

Suppress C++ compiler warnings #754

Open lgeiger opened 2 years ago

lgeiger commented 2 years ago

What do these changes do?

This PR suppresses C++ warnings since our build since the CI build logs are getting really long. This is copied directly from the TensorFlow bazel config. Not sure whether this ignores any important warnings, but to be honest the logs are so messy that it is almost impossible to see something in there anyway.

How Has This Been Tested?

I tested this with a full converter build and it reduces the logged lines in GitHub actions from 19373 to 339.

lgeiger commented 2 years ago

Looking at TensorFlow's bazel config again, it seems like they specifically enable some warnings on Linux. Should we do the same?

Tombana commented 2 years ago

Looking at TensorFlow's bazel config again, it seems like they specifically enable some warnings on Linux. Should we do the same?

I think that on CI it is indeed a bit useless to have any warnings printed, since there are so many and most of them are not from our code. If it would be possible to only get warnings for everyhing in the larq_compute_engine dir, that might be a nice improvement. It might also be nice to make this "no warnings" option something for CI only, so that local runs still have all/most warnings. To achieve that maybe we have to add these no-warning flags in the github actions bazel setup script, i.e. echo "build:linux -no_warnings" >> .bazelrc.user or something. Or maybe make a build:ci_no_warnings config where we disable the warnings, and then in the github actions file add --config=ci_no_warnings. What do you think?