-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.dot file of ggml_graph can not be generated to .png file #589
Comments
The full network is too heavy to be plotted by graphviz. Simply apply this patch: diff --git a/llama.cpp b/llama.cpp
index 2d02792..29928a0 100644
--- a/llama.cpp
+++ b/llama.cpp
@@ -863,7 +863,7 @@ static bool llama_eval_internal(
struct ggml_tensor * inpL = ggml_get_rows(ctx0, model.tok_embeddings, embd);
- for (int il = 0; il < n_layer; ++il) {
+ for (int il = 0; il < 1; ++il) {
struct ggml_tensor * inpSA = inpL;
struct ggml_tensor * cur;
@@ -1027,10 +1027,10 @@ static bool llama_eval_internal(
ggml_build_forward_expand(&gf, inpL);
ggml_graph_compute (ctx0, &gf);
- //if (n_past%100 == 0) {
- // ggml_graph_print (&gf);
- // ggml_graph_dump_dot(&gf, NULL, "gpt-2.dot");
- //}
+ if (n_past%100 == 0) {
+ ggml_graph_print (&gf);
+ ggml_graph_dump_dot(&gf, NULL, "llama-1l.dot");
+ }
//embd_w.resize(n_vocab*N);
//memcpy(embd_w.data(), ggml_get_data(inpL), sizeof(float)*n_vocab*N); Run the inference once and then generate a
Here is the result: |
Thx @ggerganov ! |
If you use the |
Thank you very much
|
Hi, I want to generate a picture of the grapj. And I uncommented this 2 lines in "llama.cpp", so that to run the function
ggml_graph_dump_dot()
And I got a file named
gpt-2.dot
But when I run command in python:
I get the error message:
Expect '{' but got '['
So I modifid the function
ggml_graph_dump_dot()
inggml.c
like this:To replace the '[' and

]
to '{' and '}'Then it doesn't have new error , but the process blocked, can not stop.Blocked in here:
And I also run command in windows powershell, but it still blocked like this:

same in wsl:
So can anybody know what can I do? Thanks
Attach is the .dot file generated by me, you can modify the suffix from
gpt-2.txt
togpt-2.dot
. The model size is 7B-version.gpt-2.txt
The text was updated successfully, but these errors were encountered: