Skip to content

Commit 88dc99a

Browse files
committed
Merge branch 'threadpool' of https://github.com/CodeLinaro/llama.cpp into threadpool
2 parents 65c11d4 + cbab212 commit 88dc99a

File tree

7 files changed

+9
-40
lines changed

7 files changed

+9
-40
lines changed

ggml-cuda.cu

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2495,13 +2495,9 @@ static bool ggml_graph_node_has_matching_properties(ggml_tensor * node, ggml_gra
24952495
return true;
24962496
}
24972497

2498-
GGML_CALL static enum ggml_status ggml_backend_cuda_graph_compute(
2499-
ggml_backend_t backend,
2500-
ggml_cgraph * cgraph,
2501-
ggml_compute_threadpool_t threadpool) {
2502-
2503-
GGML_UNUSED(threadpool);
2498+
GGML_CALL static enum ggml_status ggml_backend_cuda_graph_compute(ggml_backend_t backend, ggml_cgraph * cgraph) {
25042499
ggml_backend_cuda_context * cuda_ctx = (ggml_backend_cuda_context *)backend->context;
2500+
25052501
ggml_cuda_set_device(cuda_ctx->device);
25062502

25072503
#ifdef USE_CUDA_GRAPH

ggml-kompute.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,12 +1948,7 @@ static ggml_backend_buffer_type_t ggml_backend_kompute_get_default_buffer_type(g
19481948
return ggml_backend_kompute_buffer_type(ctx->device);
19491949
}
19501950

1951-
static ggml_status ggml_backend_kompute_graph_compute(
1952-
ggml_backend_t backend,
1953-
struct ggml_cgraph * cgraph
1954-
ggml_compute_threadpool_t threadpool) {
1955-
1956-
GGML_UNUSED(threadpool);
1951+
static ggml_status ggml_backend_kompute_graph_compute(ggml_backend_t backend, struct ggml_cgraph * cgraph) {
19571952
auto * ctx = static_cast<ggml_kompute_context *>(backend->context);
19581953
ggml_vk_graph_compute(ctx, cgraph);
19591954
return GGML_STATUS_SUCCESS;

ggml-metal.m

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3103,12 +3103,7 @@ GGML_CALL static ggml_backend_buffer_type_t ggml_backend_metal_get_default_buffe
31033103
UNUSED(backend);
31043104
}
31053105

3106-
GGML_CALL static enum ggml_status ggml_backend_metal_graph_compute(
3107-
ggml_backend_t backend,
3108-
struct ggml_cgraph * cgraph,
3109-
ggml_compute_threadpool_t threadpool) {
3110-
3111-
UNUSED(threadpool);
3106+
GGML_CALL static enum ggml_status ggml_backend_metal_graph_compute(ggml_backend_t backend, struct ggml_cgraph * cgraph) {
31123107
struct ggml_metal_context * metal_ctx = (struct ggml_metal_context *)backend->context;
31133108

31143109
return ggml_metal_graph_compute(metal_ctx, cgraph);

ggml-opencl.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,12 +2235,7 @@ static ggml_backend_buffer_type_t ggml_backend_opencl_get_default_buffer_type(gg
22352235
GGML_UNUSED(backend);
22362236
}
22372237

2238-
static ggml_status ggml_backend_opencl_graph_compute(
2239-
ggml_backend_t backend,
2240-
ggml_cgraph * graph,
2241-
ggml_compute_threadpool_t threadpool) {
2242-
2243-
GGML_UNUSED(threadpool);
2238+
static ggml_status ggml_backend_opencl_graph_compute(ggml_backend_t backend, ggml_cgraph * graph) {
22442239
for (int i = 0; i < graph->n_nodes; ++i) {
22452240
ggml_tensor * node = graph->nodes[i];
22462241

ggml-rpc.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,7 @@ static void serialize_graph(const ggml_cgraph * cgraph, std::vector<uint8_t> & o
585585
memcpy(out_tensors, tensors.data(), n_tensors * sizeof(rpc_tensor));
586586
}
587587

588-
GGML_CALL static enum ggml_status ggml_backend_rpc_graph_compute(ggml_backend_t backend, ggml_cgraph * cgraph, ggml_compute_threadpool * tp) {
589-
UNUSED(tp);
588+
GGML_CALL static enum ggml_status ggml_backend_rpc_graph_compute(ggml_backend_t backend, ggml_cgraph * cgraph) {
590589
ggml_backend_rpc_context * rpc_ctx = (ggml_backend_rpc_context *)backend->context;
591590
std::vector<uint8_t> input;
592591
serialize_graph(cgraph, input);
@@ -1021,7 +1020,7 @@ bool rpc_server::graph_compute(const std::vector<uint8_t> & input, std::vector<u
10211020
for (uint32_t i = 0; i < n_nodes; i++) {
10221021
graph->nodes[i] = create_node(nodes[i], ctx, tensor_ptrs, tensor_map);
10231022
}
1024-
ggml_status status = ggml_backend_graph_compute(backend, graph, NULL);
1023+
ggml_status status = ggml_backend_graph_compute(backend, graph);
10251024
// output serialization format: | status (1 byte) |
10261025
output.resize(1, 0);
10271026
output[0] = status;

ggml-sycl.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17022,13 +17022,7 @@ catch (sycl::exception const &exc) {
1702217022
std::exit(1);
1702317023
}
1702417024

17025-
GGML_CALL static ggml_status ggml_backend_sycl_graph_compute(
17026-
ggml_backend_t backend,
17027-
ggml_cgraph * cgraph,
17028-
ggml_compute_threadpool_t threadpool) {
17029-
17030-
GGML_UNUSED(threadpool);
17031-
17025+
GGML_CALL static ggml_status ggml_backend_sycl_graph_compute(ggml_backend_t backend, ggml_cgraph * cgraph) {
1703217026
ggml_backend_sycl_context * sycl_ctx = (ggml_backend_sycl_context *)backend->context;
1703317027
ggml_sycl_set_main_device(sycl_ctx->device);
1703417028

ggml-vulkan.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6225,12 +6225,7 @@ static bool ggml_vk_is_empty(ggml_tensor * node) {
62256225
return ggml_is_empty(node) || node->op == GGML_OP_NONE || node->op == GGML_OP_RESHAPE || node->op == GGML_OP_TRANSPOSE || node->op == GGML_OP_VIEW || node->op == GGML_OP_PERMUTE;
62266226
}
62276227

6228-
GGML_CALL static ggml_status ggml_backend_vk_graph_compute(
6229-
ggml_backend_t backend,
6230-
ggml_cgraph * cgraph,
6231-
ggml_compute_threadpool_t threadpool) {
6232-
6233-
GGML_UNUSED(threadpool);
6228+
GGML_CALL static ggml_status ggml_backend_vk_graph_compute(ggml_backend_t backend, ggml_cgraph * cgraph) {
62346229
#ifdef GGML_VULKAN_DEBUG
62356230
std::cerr << "ggml_backend_vk_graph_compute(" << cgraph->n_nodes << " nodes)" << std::endl;
62366231
#endif

0 commit comments

Comments
 (0)