change GGML_MAX_NAME to 128 - #682
Conversation
|
@slaren @ggerganov Can we merge this as well? |
|
I hope we can find a better solution in the future, |
|
I think if I define it in cmake, will it work? |
ggerganov
left a comment
There was a problem hiding this comment.
Maybe projects using long tensor names should implement their own name shorteners to fit into ggml limit. Can be done with basic string replacements:
// set
ggml_set_name(t, name_pack("some.very.long.tensor.name"));
// get
name_unpack(ggml_get_name(t));Or name maps as in llama.cpp:
|
I think the best approach might be to place the tensor name and some variable-length fields into dynamically allocated memory. |
Hm, not obvious how to do that. Are my suggestions above not applicable in |
Your suggestion is feasible, but I'm more inclined to increase the tensor name size. This way, I can maintain consistency between the tensor names in sd.cpp and the original stable diffusion code, aiding in code comprehension and debugging. Or could the code be modified like this? This way, I can independently increase the tensor name size in the sd.cpp code without affecting other repositories using ggml." #ifndef GGML_MAX_NAME
#define GGML_MAX_NAME 64
#endif |
|
Yes - let's do the |
|
I've updated the PR. |
|
When the system libggml is built with |
|
@WhyNotHugo Because this is a compile-time macro substitution, this code will be embedded into the ggml library, therefore you need to recompile ggml. |
|
Recompiling won't change anything; libggml is properly compiled with -DGGML_MAX_NAME=128, but its header libraries don't reflect this, and program which link to it have no way of ascertaining the value of |
|
It isn't? Then how do we build libggml with GGML_MAX_NAME=128? |
Names of certain tensors, like those in stable-diffusion, exceed a length of 64 characters. I hope the upstream ggml can merge this pr, so I don't have to maintain a separate fork.