Skip to content

Commit e2b7621

Browse files
authored
ggml : remove invalid portPos specifiers from dot files (ggml-org#14838)
Neither "g" nor "x" are valid portPos specifiers per the official [graphviz documents](https://graphviz.org/docs/attr-types/portPos/): > If a compass point is used, it must have the form "n","ne","e","se","s","sw","w","nw","c","_". I tested locally for it to fall back to default portPos specifier if an invalid portPos is specified. As a consequence, we can remove associated code.
1 parent c1dbea7 commit e2b7621

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

ggml/src/ggml.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6640,20 +6640,18 @@ static struct ggml_tensor * ggml_graph_get_parent(const struct ggml_cgraph * cgr
66406640
static void ggml_graph_dump_dot_node_edge(FILE * fp, const struct ggml_cgraph * gb, struct ggml_tensor * node, struct ggml_tensor * parent, const char * label) {
66416641
struct ggml_tensor * gparent = ggml_graph_get_parent(gb, node);
66426642
struct ggml_tensor * gparent0 = ggml_graph_get_parent(gb, parent);
6643-
fprintf(fp, " \"%p\":%s -> \"%p\":%s [ arrowhead = %s; style = %s; label = \"%s\"; ]\n",
6643+
fprintf(fp, " \"%p\" -> \"%p\" [ arrowhead = %s; style = %s; label = \"%s\"; ]\n",
66446644
gparent0 ? (void *) gparent0 : (void *) parent,
6645-
gparent0 ? "g" : "x",
66466645
gparent ? (void *) gparent : (void *) node,
6647-
gparent ? "g" : "x",
66486646
gparent ? "empty" : "vee",
66496647
gparent ? "dashed" : "solid",
66506648
label);
66516649
}
66526650

66536651
static void ggml_graph_dump_dot_leaf_edge(FILE * fp, struct ggml_tensor * node, struct ggml_tensor * parent, const char * label) {
6654-
fprintf(fp, " \"%p\":%s -> \"%p\":%s [ label = \"%s\"; ]\n",
6655-
(void *) parent, "x",
6656-
(void *) node, "x",
6652+
fprintf(fp, " \"%p\" -> \"%p\" [ label = \"%s\"; ]\n",
6653+
(void *) parent,
6654+
(void *) node,
66576655
label);
66586656
}
66596657

0 commit comments

Comments
 (0)