Closed paulocoutinhox closed 1 month ago
Hello, I have encountered the same problem. Have you resolved it?
Nope. I’m waiting the update.
Em qua., 21 de fev. de 2024 às 01:39, NaNBridge @.***> escreveu:
Hello, I have encountered the same problem. Have you resolved it?
— Reply to this email directly, view it on GitHub https://github.com/leejet/stable-diffusion.cpp/issues/177#issuecomment-1955878402, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADAOWDLMNXAS7SSPXC3ZGTYUV3BBAVCNFSM6AAAAABDNUN2USVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJVHA3TQNBQGI . You are receiving this because you authored the thread.Message ID: @.***>
The reason for the error is that the recent updates to ggml have caused some symbol changes. The solution is to roll back ggml to the version at least a week ago.
In my case, i can't, because i use in my app ggml, llama.cpp, whisper.cpp and stable-diffusion.cpp, all together and the only project with problem is sd.cpp.
@leejet can you help us with this? pls.
@leejet can you add support for this: https://github.com/ggerganov/ggml/issues/647 pls
@leejet can you help us with this? pls.
I have updated ggml to the latest commit. You can pull the latest changes from the master branch and give it a try.
@leejet can you add support for this: ggerganov/ggml#647 pls
I am not familiar with Metal at the moment, so I may not be of much help.
Hi @leejet dont need know it, only need use ggml_backend_alloc_ctx_tensors
as indicated here https://github.com/ggerganov/ggml/issues/647 like llama.cpp and whisper.cpp already use. plsssss
Also, when i update to latest GGML one error happen:
/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/stable-diffusion.cpp:127:9: error: use of undeclared identifier 'ggml_metal_log_set_callback'; did you mean 'ggml_backend_metal_log_set_callback'?
ggml_metal_log_set_callback(ggml_log_callback_default, nullptr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
I think that it changed the name to: https://github.com/search?q=repo%3Aggerganov%2Fggml%20ggml_backend_metal_log_set_callback&type=code
And:
/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/ggml_extend.hpp:693:12: error: use of undeclared identifier 'ggml_timestep_embedding'; did you mean 'ggml_nn_timestep_embedding'?
return ggml_timestep_embedding(ctx, timesteps, dim, max_period);
^~~~~~~~~~~~~~~~~~~~~~~
ggml_nn_timestep_embedding
Here: https://github.com/ggerganov/ggml/discussions/749
Can you update these things + ggml_backend_alloc_ctx_tensors
? thankskss
It seems that your ggml is not up to date because the submodule URL has changed. Try executing the following command to update it.
git submodule sync
git submodule update
The latest master code has already utilized ggml_backend_alloc_ctx_tensors
.
We still have some problems:
PROBLEM 1:
Im seeing your code from master and it still use old functions, like this:
/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/upscaler.cpp:24: error: use of undeclared identifier 'ggml_metal_log_set_callback'; did you mean 'ggml_backend_metal_log_set_callback'?
/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/upscaler.cpp:24:9: error: use of undeclared identifier 'ggml_metal_log_set_callback'; did you mean 'ggml_backend_metal_log_set_callback'?
ggml_metal_log_set_callback(ggml_log_callback_default, nullptr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
ggml_backend_metal_log_set_callback
/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/../ggml/src/ggml-metal.h:43:15: note: 'ggml_backend_metal_log_set_callback' declared here
GGML_API void ggml_backend_metal_log_set_callback(ggml_log_callback log_callback, void * user_data);
^
You need use ggml_backend_metal_log_set_callback
instead of ggml_metal_log_set_callback
.
PROBLEM 2:
You use a function called ggml_timestep_embedding
that ins't inside GGML code.
See: https://github.com/search?q=repo%3Aggerganov%2Fggml%20ggml_timestep_embedding&type=code
Error:
/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/ggml_extend.hpp:693: error: use of undeclared identifier 'ggml_timestep_embedding'; did you mean 'ggml_nn_timestep_embedding'?
/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/ggml_extend.hpp:693:12: error: use of undeclared identifier 'ggml_timestep_embedding'; did you mean 'ggml_nn_timestep_embedding'?
return ggml_timestep_embedding(ctx, timesteps, dim, max_period);
^~~~~~~~~~~~~~~~~~~~~~~
ggml_nn_timestep_embedding
/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/ggml_extend.hpp:688:39: note: 'ggml_nn_timestep_embedding' declared here
__STATIC_INLINE__ struct ggml_tensor* ggml_nn_timestep_embedding(
^
PROBLEM 3:
You are using a function called ggml_arange
that is not inside GGML code.
See: https://github.com/search?q=repo%3Aggerganov%2Fggml%20ggml_arange&type=code
Error:
/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/unet.hpp:114: error: use of undeclared identifier 'ggml_arange'
In file included from /Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/stable-diffusion.cpp:15:
/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/unet.hpp:114:27: error: use of undeclared identifier 'ggml_arange'
auto num_frames = ggml_arange(ctx, 0, timesteps, 1);
^
We still have some problems:
PROBLEM 1:
Im seeing your code from master and it still use old functions, like this:
/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/upscaler.cpp:24: error: use of undeclared identifier 'ggml_metal_log_set_callback'; did you mean 'ggml_backend_metal_log_set_callback'? /Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/upscaler.cpp:24:9: error: use of undeclared identifier 'ggml_metal_log_set_callback'; did you mean 'ggml_backend_metal_log_set_callback'? ggml_metal_log_set_callback(ggml_log_callback_default, nullptr); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ggml_backend_metal_log_set_callback /Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/../ggml/src/ggml-metal.h:43:15: note: 'ggml_backend_metal_log_set_callback' declared here GGML_API void ggml_backend_metal_log_set_callback(ggml_log_callback log_callback, void * user_data); ^
You need use
ggml_backend_metal_log_set_callback
instead ofggml_metal_log_set_callback
.![]()
PROBLEM 2:
You use a function called
ggml_timestep_embedding
that ins't inside GGML code.See: https://github.com/search?q=repo%3Aggerganov%2Fggml%20ggml_timestep_embedding&type=code
Error:
/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/ggml_extend.hpp:693: error: use of undeclared identifier 'ggml_timestep_embedding'; did you mean 'ggml_nn_timestep_embedding'? /Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/ggml_extend.hpp:693:12: error: use of undeclared identifier 'ggml_timestep_embedding'; did you mean 'ggml_nn_timestep_embedding'? return ggml_timestep_embedding(ctx, timesteps, dim, max_period); ^~~~~~~~~~~~~~~~~~~~~~~ ggml_nn_timestep_embedding /Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/ggml_extend.hpp:688:39: note: 'ggml_nn_timestep_embedding' declared here __STATIC_INLINE__ struct ggml_tensor* ggml_nn_timestep_embedding( ^
PROBLEM 3:
You are using a function called
ggml_arange
that is not inside GGML code.See: https://github.com/search?q=repo%3Aggerganov%2Fggml%20ggml_arange&type=code
Error:
/Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/unet.hpp:114: error: use of undeclared identifier 'ggml_arange' In file included from /Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/stable-diffusion.cpp:15: /Users/paulo/Developer/workspaces/cpp/ai-kit/vendor/stable-diffusion/unet.hpp:114:27: error: use of undeclared identifier 'ggml_arange' auto num_frames = ggml_arange(ctx, 0, timesteps, 1); ^
Nice, only left that two removed functions from GGML:
ggml_timestep_embedding
and ggml_arange
ref: https://github.com/ggerganov/ggml/blob/master/include/ggml/ggml.h
The latest master branch is using this: https://github.com/leejet/ggml/tree/batch-inference. It seems that your ggml is not up to date because the submodule URL has changed. Try executing the following command to update it.
git submodule sync
git submodule update
Fixed. Thanks.
Hi,
Can you update to be compatible with latest GGML?