From: Georgi Gerganov Date: Sun, 8 Sep 2024 06:57:57 +0000 (+0300) Subject: metal : update support condition for im2col + fix warning (#0) X-Git-Tag: upstream/0.0.4488~788 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=a8768614558262b6762fc0feeddcc6f7ce4bc5fc;p=pkg%2Fggml%2Fsources%2Fllama.cpp metal : update support condition for im2col + fix warning (#0) --- diff --git a/ggml/src/ggml-metal.m b/ggml/src/ggml-metal.m index 91b5e61b..f04e5af7 100644 --- a/ggml/src/ggml-metal.m +++ b/ggml/src/ggml-metal.m @@ -799,8 +799,9 @@ static bool ggml_metal_supports_op(const struct ggml_backend_metal_context * ctx return ctx->support_simdgroup_reduction; case GGML_OP_NORM: case GGML_OP_ROPE: - case GGML_OP_IM2COL: return true; + case GGML_OP_IM2COL: + return op->src[0]->type == GGML_TYPE_F16; case GGML_OP_POOL_1D: case GGML_OP_POOL_2D: return false; diff --git a/tests/test-backend-ops.cpp b/tests/test-backend-ops.cpp index 8f659c14..635de01d 100644 --- a/tests/test-backend-ops.cpp +++ b/tests/test-backend-ops.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -33,7 +34,6 @@ #include #include - static void init_tensor_uniform(ggml_tensor * tensor, float min = -1.0f, float max = 1.0f) { // static RNG initialization (revisit if n_threads stops being constant) static const size_t n_threads = std::thread::hardware_concurrency(); @@ -869,7 +869,7 @@ struct test_case { for (int64_t i = 0; i < ne; ++i) { // gradient algebraic // check for nans if (!std::isfinite(ga[i])) { - printf("[%s] nonfinite gradient at index %zu (%s=%f) ", ggml_op_desc(t), i, bn, ga[i]); + printf("[%s] nonfinite gradient at index %" PRId64 " (%s=%f) ", ggml_op_desc(t), i, bn, ga[i]); ok = false; break; }