]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
ggml : improve inputs log sched_print_assignments (ggml/1053)
authorDaniel Bevenius <redacted>
Thu, 19 Dec 2024 02:50:12 +0000 (03:50 +0100)
committerGeorgi Gerganov <redacted>
Sat, 4 Jan 2025 14:09:53 +0000 (16:09 +0200)
This commit attempts to improve the log message for the inputs of the
splits in the sched_print_assignments function.

The motivation for this change is that currently even if there are no
inputs a colon is displayed at the end of the line, which can make it a
little confusing when reading the output as it could be interpreted as
the line below are inputs when they are in fact nodes. With this change
the colon will only be printed if there actually are inputs.

ggml/src/ggml-backend.cpp

index fdb4b986f613b77dcc7533963d525f2c6c49e6c1..e2d6c405668f4e4f444c71047ef035841dd8c41b 100644 (file)
@@ -795,9 +795,12 @@ static void ggml_backend_sched_print_assignments(ggml_backend_sched_t sched, str
     for (int i = 0; i < graph->n_nodes; i++) {
         if (cur_split < sched->n_splits && i == sched->splits[cur_split].i_start) {
             ggml_backend_t split_backend = sched->backends[sched->splits[cur_split].backend_id];
-            GGML_LOG_DEBUG("\n## SPLIT #%d: %s # %d inputs", cur_split, ggml_backend_name(split_backend),
+            GGML_LOG_DEBUG("\n## SPLIT #%d: %s # %d inputs", cur_split, ggml_backend_name(split_backend),
                 sched->splits[cur_split].n_inputs);
             for (int j = 0; j < sched->splits[cur_split].n_inputs; j++) {
+                if (j == 0) {
+                    GGML_LOG_DEBUG(": ");
+                }
                 GGML_LOG_DEBUG("[%s (%5.5s)] ", sched->splits[cur_split].inputs[j]->name,
                     fmt_size(ggml_nbytes(sched->splits[cur_split].inputs[j])));
             }