From f8bbd553cc2cf2411ad7923ba374a158ac2e6b8d Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Tue, 15 Sep 2026 19:37:09 +0300 Subject: [PATCH] llama-graph : name the unnamed graph input tensors - name the kv-cache idxs input tensors (attn_inp_k_idxs, attn_inp_v_idxs) - name the recurrent state copy idxs input tensor (rs_s_copy) - report the input tensor shape in the sched_reserve trace Assisted-by: pi:llama.cpp/Qwen3.8-27B --- src/llama-context.cpp | 6 ++++-- src/llama-graph.cpp | 1 + src/llama-kv-cache.cpp | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/llama-context.cpp b/src/llama-context.cpp index 54d131b2f2..43838be7b9 100644 --- a/src/llama-context.cpp +++ b/src/llama-context.cpp @@ -604,8 +604,10 @@ static int llama_graph_n_input_tensors(ggml_cgraph * gf) { __func__, tensor->name, ggml_op_name(tensor->op)); } for (const ggml_tensor * node : nodes) { - LLAMA_LOG_DEBUG("%s: input tensor '%s' is used by node '%s' (%s)\n", - __func__, tensor->name, node->name, ggml_op_name(node->op)); + LLAMA_LOG_DEBUG("%s: input tensor '%s' [%s, ne = { %" PRId64 ", %" PRId64 ", %" PRId64 ", %" PRId64 " }] is used by node '%s' (%s)\n", + __func__, tensor->name, ggml_type_name(tensor->type), + tensor->ne[0], tensor->ne[1], tensor->ne[2], tensor->ne[3], + node->name, ggml_op_name(node->op)); } } diff --git a/src/llama-graph.cpp b/src/llama-graph.cpp index 59b52abd22..02ae8bd92a 100644 --- a/src/llama-graph.cpp +++ b/src/llama-graph.cpp @@ -3519,6 +3519,7 @@ static std::unique_ptr build_rs_inp_impl( inp->s_copy = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, n_rs); ggml_set_input(inp->s_copy); + ggml_set_name(inp->s_copy, "rs_s_copy"); inp->s_copy_main = ggml_view_1d(ctx0, inp->s_copy, n_seqs, 0); inp->s_copy_extra = ggml_view_1d(ctx0, inp->s_copy, n_rs - n_seqs, n_seqs * inp->s_copy->nb[0]); diff --git a/src/llama-kv-cache.cpp b/src/llama-kv-cache.cpp index a342ee1191..332d1abe02 100644 --- a/src/llama-kv-cache.cpp +++ b/src/llama-kv-cache.cpp @@ -1412,6 +1412,7 @@ ggml_tensor * llama_kv_cache::build_input_k_idxs(ggml_context * ctx, const llama ggml_tensor * k_idxs = ggml_new_tensor_1d(ctx, GGML_TYPE_I64, n_tokens); ggml_set_input(k_idxs); + ggml_set_name(k_idxs, "attn_inp_k_idxs"); return k_idxs; } @@ -1428,6 +1429,7 @@ ggml_tensor * llama_kv_cache::build_input_v_idxs(ggml_context * ctx, const llama } ggml_set_input(v_idxs); + ggml_set_name(v_idxs, "attn_inp_v_idxs"); return v_idxs; }