| 57 | } |
| 58 | |
| 59 | static 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 | |
| 76 | static void ggml_mpi_tensor_send(struct ggml_tensor * t, int mpi_rank_dst) { |
| 77 | MPI_Datatype mpi_type; |
no test coverage detected