Skip to content

Need help to understand the (backward) computational graph #663

Answered by ggerganov
bssrdf asked this question in Q&A
Discussion options

You must be logged in to vote

node_5 and node_4 correspond to the 2 ggml_mul ops in the backward pass for b:

https://github.com/ggerganov/ggml/blob/64746415ee5ad073212871ee1ca4ef800aba1983/tests/test1.c#L23

https://github.com/ggerganov/ggml/blob/64746415ee5ad073212871ee1ca4ef800aba1983/src/ggml.c#L14929-L14945

To try to make it more clear, you can apply this patch and rerun the test:

diff --git a/src/ggml.c b/src/ggml.c
index a9e1ea9..363954d 100644
--- a/src/ggml.c
+++ b/src/ggml.c
@@ -14825,7 +14825,7 @@ void ggml_build_backward_gradient_checkpointing(
 // functions to change gradients considering the case that input a might be initial gradient with zero value
 
 static struct ggml_tensor * ggml_add_or_set(struct gg…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bssrdf
Comment options

Answer selected by bssrdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants