Skip to content

Commit f7acd54

Browse files
hexagon: reintroduce HEX_VERBOSE wrapper for GGML_LOG_DEBUG for now
GGML_LOG_DEBUG is always enabled for test-backend-ops and the output gets in the way. Ideally we need a bit more finer log levels.
1 parent c51f50d commit f7acd54

File tree

1 file changed

+37
-34
lines changed

1 file changed

+37
-34
lines changed

ggml/src/ggml-hexagon/ggml-hexagon.cpp

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ static int opt_experimental = 0;
5151
static int opt_opmask = HTP_OPMASK_QUEUE | HTP_OPMASK_QUANTIZE | HTP_OPMASK_COMPUTE;
5252
static int opt_opsync = 0; // synchronous ops
5353

54+
#define HEX_VERBOSE(...) \
55+
if (opt_verbose) GGML_LOG_DEBUG(__VA_ARGS__)
56+
5457
#define HEX_PROFILE(...) \
5558
if (opt_profile) GGML_LOG_INFO(__VA_ARGS__)
5659

@@ -306,7 +309,7 @@ struct ggml_backend_hexagon_buffer_type_context {
306309

307310
struct ggml_backend_hexagon_buffer_context {
308311
bool mmap_to(ggml_hexagon_session * s) {
309-
GGML_LOG_DEBUG("ggml-hex: %s mmaping buffer: base %p domain-id %d session-id %d size %zu fd %d repack %d\n",
312+
HEX_VERBOSE("ggml-hex: %s mmaping buffer: base %p domain-id %d session-id %d size %zu fd %d repack %d\n",
310313
s->name.c_str(), (void *) this->base, s->domain_id, s->session_id, this->size, this->fd,
311314
(int) this->repack);
312315

@@ -357,7 +360,7 @@ struct ggml_backend_hexagon_buffer_context {
357360
return;
358361
}
359362

360-
GGML_LOG_DEBUG("ggml-hex: %s allocated buffer: base %p size %zu fd %d repack %d\n", sess->name.c_str(),
363+
HEX_VERBOSE("ggml-hex: %s allocated buffer: base %p size %zu fd %d repack %d\n", sess->name.c_str(),
361364
(void *) this->base, size, this->fd, (int) repack);
362365

363366
this->sess = sess;
@@ -400,7 +403,7 @@ static enum ggml_status ggml_backend_hexagon_buffer_init_tensor(ggml_backend_buf
400403
auto ctx = static_cast<ggml_backend_hexagon_buffer_context *>(buffer->context);
401404
auto sess = ctx->sess;
402405

403-
GGML_LOG_DEBUG("ggml-hex: %s init-tensor %s : base %p data %p nbytes %zu usage %d repack %d\n", sess->name.c_str(),
406+
HEX_VERBOSE("ggml-hex: %s init-tensor %s : base %p data %p nbytes %zu usage %d repack %d\n", sess->name.c_str(),
404407
tensor->name, (void *) ctx->base, tensor->data, ggml_nbytes(tensor), (int) buffer->usage,
405408
(int) ctx->repack);
406409

@@ -425,7 +428,7 @@ static x2_q4 unpack_q4(uint8_t v) {
425428
}
426429

427430
static void dump_block_q4_0(const block_q4_0 * b, int i) {
428-
GGML_LOG_DEBUG("ggml-hex: repack q4_0 %d: %d %d %d %d ... %d %d %d %d : %.6f\n", i, unpack_q4(b->qs[0]).v[0],
431+
HEX_VERBOSE("ggml-hex: repack q4_0 %d: %d %d %d %d ... %d %d %d %d : %.6f\n", i, unpack_q4(b->qs[0]).v[0],
429432
unpack_q4(b->qs[1]).v[0], unpack_q4(b->qs[2]).v[0], unpack_q4(b->qs[3]).v[0], unpack_q4(b->qs[12]).v[1],
430433
unpack_q4(b->qs[13]).v[1], unpack_q4(b->qs[14]).v[1], unpack_q4(b->qs[15]).v[1],
431434
GGML_FP16_TO_FP32(b->d));
@@ -443,13 +446,13 @@ static void dump_packed_block_q4x4x2(const uint8_t * v, unsigned int i, size_t k
443446
const uint8_t * q = v_q + i * qblk_size;
444447
const ggml_half * d = (const ggml_half *) (v_d + i * dblk_size);
445448

446-
GGML_LOG_DEBUG("ggml-hex: repack q4x4x2-%d: %d %d %d %d ... %d %d %d %d ... %d %d %d %d : %.6f %.6f %.6f %.6f\n", i,
449+
HEX_VERBOSE("ggml-hex: repack q4x4x2-%d: %d %d %d %d ... %d %d %d %d ... %d %d %d %d : %.6f %.6f %.6f %.6f\n", i,
447450
unpack_q4(q[0]).v[0], unpack_q4(q[1]).v[0], unpack_q4(q[2]).v[0], unpack_q4(q[3]).v[0],
448451
unpack_q4(q[60]).v[0], unpack_q4(q[61]).v[0], unpack_q4(q[62]).v[0], unpack_q4(q[63]).v[0],
449452
unpack_q4(q[124]).v[0], unpack_q4(q[125]).v[0], unpack_q4(q[126]).v[0], unpack_q4(q[127]).v[0],
450453
GGML_FP16_TO_FP32(d[0]), GGML_FP16_TO_FP32(d[1]), GGML_FP16_TO_FP32(d[2]), GGML_FP16_TO_FP32(d[3]));
451454

452-
GGML_LOG_DEBUG("ggml-hex: repack q4x4x2-%d: %d %d %d %d ... %d %d %d %d ... %d %d %d %d : %.6f %.6f %.6f %.6f\n",
455+
HEX_VERBOSE("ggml-hex: repack q4x4x2-%d: %d %d %d %d ... %d %d %d %d ... %d %d %d %d : %.6f %.6f %.6f %.6f\n",
453456
i + 1, unpack_q4(q[0]).v[1], unpack_q4(q[1]).v[1], unpack_q4(q[2]).v[1], unpack_q4(q[3]).v[1],
454457
unpack_q4(q[60]).v[1], unpack_q4(q[61]).v[1], unpack_q4(q[62]).v[1], unpack_q4(q[63]).v[1],
455458
unpack_q4(q[124]).v[1], unpack_q4(q[125]).v[1], unpack_q4(q[126]).v[1], unpack_q4(q[127]).v[1],
@@ -658,7 +661,7 @@ static void repack_q4_0_q4x4x2(ggml_tensor * t, const void * data, size_t size)
658661
void * buf_rp = ggml_aligned_malloc(row_size_rp);
659662
GGML_ASSERT(buf_rp != NULL);
660663

661-
GGML_LOG_DEBUG("ggml-hex: repack-q4_0-q4x4x2 %s : data %p size %zu dims %ldx%ld row-size %zu\n", t->name, data, size,
664+
HEX_VERBOSE("ggml-hex: repack-q4_0-q4x4x2 %s : data %p size %zu dims %ldx%ld row-size %zu\n", t->name, data, size,
662665
t->ne[0], nrows, row_size);
663666

664667
init_row_q4x4x2((block_q4_0 *) buf_pd, t->ne[0]); // init padded buffer to make sure the tail is all zeros
@@ -690,7 +693,7 @@ static void repack_q4x4x2_q4_0(void * data, const ggml_tensor * t, size_t size)
690693
void * buf_rp = ggml_aligned_malloc(row_size_rp);
691694
GGML_ASSERT(buf_rp != NULL);
692695

693-
GGML_LOG_DEBUG("ggml-hex: repack-q4x4x2-q4_0 %s : data %p size %zu dims %ldx%ld row-size %zu\n", t->name, data, size,
696+
HEX_VERBOSE("ggml-hex: repack-q4x4x2-q4_0 %s : data %p size %zu dims %ldx%ld row-size %zu\n", t->name, data, size,
694697
t->ne[0], nrows, row_size);
695698

696699
memset(buf_pd, 0, row_size_pd); // clear-out padded buffer to make sure the tail is all zeros
@@ -710,7 +713,7 @@ static void repack_q4x4x2_q4_0(void * data, const ggml_tensor * t, size_t size)
710713

711714
// ======== Q8x4x2 ====================
712715
static void dump_block_q8_0(const block_q8_0 * b, int i) {
713-
GGML_LOG_DEBUG("ggml-hex: repack q8_0 %d: %d %d %d %d ... %d %d %d %d : %.6f\n", i, b->qs[0], b->qs[1], b->qs[2],
716+
HEX_VERBOSE("ggml-hex: repack q8_0 %d: %d %d %d %d ... %d %d %d %d : %.6f\n", i, b->qs[0], b->qs[1], b->qs[2],
714717
b->qs[3], b->qs[28], b->qs[29], b->qs[30], b->qs[31], GGML_FP16_TO_FP32(b->d));
715718
}
716719

@@ -726,11 +729,11 @@ static void dump_packed_block_q8x4x2(const uint8_t * v, unsigned int i, size_t k
726729
const uint8_t * q = v_q + i * qblk_size;
727730
const ggml_half * d = (const ggml_half *) (v_d + i * dblk_size);
728731

729-
GGML_LOG_DEBUG("ggml-hex: repack q8x4x2-%d: %d %d %d %d ... %d %d %d %d ... %d %d %d %d : %.6f %.6f %.6f %.6f\n", i,
732+
HEX_VERBOSE("ggml-hex: repack q8x4x2-%d: %d %d %d %d ... %d %d %d %d ... %d %d %d %d : %.6f %.6f %.6f %.6f\n", i,
730733
q[0], q[1], q[2], q[3], q[60], q[61], q[62], q[63], q[124], q[125], q[126], q[127],
731734
GGML_FP16_TO_FP32(d[0]), GGML_FP16_TO_FP32(d[1]), GGML_FP16_TO_FP32(d[2]), GGML_FP16_TO_FP32(d[3]));
732735

733-
GGML_LOG_DEBUG("ggml-hex: repack q8x4x2-%d: %d %d %d %d ... %d %d %d %d ... %d %d %d %d : %.6f %.6f %.6f %.6f\n",
736+
HEX_VERBOSE("ggml-hex: repack q8x4x2-%d: %d %d %d %d ... %d %d %d %d ... %d %d %d %d : %.6f %.6f %.6f %.6f\n",
734737
i + 1, q[128], q[129], q[130], q[131], q[192], q[193], q[194], q[195], q[252], q[253], q[254], q[255],
735738
GGML_FP16_TO_FP32(d[4]), GGML_FP16_TO_FP32(d[5]), GGML_FP16_TO_FP32(d[6]), GGML_FP16_TO_FP32(d[7]));
736739
}
@@ -932,7 +935,7 @@ static void repack_q8_0_q8x4x2(ggml_tensor * t, const void * data, size_t size)
932935
void * buf_rp = ggml_aligned_malloc(row_size_rp);
933936
GGML_ASSERT(buf_rp != NULL);
934937

935-
GGML_LOG_DEBUG("ggml-hex: repack-q8_0-q8x4x2 %s : data %p size %zu dims %ldx%ld row-size %zu\n", t->name, data, size,
938+
HEX_VERBOSE("ggml-hex: repack-q8_0-q8x4x2 %s : data %p size %zu dims %ldx%ld row-size %zu\n", t->name, data, size,
936939
t->ne[0], nrows, row_size);
937940

938941
init_row_q8x4x2((block_q8_0 *) buf_pd, t->ne[0]); // init padded buffer to make sure the tail is all zeros
@@ -964,7 +967,7 @@ static void repack_q8x4x2_q8_0(void * data, const ggml_tensor * t, size_t size)
964967
void * buf_rp = ggml_aligned_malloc(row_size_rp);
965968
GGML_ASSERT(buf_rp != NULL);
966969

967-
GGML_LOG_DEBUG("ggml-hex: repack-q8x4x2-q8_0 %s : data %p size %zu dims %ldx%ld row-size %zu\n", t->name, data, size,
970+
HEX_VERBOSE("ggml-hex: repack-q8x4x2-q8_0 %s : data %p size %zu dims %ldx%ld row-size %zu\n", t->name, data, size,
968971
t->ne[0], nrows, row_size);
969972

970973
memset(buf_pd, 0, row_size_pd); // clear-out padded buffer to make sure the tail is all zeros
@@ -995,7 +998,7 @@ static x2_mxfp4 unpack_mxfp4(uint8_t v) {
995998
}
996999

9971000
static void dump_block_mxfp4(const block_mxfp4 * b, int i) {
998-
GGML_LOG_DEBUG("ggml-hex: repack mxfp4 %d: %d %d %d %d ... %d %d %d %d : %.6f\n", i, unpack_mxfp4(b->qs[0]).v[0],
1001+
HEX_VERBOSE("ggml-hex: repack mxfp4 %d: %d %d %d %d ... %d %d %d %d : %.6f\n", i, unpack_mxfp4(b->qs[0]).v[0],
9991002
unpack_mxfp4(b->qs[1]).v[0], unpack_mxfp4(b->qs[2]).v[0], unpack_mxfp4(b->qs[3]).v[0],
10001003
unpack_mxfp4(b->qs[12]).v[1], unpack_mxfp4(b->qs[13]).v[1], unpack_mxfp4(b->qs[14]).v[1],
10011004
unpack_mxfp4(b->qs[15]).v[1], GGML_E8M0_TO_FP32_HALF(b->e));
@@ -1013,14 +1016,14 @@ static void dump_packed_block_mxfp4x4x2(const uint8_t * v, unsigned int i, size_
10131016
const uint8_t * q = v_q + i * qblk_size;
10141017
const uint8_t * e = (const uint8_t *) (v_e + i * eblk_size);
10151018

1016-
GGML_LOG_DEBUG("ggml-hex: repack mxfp4x4x2-%d: %d %d %d %d ... %d %d %d %d ... %d %d %d %d : %.6f %.6f %.6f %.6f\n", i,
1019+
HEX_VERBOSE("ggml-hex: repack mxfp4x4x2-%d: %d %d %d %d ... %d %d %d %d ... %d %d %d %d : %.6f %.6f %.6f %.6f\n", i,
10171020
unpack_mxfp4(q[0]).v[0], unpack_mxfp4(q[1]).v[0], unpack_mxfp4(q[2]).v[0], unpack_mxfp4(q[3]).v[0],
10181021
unpack_mxfp4(q[60]).v[0], unpack_mxfp4(q[61]).v[0], unpack_mxfp4(q[62]).v[0], unpack_mxfp4(q[63]).v[0],
10191022
unpack_mxfp4(q[124]).v[0], unpack_mxfp4(q[125]).v[0], unpack_mxfp4(q[126]).v[0],
10201023
unpack_mxfp4(q[127]).v[0], GGML_E8M0_TO_FP32_HALF(e[0]), GGML_E8M0_TO_FP32_HALF(e[1]),
10211024
GGML_E8M0_TO_FP32_HALF(e[2]), GGML_E8M0_TO_FP32_HALF(e[3]));
10221025

1023-
GGML_LOG_DEBUG("ggml-hex: repack mxfp4x4x2-%d: %d %d %d %d ... %d %d %d %d ... %d %d %d %d : %.6f %.6f %.6f %.6f\n",
1026+
HEX_VERBOSE("ggml-hex: repack mxfp4x4x2-%d: %d %d %d %d ... %d %d %d %d ... %d %d %d %d : %.6f %.6f %.6f %.6f\n",
10241027
i + 1, unpack_mxfp4(q[0]).v[1], unpack_mxfp4(q[1]).v[1], unpack_mxfp4(q[2]).v[1],
10251028
unpack_mxfp4(q[3]).v[1], unpack_mxfp4(q[60]).v[1], unpack_mxfp4(q[61]).v[1], unpack_mxfp4(q[62]).v[1],
10261029
unpack_mxfp4(q[63]).v[1], unpack_mxfp4(q[124]).v[1], unpack_mxfp4(q[125]).v[1],
@@ -1231,7 +1234,7 @@ static void repack_mxfp4_mxfp4x4x2(ggml_tensor * t, const void * data, size_t si
12311234
void * buf_rp = ggml_aligned_malloc(row_size_rp);
12321235
GGML_ASSERT(buf_rp != NULL);
12331236

1234-
GGML_LOG_DEBUG("ggml-hex: repack-mxfp4-mxfp4x4x2 %s : data %p size %zu dims %ldx%ld row-size %zu\n", t->name, data,
1237+
HEX_VERBOSE("ggml-hex: repack-mxfp4-mxfp4x4x2 %s : data %p size %zu dims %ldx%ld row-size %zu\n", t->name, data,
12351238
size, t->ne[0], nrows, row_size);
12361239

12371240
init_row_mxfp4x4x2((block_mxfp4 *) buf_pd, t->ne[0]); // init padded buffer to make sure the tail is all zeros
@@ -1263,7 +1266,7 @@ static void repack_mxfp4x4x2_mxfp4(void * data, const ggml_tensor * t, size_t si
12631266
void * buf_rp = ggml_aligned_malloc(row_size_rp);
12641267
GGML_ASSERT(buf_rp != NULL);
12651268

1266-
GGML_LOG_DEBUG("ggml-hex: repack-mxfp4x4x2-mxfp4 %s : data %p size %zu dims %ldx%ld row-size %zu\n", t->name, data,
1269+
HEX_VERBOSE("ggml-hex: repack-mxfp4x4x2-mxfp4 %s : data %p size %zu dims %ldx%ld row-size %zu\n", t->name, data,
12671270
size, t->ne[0], nrows, row_size);
12681271

12691272
memset(buf_pd, 0, row_size_pd); // clear-out padded buffer to make sure the tail is all zeros
@@ -1289,7 +1292,7 @@ static void ggml_backend_hexagon_buffer_set_tensor(ggml_backend_buffer_t buffer,
12891292
auto ctx = (ggml_backend_hexagon_buffer_context *) buffer->context;
12901293
auto sess = ctx->sess;
12911294

1292-
GGML_LOG_DEBUG("ggml-hex: %s set-tensor %s : data %p offset %zu size %zu\n", sess->name.c_str(), tensor->name, data,
1295+
HEX_VERBOSE("ggml-hex: %s set-tensor %s : data %p offset %zu size %zu\n", sess->name.c_str(), tensor->name, data,
12931296
offset, size);
12941297

12951298
switch (tensor->type) {
@@ -1325,7 +1328,7 @@ static void ggml_backend_hexagon_buffer_get_tensor(ggml_backend_buffer_t buffer,
13251328
auto ctx = (ggml_backend_hexagon_buffer_context *) buffer->context;
13261329
auto sess = ctx->sess;
13271330

1328-
GGML_LOG_DEBUG("ggml-hex: %s get-tensor %s : data %p offset %zu size %zu\n", sess->name.c_str(), tensor->name, data,
1331+
HEX_VERBOSE("ggml-hex: %s get-tensor %s : data %p offset %zu size %zu\n", sess->name.c_str(), tensor->name, data,
13291332
offset, size);
13301333

13311334
switch (tensor->type) {
@@ -1366,7 +1369,7 @@ static bool ggml_backend_hexagon_buffer_cpy_tensor(ggml_backend_buffer_t bu
13661369
static void ggml_backend_hexagon_buffer_clear(ggml_backend_buffer_t buffer, uint8_t value) {
13671370
auto ctx = (ggml_backend_hexagon_buffer_context *) buffer->context;
13681371
auto sess = ctx->sess;
1369-
GGML_LOG_DEBUG("ggml-hex: %s clear-buff base %p size %zu\n", sess->name.c_str(), (void *) ctx->base, ctx->size);
1372+
HEX_VERBOSE("ggml-hex: %s clear-buff base %p size %zu\n", sess->name.c_str(), (void *) ctx->base, ctx->size);
13701373
memset(ctx->base, value, ctx->size);
13711374
}
13721375

@@ -2128,7 +2131,7 @@ static void hex_dump_dspbuf(const struct ggml_tensor * t, const dspqueue_buffer
21282131
auto buf = static_cast<ggml_backend_hexagon_buffer_context *>(t->buffer->context);
21292132
auto sess = buf->sess;
21302133

2131-
GGML_LOG_DEBUG("ggml-hex: %s dspqbuf : %s base-addr %p base-size %zu data %p offset %u size %u\n", sess->name.c_str(),
2134+
HEX_VERBOSE("ggml-hex: %s dspqbuf : %s base-addr %p base-size %zu data %p offset %u size %u\n", sess->name.c_str(),
21322135
t->name, (void *) buf->base, buf->size, (void *) d->ptr, (unsigned int) d->offset,
21332136
(unsigned int) d->size);
21342137
}
@@ -2211,7 +2214,7 @@ static void ggml_hexagon_mul_mat(const struct ggml_tensor * op, uint32_t flags)
22112214
hex_format_op_buffs(buffs, op);
22122215
hex_format_op_names(names, op);
22132216

2214-
GGML_LOG_DEBUG("ggml-hex: %s %s: %s : %s : %s : %s : %s: flags 0x%x\n", sess->name.c_str(), ggml_op_name(op->op),
2217+
HEX_VERBOSE("ggml-hex: %s %s: %s : %s : %s : %s : %s: flags 0x%x\n", sess->name.c_str(), ggml_op_name(op->op),
22152218
names, dims, types, strides, buffs, req.flags);
22162219
if (opt_verbose > 1) {
22172220
hex_dump_dspbuf(src0, &bufs[0]);
@@ -2348,7 +2351,7 @@ static void ggml_hexagon_mul_mat_id(const struct ggml_tensor * op, uint32_t flag
23482351
hex_format_op_buffs(buffs, op);
23492352
hex_format_op_names(names, op);
23502353

2351-
GGML_LOG_DEBUG("ggml-hex: %s %s: %s : %s : %s : %s : %s: flags 0x%x\n", sess->name.c_str(), ggml_op_name(op->op),
2354+
HEX_VERBOSE("ggml-hex: %s %s: %s : %s : %s : %s : %s: flags 0x%x\n", sess->name.c_str(), ggml_op_name(op->op),
23522355
names, dims, types, strides, buffs, req.flags);
23532356

23542357
if (opt_verbose > 1) {
@@ -2496,7 +2499,7 @@ static void ggml_hexagon_binary(const struct ggml_tensor * op, uint32_t flags) {
24962499
hex_format_op_buffs(buffs, op);
24972500
hex_format_op_names(names, op);
24982501

2499-
GGML_LOG_DEBUG("ggml-hex: %s %s : %s : %s : %s : %s : %s : flags 0x%x\n", sess->name.c_str(),
2502+
HEX_VERBOSE("ggml-hex: %s %s : %s : %s : %s : %s : %s : flags 0x%x\n", sess->name.c_str(),
25002503
ggml_op_name(node->op), names, dims, types, strides, buffs, req.flags);
25012504
if (opt_verbose > 1) {
25022505
hex_dump_dspbuf(src0, &bufs[0]);
@@ -2635,7 +2638,7 @@ static void ggml_hexagon_add_id(const struct ggml_tensor * op, uint32_t flags) {
26352638
hex_format_op_buffs(buffs, op);
26362639
hex_format_op_names(names, op);
26372640

2638-
GGML_LOG_DEBUG("ggml-hex: %s %s : %s : %s : %s : %s : %s : flags 0x%x\n", sess->name.c_str(),
2641+
HEX_VERBOSE("ggml-hex: %s %s : %s : %s : %s : %s : %s : flags 0x%x\n", sess->name.c_str(),
26392642
ggml_op_name(node->op), names, dims, types, strides, buffs, req.flags);
26402643

26412644
if (opt_verbose > 1) {
@@ -2815,7 +2818,7 @@ static void ggml_hexagon_unary(const struct ggml_tensor * op, uint32_t flags) {
28152818
hex_format_op_buffs(buffs, op);
28162819
hex_format_op_names(names, op);
28172820

2818-
GGML_LOG_DEBUG("ggml-hex: %s %s : %s : %s : %s : %s : %s : flags 0x%x\n", sess->name.c_str(), ggml_op_name(op->op),
2821+
HEX_VERBOSE("ggml-hex: %s %s : %s : %s : %s : %s : %s : flags 0x%x\n", sess->name.c_str(), ggml_op_name(op->op),
28192822
names, dims, types, strides, buffs, req.flags);
28202823
if (opt_verbose > 1) {
28212824
hex_dump_dspbuf(src0, &bufs[0]);
@@ -2988,7 +2991,7 @@ static void ggml_hexagon_rope(const struct ggml_tensor * op, uint32_t flags) {
29882991
hex_format_op_buffs(buffs, op);
29892992
hex_format_op_names(names, op);
29902993

2991-
GGML_LOG_DEBUG("ggml-hex: %s %s : %s : %s : %s : %s : %s : flags 0x%x\n", sess->name.c_str(), ggml_op_name(op->op),
2994+
HEX_VERBOSE("ggml-hex: %s %s : %s : %s : %s : %s : %s : flags 0x%x\n", sess->name.c_str(), ggml_op_name(op->op),
29922995
names, dims, types, strides, buffs, req.flags);
29932996
if (opt_verbose > 1) {
29942997
hex_dump_dspbuf(src0, &bufs[0]);
@@ -3092,7 +3095,7 @@ static inline int last_compute_op(ggml_cgraph * graph) {
30923095
static ggml_status ggml_backend_hexagon_graph_compute(ggml_backend_t backend, ggml_cgraph * graph) {
30933096
auto sess = static_cast<ggml_hexagon_session *>(backend->context);
30943097

3095-
GGML_LOG_DEBUG("ggml-hex: %s graph-compute n_nodes %d\n", sess->name.c_str(), graph->n_nodes);
3098+
HEX_VERBOSE("ggml-hex: %s graph-compute n_nodes %d\n", sess->name.c_str(), graph->n_nodes);
30963099

30973100
const int last = last_compute_op(graph);
30983101

@@ -3176,7 +3179,7 @@ static ggml_status ggml_backend_hexagon_graph_compute(ggml_backend_t backend, gg
31763179
static void ggml_backend_hexagon_synchronize(ggml_backend_t backend) {
31773180
auto sess = static_cast<ggml_hexagon_session *>(backend->context);
31783181

3179-
GGML_LOG_DEBUG("ggml-hex: %s synchronize\n", sess->name.c_str());
3182+
HEX_VERBOSE("ggml-hex: %s synchronize\n", sess->name.c_str());
31803183

31813184
// Wait until all pending ops complete
31823185
while (sess->op_pending) {
@@ -3515,7 +3518,7 @@ static bool ggml_backend_hexagon_device_supports_op(ggml_backend_dev_t dev, cons
35153518
hex_format_op_buffs(buffs, op);
35163519
hex_format_op_names(names, op);
35173520

3518-
GGML_LOG_DEBUG("ggml-hex: %s device-supports-op %s : %s : %s : %s : %s : %s : (%d)\n", sess->name.c_str(),
3521+
HEX_VERBOSE("ggml-hex: %s device-supports-op %s : %s : %s : %s : %s : %s : (%d)\n", sess->name.c_str(),
35193522
ggml_op_name(op->op), names, dims, types, strides, buffs, (int) supp);
35203523
}
35213524

@@ -3535,14 +3538,14 @@ static bool ggml_backend_hexagon_device_supports_buft(ggml_backend_dev_t dev, gg
35353538
// Need session/domain-id for buffers to be compatible
35363539
bool supp = (s0->session_id == s1->session_id);
35373540

3538-
GGML_LOG_DEBUG("ggml-hex: %s device-supports-buft %s (%d)\n", s0->name.c_str(), s1->name.c_str(), (int) supp);
3541+
HEX_VERBOSE("ggml-hex: %s device-supports-buft %s (%d)\n", s0->name.c_str(), s1->name.c_str(), (int) supp);
35393542

35403543
return supp;
35413544
}
35423545

35433546
static ggml_backend_buffer_type_t * ggml_backend_hexagon_device_get_extra_buffers_type(ggml_backend_dev_t dev) {
35443547
auto s0 = static_cast<ggml_hexagon_session *>(dev->context);
3545-
GGML_LOG_DEBUG("ggml-hex: device-get-extra-buft : %s \n", s0->name.c_str());
3548+
HEX_VERBOSE("ggml-hex: device-get-extra-buft : %s \n", s0->name.c_str());
35463549

35473550
static ggml_backend_buffer_type_t bufts[2];
35483551
bufts[0] = ggml_backend_hexagon_device_get_repack_buffer_type(dev);
@@ -3687,7 +3690,7 @@ static void ggml_hexagon_init(ggml_backend_reg * reg) {
36873690

36883691
reg->context = new ggml_hexagon_registry(reg);
36893692

3690-
GGML_LOG_DEBUG("ggml-hex: size-of-general-req %zu size-of-general-rsp %zu\n", sizeof(struct htp_general_req),
3693+
HEX_VERBOSE("ggml-hex: size-of-general-req %zu size-of-general-rsp %zu\n", sizeof(struct htp_general_req),
36913694
sizeof(struct htp_general_rsp));
36923695
}
36933696

0 commit comments

Comments
 (0)