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
This commit is contained in:
Georgi Gerganov
2026-09-15 19:37:09 +03:00
parent 59bf83ccd2
commit f8bbd553cc
3 changed files with 7 additions and 2 deletions
+4 -2
View File
@@ -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));
}
}
+1
View File
@@ -3519,6 +3519,7 @@ static std::unique_ptr<llm_graph_input_rs> 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]);
+2
View File
@@ -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;
}