Skip to content

ggml : add memset_tensor for rpc #13601

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

gkpln3
Copy link

@gkpln3 gkpln3 commented May 17, 2025

This is crutIal for supporting RPC in Ollama.

@github-actions github-actions bot added the ggml changes relating to the ggml tensor library for machine learning label May 17, 2025
static void ggml_backend_rpc_buffer_memset_tensor(ggml_backend_buffer_t buffer, ggml_tensor * tensor, uint8_t value, size_t offset, size_t size) {
ggml_backend_rpc_buffer_context * ctx = (ggml_backend_rpc_buffer_context *)buffer->context;
std::vector<uint8_t> data(size, value);
ggml_backend_rpc_buffer_set_tensor(buffer, tensor, data.data(), offset, size);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this implementation is inefficient as it potentially sends large amount of data over the network; we should add a dedicated RPC command for this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I can implement that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ggml changes relating to the ggml tensor library for machine learning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants