Skip to content

Commit 9f01a13

Browse files
committed
Remove debug comments
1 parent 0f5636a commit 9f01a13

File tree

3 files changed

+7
-41
lines changed

3 files changed

+7
-41
lines changed

ggml/src/ggml-backend.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,6 @@ void ggml_backend_tensor_set_async(ggml_backend_t backend, struct ggml_tensor *
244244

245245
void ggml_backend_tensor_get_async(ggml_backend_t backend, const struct ggml_tensor * tensor, void * data, size_t offset, size_t size) {
246246
if (tensor->data == NULL) {
247-
fprintf(stderr, "ERROR: Tensor '%s' data is NULL - cannot read tensor\n",
248-
tensor->name ? tensor->name : "unnamed");
249-
250247
// For output tensors that may not have been properly allocated
251248
if (tensor->flags & GGML_TENSOR_FLAG_OUTPUT) {
252249
fprintf(stderr, " Output tensor detected - this may indicate scheduling issue\n");
@@ -280,16 +277,6 @@ void ggml_backend_tensor_set(struct ggml_tensor * tensor, const void * data, siz
280277
// tensor->name ? tensor->name : "unnamed");
281278
return;
282279
}
283-
284-
// Enhanced error message with tensor information
285-
fprintf(stderr, "ERROR: Tensor buffer not set for tensor '%s' (op: %s, type: %s)\n",
286-
tensor->name ? tensor->name : "unnamed",
287-
ggml_op_name(tensor->op),
288-
ggml_type_name(tensor->type));
289-
if (tensor->view_src) {
290-
fprintf(stderr, " This is a view tensor with view_src: '%s'\n",
291-
tensor->view_src->name ? tensor->view_src->name : "unnamed");
292-
}
293280
}
294281
GGML_ASSERT(buf != NULL && "tensor buffer not set");
295282
GGML_ASSERT(tensor->data != NULL && "tensor not allocated");
@@ -1679,12 +1666,6 @@ void ggml_backend_sched_set_tensor_backend(ggml_backend_sched_t sched, struct gg
16791666
ggml_backend_t ggml_backend_sched_get_tensor_backend(ggml_backend_sched_t sched, struct ggml_tensor * node) {
16801667
int backend_index = tensor_backend_id(node);
16811668
if (backend_index == -1) {
1682-
// Enhanced debugging for unassigned tensors
1683-
fprintf(stderr, "ERROR: Tensor '%s' (op: %s, flags: 0x%x) has no backend assigned (backend_id = -1)\n",
1684-
node->name ? node->name : "unnamed",
1685-
ggml_op_name(node->op),
1686-
node->flags);
1687-
16881669
// Try to assign to CPU backend as fallback for output tensors
16891670
if (node->flags & GGML_TENSOR_FLAG_OUTPUT) {
16901671
fprintf(stderr, " Attempting to assign output tensor to CPU backend\n");

src/llama-graph.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -853,11 +853,6 @@ ggml_tensor * llm_graph_context::build_inp_pos() const {
853853

854854
cur = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, (int64_t)n_tokens*hparams.n_pos_per_embd());
855855
ggml_set_input(cur);
856-
857-
// Ensure input tensor has a name for debugging
858-
if (!cur->name || strlen(cur->name) == 0) {
859-
ggml_set_name(cur, "inp_pos");
860-
}
861856

862857
res->add_input(std::move(inp));
863858

@@ -956,11 +951,6 @@ ggml_tensor * llm_graph_context::build_inp_pos_bucket_enc() const {
956951

957952
cur = ggml_new_tensor_2d(ctx0, GGML_TYPE_I32, n_tokens, n_tokens);
958953
ggml_set_input(cur);
959-
960-
// Ensure input tensor has a name for debugging
961-
if (!cur->name || strlen(cur->name) == 0) {
962-
ggml_set_name(cur, "inp_pos_bucket_enc");
963-
}
964954

965955
res->add_input(std::move(inp));
966956

@@ -978,11 +968,6 @@ ggml_tensor * llm_graph_context::build_inp_pos_bucket_dec() const {
978968

979969
cur = ggml_new_tensor_2d(ctx0, GGML_TYPE_I32, n_kv, n_tokens);
980970
ggml_set_input(cur);
981-
982-
// Ensure input tensor has a name for debugging
983-
if (!cur->name || strlen(cur->name) == 0) {
984-
ggml_set_name(cur, "inp_pos_bucket_dec");
985-
}
986971

987972
res->add_input(std::move(inp));
988973

src/llama-model.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8219,8 +8219,8 @@ struct llm_build_plamo2 : public llm_graph_context {
82198219
ggml_tensor * inpL;
82208220

82218221
// key variables used in PLaMo-2 attention
8222-
const int64_t n_embd_head = hparams.n_embd_head_v;
8223-
ggml_tensor * inp_pos = build_inp_pos();
8222+
// const int64_t n_embd_head = hparams.n_embd_head_v;
8223+
// ggml_tensor * inp_pos = build_inp_pos();
82248224

82258225
// {n_embd, n_tokens}
82268226
inpL = build_inp_embd(model.tok_embd);
@@ -8272,7 +8272,7 @@ struct llm_build_plamo2 : public llm_graph_context {
82728272
ggml_tensor * inpSA = inpL;
82738273

82748274
// attention layer specific variables
8275-
const int64_t n_embd_head = hparams.n_embd_head_v;
8275+
// const int64_t n_embd_head = hparams.n_embd_head_v;
82768276
ggml_tensor * inp_pos = build_inp_pos();
82778277

82788278
// norm
@@ -8282,9 +8282,9 @@ struct llm_build_plamo2 : public llm_graph_context {
82828282
// self-attention
82838283
{
82848284
// For PLaMo-2 hybrid architecture, get the correct attention context
8285-
const auto * mctx_hybrid = static_cast<const llama_memory_hybrid_context *>(mctx);
8286-
const auto * unified_ctx = mctx_hybrid->get_attn();
8287-
auto inp = std::make_unique<llm_graph_input_attn_kv_unified>(hparams, cparams, unified_ctx);
8285+
// const auto * mctx_hybrid = static_cast<const llama_memory_hybrid_context *>(mctx);
8286+
// const auto * unified_ctx = mctx_hybrid->get_attn();
8287+
auto inp = std::make_unique<llm_graph_input_attn_kv_unified>(hparams, cparams, attn_ctx);
82888288
auto * inp_attn = inp.release();
82898289

82908290
// PLaMo-2 uses combined QKV tensor
@@ -8341,7 +8341,7 @@ struct llm_build_plamo2 : public llm_graph_context {
83418341

83428342
// PLaMo-2 GQA: expand K and V heads to match Q heads (equivalent to _expand_kv)
83438343
if (n_head_kv < n_head) {
8344-
const int n_group = n_head / n_head_kv;
8344+
// const int n_group = n_head / n_head_kv;
83458345

83468346
// manually expand K and V tensors to repeat each head n_group times
83478347
// create expanded tensors with target dimensions

0 commit comments

Comments
 (0)