When I tested GGML_OP_OPT_STEP_ADAMW I had mistyped the filter for test-backend-ops so I didn't notice that the test is broken. The problem is that the gradients for tensors are no longer being allocated unless a backward graph is constructed. This can simply be fixed by explicitly creating a tensor the gradients. Also I'm changing the interface for ggml_opt_step_adamw to accept a gradient tensor since the long term goal for ggml_tensor.grad is to remove it.
Fixup for https://github.com/ggerganov/ggml/pull/966 .
When I tested
GGML_OP_OPT_STEP_ADAMW
I had mistyped the filter fortest-backend-ops
so I didn't notice that the test is broken. The problem is that the gradients for tensors are no longer being allocated unless a backward graph is constructed. This can simply be fixed by explicitly creating a tensor the gradients. Also I'm changing the interface forggml_opt_step_adamw
to accept a gradient tensor since the long term goal forggml_tensor.grad
is to remove it.