pytorch / FBGEMM

FB (Facebook) + GEMM (General Matrix-Matrix Multiplication) - https://code.fb.com/ml-applications/fbgemm/
Other
1.2k stars 498 forks source link

asmjit fails to compile with bitwise and #957

Open gregrodgers opened 2 years ago

gregrodgers commented 2 years ago

I am new to fbgemm and I am trying to build with clang instead of gcc. gcc builds fine but clang gets this error when building or using asmjit. Should asmjit be fixed or should I turn off the error in clang? Thank you.

/work/grodgers/git/aomp-test/FBGEMM/third_party/asmjit/src/asmjit/core/../core/operand.h:910:79: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
  static inline bool isGp(const Operand_& op, uint32_t rId) noexcept { return isGp(op) & (op.id() == rId); }
                                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                       &&
/work/grodgers/git/aomp-test/FBGEMM/third_party/asmjit/src/asmjit/core/../core/operand.h:910:79: note: cast one or both operands to int to silence this warning
jianyuh commented 2 years ago

Hi @gregrodgers , do you have more details on clang version and repro instruction? We were able to build with clang 9.

gregrodgers commented 2 years ago

I am using upstream build of clang-15. I really want to be able to use latest version of clang for latest OpenMP offloading support.

gregrodgers commented 2 years ago

BTW, I am getting around this now with this: export CXXFLAGS="-Wno-error=bitwise-instead-of-logical -Wno-error=unused-but-set-variable -Wno-error=unused-parameter -Wno-error=sign-compare -pthread"

So for now this is not high priority.

gregrodgers commented 2 years ago

I may close this issue because I have successfully built fbgemm_gpu with clang 15 and did not run into this problem. In fact I have clang cuda working nicely. In the one case I tested (fbgemm_gpu/bench/sparse_ops_benchmark.py), it ran slightly faster than nvcc :-). I did this with latest upstream clang 15.0.0 built from llvm trunk.

Tectu commented 2 years ago

I can confirm that this is still an issue (at least out of the box) with clang14.

kobalicek commented 1 year ago

This should be already fixed by asmjit upstream.