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

What can be used instead ggml_get_backend()? #656

Closed
bsdero opened this issue Dec 15, 2023 · 2 comments
Closed

What can be used instead ggml_get_backend()? #656

bsdero opened this issue Dec 15, 2023 · 2 comments

Comments

@bsdero
Copy link

bsdero commented Dec 15, 2023

``The last build broke https://github.com/leejet/stable-diffusion.cpp.

I am trying to use the last ggml code.

The code with problems is:


1294
1295             if (dst_tensor == NULL) {
1296                 continue;
1297             }
1298
1299             ggml_backend_t backend = ggml_get_backend(dst_tensor);
1300
1301             size_t nbytes_to_read = tensor_storage.nbytes_to_read();
1302
1303             if (backend == NULL || ggml_backend_is_cpu(backend)) {
1304                 // for the CPU and Metal backend, we can copy directly into the tensor
1305                 if (tensor_storage.type == dst_tensor->type) {
1306                     GGML_ASSERT(ggml_nbytes(dst_tensor) == tensor_storage.nbytes());

@slaren
Copy link
Collaborator

slaren commented Dec 15, 2023

I think that @FSSRepo already solved these issues in leejet/stable-diffusion.cpp#104. More generally, there isn't really any replacement to ggml_get_backend because buffers are no longer associated with any specific backend instance, and applications need to keep track of the backend being used in some other way.

@bsdero
Copy link
Author

bsdero commented Dec 16, 2023

Thanks a lot for the help.

This repository has the updated source code https://github.com/FSSRepo/stable-diffusion.cpp.

It seems like the updates has not been merged into the original repository https://github.com/leejet/stable-diffusion.cpp

Thanks for the help.

@bsdero bsdero closed this as completed Dec 16, 2023
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