Remove gate_first from test_mul_mat_vec_fusion

This commit is contained in:
Oliver Simons
2026-06-17 09:28:59 +02:00
parent 8dd49e004f
commit 89fcfc21d4
+11 -31
View File
@@ -5789,21 +5789,20 @@ struct test_mul_mat_vec_fusion : public test_case {
const bool with_bias;
const bool with_gate;
const bool with_lane_scale;
const bool gate_first;
std::array<int64_t, 2> batch_dims;
test_mul_mat_vec_fusion(ggml_type type, ggml_glu_op op, int64_t m, int64_t n, int64_t k,
bool use_id = false, int n_mats = 1, int n_used = 1, bool b = false, bool with_bias = false, bool with_gate = true,
bool with_lane_scale = false, bool gate_first = false, std::array<int64_t, 2> batch_dims = {4, 2})
bool with_lane_scale = false, std::array<int64_t, 2> batch_dims = {4, 2})
: type(type), glu_op(op), m(m), n(n), k(k), use_id(use_id), n_mats(n_mats), n_used(n_used), b(b), with_bias(with_bias),
with_gate(with_gate), with_lane_scale(with_lane_scale), gate_first(gate_first), batch_dims(batch_dims) {
with_gate(with_gate), with_lane_scale(with_lane_scale), batch_dims(batch_dims) {
if (use_id) {
GGML_ASSERT(n_used <= n_mats);
}
}
std::string vars() override {
return VARS_TO_STR14(type, glu_op, m, n, k, use_id, n_mats, n_used, b, with_bias, with_gate, with_lane_scale, gate_first, batch_dims);
return VARS_TO_STR13(type, glu_op, m, n, k, use_id, n_mats, n_used, b, with_bias, with_gate, with_lane_scale, batch_dims);
}
std::string op_desc(ggml_tensor * t) override {
@@ -5877,15 +5876,8 @@ struct test_mul_mat_vec_fusion : public test_case {
return ffn_gate;
};
ggml_tensor * ffn_up = nullptr;
ggml_tensor * ffn_gate = nullptr;
if (with_gate && gate_first) {
ffn_gate = build_gate_lane();
ffn_up = build_up_lane();
} else {
ffn_up = build_up_lane();
ffn_gate = with_gate ? build_gate_lane() : nullptr;
}
ggml_tensor * ffn_up = build_up_lane();
ggml_tensor * ffn_gate = with_gate ? build_gate_lane() : nullptr;
ggml_tensor * out = with_gate ? build_gate(ctx, ffn_gate, ffn_up) : ffn_up;
@@ -5931,15 +5923,8 @@ struct test_mul_mat_vec_fusion : public test_case {
return ffn_gate;
};
ggml_tensor * ffn_up = nullptr;
ggml_tensor * ffn_gate = nullptr;
if (with_gate && gate_first) {
ffn_gate = build_gate_lane();
ffn_up = build_up_lane();
} else {
ffn_up = build_up_lane();
ffn_gate = with_gate ? build_gate_lane() : nullptr;
}
ggml_tensor * ffn_up = build_up_lane();
ggml_tensor * ffn_gate = with_gate ? build_gate_lane() : nullptr;
ggml_tensor * out = with_gate ? build_gate(ctx, ffn_gate, ffn_up) : ffn_up;
@@ -9147,15 +9132,10 @@ static std::vector<std::unique_ptr<test_case>> make_test_cases_eval() {
if (with_lane_scale && type != GGML_TYPE_NVFP4) {
continue;
}
for (bool gate_first : {false, true}) {
if (!with_gate && gate_first) {
continue;
}
test_cases.emplace_back(new test_mul_mat_vec_fusion(type, glu_op, 1, 32, 256,
use_id, 16, 8, b, with_bias, with_gate, with_lane_scale, gate_first));
test_cases.emplace_back(new test_mul_mat_vec_fusion(type, glu_op, 1, 32, 256,
use_id, 16, 8, b, with_bias, with_gate, with_lane_scale, gate_first, {1, 1}));
}
test_cases.emplace_back(new test_mul_mat_vec_fusion(type, glu_op, 1, 32, 256,
use_id, 16, 8, b, with_bias, with_gate, with_lane_scale));
test_cases.emplace_back(new test_mul_mat_vec_fusion(type, glu_op, 1, 32, 256,
use_id, 16, 8, b, with_bias, with_gate, with_lane_scale, {1, 1}));
}
}
}