From f0ced9fb3d5fbdda7a65d5baab50badd4f67c620 Mon Sep 17 00:00:00 2001 From: bssrdf Date: Mon, 3 Nov 2025 10:10:51 -0500 Subject: [PATCH] add some test cases in test-backend-op perf --- tests/test-backend-ops.cpp | 44 ++++++++++++++++++++++++++++++++++++++ tests/test-conv3d.cpp | 4 ++-- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/tests/test-backend-ops.cpp b/tests/test-backend-ops.cpp index 04fa1b62d3..f8a9b8f4b8 100644 --- a/tests/test-backend-ops.cpp +++ b/tests/test-backend-ops.cpp @@ -7374,6 +7374,50 @@ static std::vector> make_test_cases_perf() { } } + + for (ggml_type kernel_type : {GGML_TYPE_F32, GGML_TYPE_F16}) { + for (int N : {1}) { + for (int IC : {320, 640}) { + for (int OC : {320, 640}) { + for (int s0 : {1}) { + for (int p1 : {1}) { + for (int d2 : {1}) { + int64_t IW = 26, IH = 38, ID = 8; + int64_t KW = 3, KH = 3, KD = 3; + int s1 = s0, s2 = s0; + int p0 = p1, p2 = p1; + int d0 = d2, d1 = d2; + test_cases.emplace_back(new test_conv_3d( + N, IC, ID, IH, IW, + OC, KD, KH, KW, + s0, s1, s2, p0, p1, p2, d0, d1, d2, + kernel_type)); + IW = 52; IH = 76; + test_cases.emplace_back(new test_conv_3d( + N, IC, ID, IH, IW, + OC, KD, KH, KW, + s0, s1, s2, p0, p1, p2, d0, d1, d2, + kernel_type)); + IW = 104; IH = 158; + test_cases.emplace_back(new test_conv_3d( + N, IC, ID, IH, IW, + OC, KD, KH, KW, + s0, s1, s2, p0, p1, p2, d0, d1, d2, + kernel_type)); + IW = 208; IH = 316; + test_cases.emplace_back(new test_conv_3d( + N, IC, ID, IH, IW, + OC, KD, KH, KW, + s0, s1, s2, p0, p1, p2, d0, d1, d2, + kernel_type)); + } + } + } + } + } + } + } + test_cases.emplace_back(new test_bin_bcast(ggml_add, GGML_TYPE_F32, {4096, 1, 1, 1}, {1, 1, 1, 1})); test_cases.emplace_back(new test_bin_bcast(ggml_add, GGML_TYPE_F32, {4096, 1, 1, 1}, {1, 512, 1, 1})); diff --git a/tests/test-conv3d.cpp b/tests/test-conv3d.cpp index a004798522..f5c23aa940 100644 --- a/tests/test-conv3d.cpp +++ b/tests/test-conv3d.cpp @@ -38,8 +38,8 @@ struct test_model { }; void load_model(test_model & model, int ic, int oc, int iw, int ih, int id, - int kw = 3, int kh = 3, int kd = 3, - bool use_fp16 = true, bool use_gpu = false ); + int kw, int kh, int kd, + bool use_fp16, bool use_gpu); struct ggml_cgraph * build_graph_0(const test_model& model, const int64_t ic, const int64_t n, const int64_t oc); struct ggml_cgraph * build_graph_1(const test_model& model, const int64_t ic, const int64_t n, const int64_t oc); typedef struct ggml_cgraph* (*build_graph_t)(const test_model& model,