InferLLM icon indicating copy to clipboard operation
InferLLM copied to clipboard

make error

Open forwiat opened this issue 2 years ago • 13 comments

make Error log:

/tmp/ccLXLGtH.s: Assembler messages:
/tmp/ccLXLGtH.s:21346: Error: symbol `_ZZN8inferllm3opt24vec_vec_dot_q40_with_q80EiPKvS2_E19__PRETTY_FUNCTION__' is already defined
/tmp/ccLXLGtH.s:21351: Error: symbol `_ZZN8inferllm3opt24vec_vec_dot_q40_with_q80EiPKvS2_E19__PRETTY_FUNCTION__' is already defined
/tmp/ccLXLGtH.s:21381: Error: symbol `_ZZN8inferllm3opt19dequantize_row_q4_0EPKvPfiE19__PRETTY_FUNCTION__' is already defined
make[2]: *** [CMakeFiles/InferLLM.dir/src/kern/optimized/x86/kernel.cpp.o] Error 1
make[1]: *** [CMakeFiles/InferLLM.dir/all] Error 2

forwiat avatar Jul 17 '23 03:07 forwiat

I also meet the error,but I cant fix it,it seems the compiler(gcc) bug,I don't know how to fix it

chenqy4933 avatar Jul 18 '23 02:07 chenqy4933

I also meet the error,but I cant fix it,it seems the compiler(gcc) bug,I don't know how to fix it

Can we try __func__ or __FUNCTION__ or something else? The error should come from INFER_ASSERT.

xhebox avatar Jul 18 '23 03:07 xhebox

I also meet the error,but I cant fix it,it seems the compiler(gcc) bug,I don't know how to fix it

Can we try __func__ or __FUNCTION__ or something else? The error should come from INFER_ASSERT.

Can you explain in more detail, do you mean replace the __PRETTY_FUNCTION__ with __FUNCTION__ in INFER_ASSERT?

chenqy4933 avatar Jul 18 '23 03:07 chenqy4933

I also meet the error,but I cant fix it,it seems the compiler(gcc) bug,I don't know how to fix it

Can we try __func__ or __FUNCTION__ or something else? The error should come from INFER_ASSERT.

Can you explain in more detail, do you mean replace the __PRETTY_FUNCTION__ with __FUNCTION__ in INFER_ASSERT?

Yep. I dont think that compiler will generate the symbol without any reference of itself.

xhebox avatar Jul 18 '23 03:07 xhebox

I try it, but it does not work. I think maybe the INFER_ATTRIBUTE_TARGET("avx2") and INFER_ATTRIBUTE_TARGET("avx") function result the duplicate definition,comment one of them there is no error when compile.

chenqy4933 avatar Jul 18 '23 04:07 chenqy4933

INFER_ATTRIBUTE_TARGET

Then this is a bug of the compiler. I'll try to make a minimal reproducible example, and report the bug.

FYI, a blog post explains this: https://maskray.me/blog/2023-02-05-function-multi-versioning

As the post say, it is detection on the fly. Maybe we could use https://github.com/google/cpu_features to archive the same result without using gcc magic __attribute__.

xhebox avatar Jul 18 '23 04:07 xhebox

I try it, but it does not work. I think maybe the INFER_ATTRIBUTE_TARGET("avx2") and INFER_ATTRIBUTE_TARGET("avx") function result the duplicate definition,comment one of them there is no error when compile.

What is the version of your compiler? Can you show me gcc -v?

xhebox avatar Jul 18 '23 05:07 xhebox

I try it, but it does not work. I think maybe the INFER_ATTRIBUTE_TARGET("avx2") and INFER_ATTRIBUTE_TARGET("avx") function result the duplicate definition,comment one of them there is no error when compile.

What is the version of your compiler? Can you show me gcc -v?

gcc (Ubuntu 8.4.0-1ubuntu1~18.04) 8.4.0

chenqy4933 avatar Jul 18 '23 06:07 chenqy4933

I can't find the perfect method to fix this now, I just use the macro to fix the problem

chenqy4933 avatar Jul 20 '23 06:07 chenqy4933

I try it, but it does not work. I think maybe the INFER_ATTRIBUTE_TARGET("avx2") and INFER_ATTRIBUTE_TARGET("avx") function result the duplicate definition,comment one of them there is no error when compile.

hi, I try it "comment one of them", but get error"error: redefinition of ‘float inferllm::opt::vec_vec_dot_q40_with_q80(int, const void*, const void*)’", I comment in optimized.h and quantize.h. is it right?

forwiat avatar Jul 20 '23 11:07 forwiat

if it is not necessary, you can comment it, and build. I have fixed it with the macro of (AVX2) and (AVX), dose not work in your machine?

chenqy4933 avatar Jul 21 '23 01:07 chenqy4933

if it is not necessary, you can comment it, and build. I have fixed it with the macro of (AVX2) and (AVX), dose not work in your machine?

does not work. I comment in "src/kern/optimized/x86/optimized.h" and "src/kern/optimized/x86/queantize.h"

forwiat avatar Jul 21 '23 02:07 forwiat

I solve this problem, by comment AVX function. thanks @chenqy4933

forwiat avatar Jul 25 '23 03:07 forwiat