Skip to content

Commit 9a4236c

Browse files
danbevNexesenex
authored andcommitted
ggml-alloc : remove buffer_id from leaf_alloc (ggml/987)
This commit removes the buffer_id field from the leaf_alloc struct. The motivation for is that this field is only written to and never read/used as far as I can tell. Each tensor_alloc has a buffer_id field and this is what caused me to look into this more closely, to understand what the buffer_id in leaf_alloc was used for.
1 parent 340e4a6 commit 9a4236c

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

ggml/src/ggml-alloc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ struct tensor_alloc {
342342
};
343343

344344
struct leaf_alloc {
345-
int buffer_id;
346345
struct tensor_alloc leaf;
347346
};
348347

@@ -734,7 +733,6 @@ bool ggml_gallocr_reserve_n(ggml_gallocr_t galloc, struct ggml_cgraph * graph, c
734733
for (int i = 0; i < graph->n_leafs; i++) {
735734
struct ggml_tensor * leaf = graph->leafs[i];
736735
struct hash_node * hn = ggml_gallocr_hash_get(galloc, leaf);
737-
galloc->leaf_allocs[i].buffer_id = hn->buffer_id;
738736
if (leaf->view_src || leaf->data) {
739737
galloc->leaf_allocs[i].leaf.buffer_id = -1;
740738
galloc->leaf_allocs[i].leaf.offset = SIZE_MAX;

0 commit comments

Comments
 (0)