add ggml_opt_resume_g which accepts forward and backward cgraphs
This commit is contained in:
parent
83a34444af
commit
0e269665cd
2 changed files with 19 additions and 0 deletions
11
ggml.c
11
ggml.c
|
@ -17457,6 +17457,17 @@ enum ggml_opt_result ggml_opt_resume(
|
||||||
*gf = ggml_build_forward (f);
|
*gf = ggml_build_forward (f);
|
||||||
*gb = ggml_build_backward(ctx, gf, true);
|
*gb = ggml_build_backward(ctx, gf, true);
|
||||||
|
|
||||||
|
return ggml_opt_resume_g(ctx, opt, f, gf, gb);
|
||||||
|
}
|
||||||
|
|
||||||
|
enum ggml_opt_result ggml_opt_resume_g(
|
||||||
|
struct ggml_context * ctx,
|
||||||
|
struct ggml_opt_context * opt,
|
||||||
|
struct ggml_tensor * f,
|
||||||
|
struct ggml_cgraph * gf,
|
||||||
|
struct ggml_cgraph * gb) {
|
||||||
|
|
||||||
|
// build forward + backward compute graphs
|
||||||
enum ggml_opt_result result = GGML_OPT_OK;
|
enum ggml_opt_result result = GGML_OPT_OK;
|
||||||
|
|
||||||
switch (opt->params.type) {
|
switch (opt->params.type) {
|
||||||
|
|
8
ggml.h
8
ggml.h
|
@ -1208,6 +1208,14 @@ extern "C" {
|
||||||
struct ggml_opt_context * opt,
|
struct ggml_opt_context * opt,
|
||||||
struct ggml_tensor * f);
|
struct ggml_tensor * f);
|
||||||
|
|
||||||
|
// continue optimizing the function defined by the tensor f
|
||||||
|
GGML_API enum ggml_opt_result ggml_opt_resume_g(
|
||||||
|
struct ggml_context * ctx,
|
||||||
|
struct ggml_opt_context * opt,
|
||||||
|
struct ggml_tensor * f,
|
||||||
|
struct ggml_cgraph * gf,
|
||||||
|
struct ggml_cgraph * gb);
|
||||||
|
|
||||||
//
|
//
|
||||||
// quantization
|
// quantization
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue