Skip to content

Commit 2a6c387

Browse files
committed
add rope tests for perf
1 parent 2cfa7ae commit 2a6c387

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test-backend-ops.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7475,6 +7475,22 @@ static std::vector<std::unique_ptr<test_case>> make_test_cases_perf() {
74757475
test_cases.emplace_back(new test_add_id(GGML_TYPE_F32, GGML_TYPE_F32, 2880, 32, 4, n_token));
74767476
}
74777477

7478+
for (bool fw : {true, false}) { // fw == forward
7479+
for (ggml_type type : {GGML_TYPE_F32, GGML_TYPE_F16}) {
7480+
for (bool ff : {false, true}) { // freq_factors
7481+
for (float v : { 0, 1 }) {
7482+
test_cases.emplace_back(new test_rope(type, {128, 32, 512, 1}, 128, GGML_ROPE_TYPE_NORMAL, 512, 1.0f, 0.0f, 1.0f, ff, v, fw)); // llama 7B
7483+
test_cases.emplace_back(new test_rope(type, {128, 64, 512, 1}, 128, GGML_ROPE_TYPE_NORMAL, 512, 1.0f, 0.0f, 1.0f, ff, v, fw)); // llama 65B
7484+
test_cases.emplace_back(new test_rope(type, { 80, 32, 512, 1}, 20, GGML_ROPE_TYPE_NEOX, 512, 1.0f, 0.0f, 1.0f, ff, v, fw)); // neox (stablelm)
7485+
test_cases.emplace_back(new test_rope(type, { 64, 8, 512, 1}, 64, GGML_ROPE_TYPE_NEOX, 512, 1.0f, 0.0f, 1.0f, ff, v, fw)); // neox (falcon 40B)
7486+
test_cases.emplace_back(new test_rope(type, {128, 12, 512, 1}, 128, GGML_ROPE_TYPE_MROPE, 512, 1.0f, 0.0f, 1.0f, ff, v, fw)); // rope_multi,m-rope (qwen2vl 2B)
7487+
test_cases.emplace_back(new test_rope(type, {128, 12, 2, 1}, 128, GGML_ROPE_TYPE_IMROPE, 512, 1.0f, 0.0f, 1.0f, ff, v, fw)); // rope_multi,imrope (qwen3vl 2B)
7488+
test_cases.emplace_back(new test_rope(type, { 80, 16, 2, 1}, 80, GGML_ROPE_TYPE_VISION, 512, 1.0f, 0.0f, 1.0f, ff, v, fw)); // rope_multi,m-rope (qwen2vl ViT)
7489+
}
7490+
}
7491+
}
7492+
}
7493+
74787494
std::vector<std::array<int64_t, 4>> reduce_rows_cases = {
74797495
{ 8192, 1, 1, 1 },
74807496
{ 8192, 8192, 1, 1 },

0 commit comments

Comments
 (0)