Skip to content

Commit 5294542

Browse files
committed
tests : remove benchmarks
ggml-ci
1 parent 29f6ad8 commit 5294542

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tests/test-backend-ops.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
#include <thread>
1616
#include <vector>
1717

18+
// TODO: remove before merging
19+
//#define TMP_ATTN_BENCH
20+
1821
static void init_tensor_uniform(ggml_tensor * tensor, float min = -1.0f, float max = 1.0f) {
1922
// static RNG initialization (revisit if n_threads stops being constant)
2023
static const size_t n_threads = std::thread::hardware_concurrency();
@@ -571,7 +574,7 @@ struct test_case {
571574
// duplicate the op
572575
size_t target_size = ggml_backend_is_cpu(backend) ? 1ULL << 33 : 1ULL << 35; // 8 GB CPU, 32 GB GPU
573576
int n_runs = std::min((size_t)gf->size - gf->n_nodes, target_size / op_size(out)) + 1;
574-
#if 0
577+
#ifndef TMP_ATTN_BENCH
575578
for (int i = 1; i < n_runs; i++) {
576579
gf->nodes[gf->n_nodes++] = out;
577580
}
@@ -1513,8 +1516,8 @@ struct test_flash_attn_ext : public test_case {
15131516
}
15141517
};
15151518

1519+
#ifdef TMP_ATTN_BENCH
15161520
// ATTN
1517-
// TODO: this is temporary until the FA branch is merged
15181521
struct test_attn : public test_case {
15191522
const int64_t hs; // head size
15201523
const int64_t nh; // num heads
@@ -1555,6 +1558,7 @@ struct test_attn : public test_case {
15551558
return cur;
15561559
}
15571560
};
1561+
#endif
15581562

15591563
enum llm_norm_type {
15601564
LLM_NORM,
@@ -2220,7 +2224,7 @@ static bool test_backend(ggml_backend_t backend, test_mode mode, const char * op
22202224
test_cases.emplace_back(new test_timestep_embedding());
22212225
test_cases.emplace_back(new test_leaky_relu());
22222226

2223-
#if 1
2227+
#ifdef TMP_ATTN_BENCH
22242228
for (int hs : { 128, 256, 64, 80, }) {
22252229
for (int nh : { 32, }) {
22262230
for (int kv : { 512, 1024, 2048, 4096, }) {
@@ -2232,11 +2236,10 @@ static bool test_backend(ggml_backend_t backend, test_mode mode, const char * op
22322236
}
22332237
}
22342238
#else
2235-
for (int hs : { 128, }) {
2239+
for (int hs : { 64, 80, 128, 256, }) {
22362240
for (int nh : { 32, }) {
22372241
for (int kv : { 512, 1024, }) {
2238-
for (int nb : { 1, 2, 4, 8, 512 }) {
2239-
test_cases.emplace_back(new test_attn (hs, nh, kv, nb));
2242+
for (int nb : { 1, 2, 4, 8, }) {
22402243
test_cases.emplace_back(new test_flash_attn_ext(hs, nh, kv, nb));
22412244
}
22422245
}

0 commit comments

Comments
 (0)