mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-19 01:05:09 +02:00
hack to allow kokoro to remain functional even with much higher GGML_SCHED_MAX_SPLIT_INPUTS
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user