Update llama.cpp

Co-authored-by: slaren <slarengh@gmail.com>
This commit is contained in:
Radoslav Gerganov 2024-06-03 14:59:49 +03:00 committed by GitHub
parent 464c75c00e
commit 243a3e4bb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16430,15 +16430,16 @@ struct llama_context * llama_new_context_with_model(
}
#endif
#if defined(GGML_USE_RPC)
for (int i = 0; i < (int)model->rpc_servers.size(); i++) {
const char * endpoint = model->rpc_servers[i].c_str();
ggml_backend_t backend = ggml_backend_rpc_init(endpoint);
if (backend == nullptr) {
LLAMA_LOG_ERROR("%s: failed to initialize RPC to '%s'\n", __func__, endpoint);
llama_free(ctx);
return nullptr;
if (model->n_gpu_layers > 0) {
for (const auto & endpoint : model->rpc_servers) {
ggml_backend_t backend = ggml_backend_rpc_init(endpoint.c_str());
if (backend == nullptr) {
LLAMA_LOG_ERROR("%s: failed to initialize RPC to '%s'\n", __func__, endpoint.c_str());
llama_free(ctx);
return nullptr;
}
ctx->backends.push_back(backend);
}
ctx->backends.push_back(backend);
}
#endif
ctx->backend_cpu = ggml_backend_cpu_init();