cont : add warning about unsupported ops

This commit is contained in:
Georgi Gerganov 2025-10-30 18:15:34 +02:00
parent 3aa835bfe6
commit a4b54f2697
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735
1 changed files with 15 additions and 0 deletions

View File

@ -28,6 +28,7 @@
#include <numeric> #include <numeric>
#include <functional> #include <functional>
// TODO: allow to pass callback from user code
struct clip_logger_state g_logger_state = {GGML_LOG_LEVEL_CONT, clip_log_callback_default, NULL}; struct clip_logger_state g_logger_state = {GGML_LOG_LEVEL_CONT, clip_log_callback_default, NULL};
enum ffn_op_type { enum ffn_op_type {
@ -3188,6 +3189,11 @@ struct clip_model_loader {
size / 1024.0 / 1024.0); size / 1024.0 / 1024.0);
} }
} }
const int n_splits = ggml_backend_sched_get_n_splits(ctx_clip.sched.get());
const int n_nodes = ggml_graph_n_nodes(gf);
LOG_INF("%s: graph splits = %d, nodes = %d\n", __func__, n_splits, n_nodes);
} }
void get_bool(const std::string & key, bool & output, bool required = true) { void get_bool(const std::string & key, bool & output, bool required = true) {
@ -4373,6 +4379,15 @@ bool clip_image_batch_encode(clip_ctx * ctx, const int n_threads, const clip_ima
return false; // only support batch size of 1 return false; // only support batch size of 1
} }
if (ggml_backend_sched_get_n_splits(ctx->sched.get()) > 1) {
LOG_WRN("%s: *****************************************************************\n", __func__);
LOG_WRN("%s: WARNING: the CLIP graph uses unsupported operators by the backend\n", __func__);
LOG_WRN("%s: the performance will be suboptimal \n", __func__);
LOG_WRN("%s: \n", __func__);
LOG_WRN("%s: ref: https://github.com/ggml-org/llama.cpp/pull/16837#issuecomment-3461676118\n", __func__);
LOG_WRN("%s: *****************************************************************\n", __func__);
}
// build the inference graph // build the inference graph
ctx->debug_print_tensors.clear(); ctx->debug_print_tensors.clear();
ggml_backend_sched_reset(ctx->sched.get()); ggml_backend_sched_reset(ctx->sched.get());