File tree Expand file tree Collapse file tree 2 files changed +2
-10
lines changed Expand file tree Collapse file tree 2 files changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -419,8 +419,6 @@ ggml_opt_context_t ggml_opt_init(struct ggml_opt_params params) {
419419 result->buf_static = ggml_backend_alloc_ctx_tensors (result->ctx_static , ggml_backend_sched_get_backend (result->backend_sched , 0 ));
420420 result->buf_static_cpu = nullptr ;
421421
422- ggml_opt_alloc_graph (result, result->gf );
423-
424422 return result;
425423 }
426424
@@ -434,7 +432,6 @@ ggml_opt_context_t ggml_opt_init(struct ggml_opt_params params) {
434432 result->buf_static = ggml_backend_alloc_ctx_tensors (result->ctx_static , ggml_backend_sched_get_backend (result->backend_sched , 0 ));
435433 result->buf_static_cpu = nullptr ;
436434
437- ggml_opt_alloc_graph (result, result->gb_grad );
438435 ggml_graph_reset (result->gb_grad );
439436
440437 return result;
@@ -466,7 +463,6 @@ ggml_opt_context_t ggml_opt_init(struct ggml_opt_params params) {
466463
467464 result->buf_static_cpu = ggml_backend_alloc_ctx_tensors_from_buft (result->ctx_static_cpu , ggml_backend_cpu_buffer_type ());
468465
469- ggml_opt_alloc_graph (result, result->gb_opt );
470466 ggml_graph_reset (result->gb_opt );
471467
472468 return result;
Original file line number Diff line number Diff line change @@ -5839,12 +5839,8 @@ void ggml_graph_reset(struct ggml_cgraph * cgraph) {
58395839
58405840 if (node -> op == GGML_OP_OPT_STEP_ADAMW ) {
58415841 // clear momenta
5842- if (node -> src [2 ]-> data ) {
5843- ggml_set_zero (node -> src [2 ]);
5844- }
5845- if (node -> src [3 ]-> data ) {
5846- ggml_set_zero (node -> src [3 ]);
5847- }
5842+ ggml_set_zero (node -> src [2 ]);
5843+ ggml_set_zero (node -> src [3 ]);
58485844 }
58495845
58505846 // initial gradients of loss should be 1, 0 otherwise
You can’t perform that action at this time.
0 commit comments