Skip to content

Commit

Permalink
ggml : remove tensor ptr from export for now (close #267)
Browse files Browse the repository at this point in the history
Not used for now
  • Loading branch information
ggerganov committed Jul 2, 2023
1 parent daf63b0 commit 50462bb
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -16945,13 +16945,6 @@ void ggml_graph_export(const struct ggml_cgraph * cgraph, const char * fname) {
fwrite(&nb, sizeof(uint64_t), 1, fout);
}

// store the pointer address
{
const uint64_t ptr = (uint64_t) tensor->data;

fwrite(&ptr, sizeof(uint64_t), 1, fout);
}

fwrite(tensor->name, sizeof(char), GGML_MAX_NAME, fout);

// dump the data
Expand Down Expand Up @@ -16985,13 +16978,6 @@ void ggml_graph_export(const struct ggml_cgraph * cgraph, const char * fname) {
fwrite(&nb, sizeof(uint64_t), 1, fout);
}

// store the pointer address
{
const uint64_t ptr = (uint64_t) tensor->data;

fwrite(&ptr, sizeof(uint64_t), 1, fout);
}

fwrite(tensor->name, sizeof(char), GGML_MAX_NAME, fout);

// output the op arguments
Expand Down Expand Up @@ -17176,8 +17162,6 @@ struct ggml_cgraph ggml_graph_import(const char * fname, struct ggml_context **

tensor->op = (enum ggml_op) op;

uint64_t ptr_cur = *(const uint64_t *) ptr; ptr += sizeof(ptr_cur);

memcpy(tensor->name, ptr, GGML_MAX_NAME); ptr += GGML_MAX_NAME;

tensor->data = (void *) ptr;
Expand Down Expand Up @@ -17223,8 +17207,6 @@ struct ggml_cgraph ggml_graph_import(const char * fname, struct ggml_context **
nb[j] = nb_cur;
}

uint64_t ptr_cur = *(const uint64_t *) ptr; ptr += sizeof(ptr_cur); // TODO: not yet used

const char * ptr_name = ptr; ptr += GGML_MAX_NAME;

const int32_t * ptr_arg_idx = (const int32_t *) ptr; ptr += (2 + GGML_MAX_OPT)*sizeof(int32_t);
Expand Down

0 comments on commit 50462bb

Please sign in to comment.