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

demangling failure with __device_stub_ prefix #1938

Open
honggyukim opened this issue Jun 29, 2024 · 5 comments
Open

demangling failure with __device_stub_ prefix #1938

honggyukim opened this issue Jun 29, 2024 · 5 comments

Comments

@honggyukim
Copy link
Collaborator

There are some symbols begin with __device_stub_, but it makes our demangler fails demangling the symbol as follows.

$ ./misc/demangler __device_stub__Z13mul_mat_vec_qIL9ggml_type13ELi2EEvPKvS2_Pfiiii
__device_stub__Z13mul_mat_vec_qIL9ggml_type13ELi2EEvPKvS2_Pfiiii

If the __device_stub_ prefix is removed, then it can be demangled as follows.

$ ./misc/demangler _Z13mul_mat_vec_qIL9ggml_type13ELi2EEvPKvS2_Pfiiii
mul_mat_vec_q

So I would like to see treat the special prefix __device_stub_ and parse the rest of symbols. The final demangled output can be shown as follows.

$ ./misc/demangler __device_stub__Z13mul_mat_vec_qIL9ggml_type13ELi2EEvPKvS2_Pfiiii
__device_stub_mul_mat_vec_q
@honggyukim
Copy link
Collaborator Author

The same problem is shown in c++filt tool as well.

$ c++filt __device_stub__Z13mul_mat_vec_qIL9ggml_type13ELi2EEvPKvS2_Pfiiii
__device_stub__Z13mul_mat_vec_qIL9ggml_type13ELi2EEvPKvS2_Pfiiii

If the __device_stub_ prefix is removed, then it can be demangled as follows.

$ c++filt _Z13mul_mat_vec_qIL9ggml_type13ELi2EEvPKvS2_Pfiiii
void mul_mat_vec_q<(ggml_type)13, 2>(void const*, void const*, float*, int, int, int, int)

@namhyung
Copy link
Owner

Hmm.. do you know when it adds the __device_stub_ prefix?

@honggyukim
Copy link
Collaborator Author

It's added by nvcc cuda compiler.

@namhyung
Copy link
Owner

Ok, thanks. Do you know what else prefix it can add also? Preferably any documentation for that.

Anyway I think we can skip the prefix like we do with _GLOBAL__sub_I_.

@honggyukim
Copy link
Collaborator Author

Sure, I will try to list up for cuda compiler later.

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

2 participants