Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make error #54

Open
forwiat opened this issue Jul 17, 2023 · 13 comments
Open

make error #54

forwiat opened this issue Jul 17, 2023 · 13 comments

Comments

@forwiat
Copy link

forwiat commented Jul 17, 2023

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
@chenqy4933
Copy link
Collaborator

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

@xhebox
Copy link
Collaborator

xhebox commented Jul 18, 2023

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.

@chenqy4933
Copy link
Collaborator

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?

@xhebox
Copy link
Collaborator

xhebox commented Jul 18, 2023

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.

@chenqy4933
Copy link
Collaborator

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.

@xhebox
Copy link
Collaborator

xhebox commented Jul 18, 2023

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
Copy link
Collaborator

xhebox commented Jul 18, 2023

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?

@chenqy4933
Copy link
Collaborator

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
Copy link
Collaborator

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

@forwiat
Copy link
Author

forwiat commented Jul 20, 2023

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?

@chenqy4933
Copy link
Collaborator

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?

@forwiat forwiat closed this as completed Jul 21, 2023
@forwiat forwiat reopened this Jul 21, 2023
@forwiat
Copy link
Author

forwiat commented Jul 21, 2023

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
Copy link
Author

forwiat commented Jul 25, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants