perf: change ggml graph eval order to RIGHT_TO_LEFT to optimize memory usage
This commit is contained in:
parent
ed374983f3
commit
3001c23f7d
@ -3455,7 +3455,9 @@ class StableDiffusionGGML {
|
||||
struct ggml_tensor* out = diffusion_model.forward(ctx, noised_input, NULL, context, t_emb);
|
||||
ggml_hold_dynamic_tensor(out);
|
||||
|
||||
struct ggml_cgraph* diffusion_graph = ggml_build_forward_ctx(ctx, out);
|
||||
struct ggml_cgraph* diffusion_graph = ggml_new_graph(ctx);
|
||||
diffusion_graph->order = GGML_CGRAPH_EVAL_ORDER_RIGHT_TO_LEFT;
|
||||
ggml_build_forward_expand(diffusion_graph, out);
|
||||
cplan = ggml_graph_plan(diffusion_graph, n_threads);
|
||||
|
||||
ggml_set_dynamic(ctx, false);
|
||||