MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / ggml_graph_get_node_idx

Function ggml_graph_get_node_idx

ggml-mpi.c:59–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59static int ggml_graph_get_node_idx(struct ggml_cgraph * gf, const char * name) {
60 struct ggml_tensor * t = ggml_graph_get_tensor(gf, name);
61 if (t == NULL) {
62 fprintf(stderr, "%s: tensor %s not found\n", __func__, name);
63 return -1;
64 }
65
66 for (int i = 0; i < gf->n_nodes; i++) {
67 if (gf->nodes[i] == t) {
68 return i;
69 }
70 }
71
72 fprintf(stderr, "%s: tensor %s not found in graph (should not happen)\n", __func__, name);
73 return -1;
74}
75
76static void ggml_mpi_tensor_send(struct ggml_tensor * t, int mpi_rank_dst) {
77 MPI_Datatype mpi_type;

Callers 1

Calls 2

fprintfFunction · 0.85
ggml_graph_get_tensorFunction · 0.70

Tested by

no test coverage detected