mtl : export the LLaMA computation graph
This commit is contained in:
parent
7552ac5863
commit
f85020b19a
5 changed files with 71 additions and 10 deletions
25
examples/mtl/mtl-export.cpp
Normal file
25
examples/mtl/mtl-export.cpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
#include "common.h"
|
||||
#include "llama.h"
|
||||
|
||||
int main(int argc, char ** argv) {
|
||||
gpt_params params;
|
||||
|
||||
if (!gpt_params_parse(argc, argv, params)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
llama_init_backend();
|
||||
|
||||
llama_context * ctx = llama_init_from_gpt_params(params);
|
||||
if (ctx == NULL) {
|
||||
fprintf(stderr, "%s: error: unable to load model\n", __func__);
|
||||
return 1;
|
||||
}
|
||||
|
||||
llama_eval_export(ctx, "llama.ggml");
|
||||
|
||||
llama_print_timings(ctx);
|
||||
llama_free(ctx);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue