hack to allow kokoro to remain functional even with much higher GGML_SCHED_MAX_SPLIT_INPUTS

This commit is contained in:
Concedo
2026-04-19 20:40:07 +08:00
parent 707bb67b30
commit 271c4c332c
3 changed files with 18 additions and 8 deletions
+2 -2
View File
@@ -1489,7 +1489,7 @@ struct kokoro_duration_context * build_new_duration_kokoro_context(struct kokoro
kctx->backend_cpu = ggml_backend_cpu_init();
kctx->set_threads();
kctx->build_schedule();
kctx->buf_compute_meta.resize(ggml_tensor_overhead()*model->max_duration_nodes()*2 + ggml_graph_overhead_custom(model->max_duration_nodes()*2, false));
kctx->buf_compute_meta.resize(ggml_tensor_overhead()*model->max_duration_nodes()*5 + ggml_graph_overhead_custom(model->max_duration_nodes()*5, false));
return kctx;
}
@@ -1499,6 +1499,6 @@ struct kokoro_context * build_new_kokoro_context(struct kokoro_model * model, in
kctx->backend_cpu = ggml_backend_cpu_init();
kctx->set_threads();
kctx->build_schedule();
kctx->buf_compute_meta.resize(ggml_tensor_overhead()*model->max_gen_nodes()*20 + ggml_graph_overhead_custom(model->max_gen_nodes()*20, false));
kctx->buf_compute_meta.resize(ggml_tensor_overhead()*model->max_gen_nodes()*30 + ggml_graph_overhead_custom(model->max_gen_nodes()*30, false));
return kctx;
}
+8 -2
View File
@@ -312,6 +312,8 @@ struct kokoro_ubatch {
struct kokoro_duration_response * resp = nullptr;
};
extern bool kcpp_kokoro_alloc_hack;
struct kokoro_duration_context : runner_context {
kokoro_duration_context(kokoro_model * model, int n_threads): runner_context(n_threads), model(model) {};
~kokoro_duration_context() {
@@ -332,7 +334,9 @@ struct kokoro_duration_context : runner_context {
struct ggml_tensor * token_types = nullptr;
void build_schedule() {
runner_context::build_schedule(model->max_duration_nodes()*2);
kcpp_kokoro_alloc_hack = true;
runner_context::build_schedule(model->max_duration_nodes()*5);
kcpp_kokoro_alloc_hack = false;
}
};
@@ -410,7 +414,9 @@ struct kokoro_context : runner_context {
struct ggml_tensor * uv_noise_data;
void build_schedule() {
runner_context::build_schedule(model->max_gen_nodes()*20);
kcpp_kokoro_alloc_hack = true;
runner_context::build_schedule(model->max_gen_nodes()*30);
kcpp_kokoro_alloc_hack = false;
}
};