Commit 7778de0c3 for llama.cpp
commit 7778de0c3fe4c4b05857d0abaad6195e470b6515
Author: Aman Gupta <amangupta052@gmail.com>
Date: Mon Nov 23 10:32:56 2026 +0800
tests : compare only the guaranteed GDN snapshot slots (#32820)
diff --git a/tests/test-backend-ops.cpp b/tests/test-backend-ops.cpp
index 91ff4c86a..ca415adf0 100644
--- a/tests/test-backend-ops.cpp
+++ b/tests/test-backend-ops.cpp
@@ -5366,6 +5366,14 @@ struct test_gated_delta_net : public test_case {
// lower bound of the log-gate; a mild gate keeps the state alive over the whole sequence
const float g_min;
+ std::string op_desc(ggml_tensor * t) override {
+ GGML_UNUSED(t);
+ return "GATED_DELTA_NET";
+ }
+
+ // compare only the view returned by build_graph, not the full op output
+ bool run_whole_graph() override { return K > 1 && n_seq_tokens > K; }
+
std::string vars() override {
std::string s = VARS_TO_STR13(type, head_count, head_size, n_seq_tokens, n_seqs, v_repeat, permuted, kda, K, correlated, padded_v, padded_q, permuted_k);
if (g_min != -20.0f) {
@@ -5423,6 +5431,10 @@ struct test_gated_delta_net : public test_case {
k = ggml_cpy(ctx, k, k_permuted);
}
ggml_tensor * out = ggml_gated_delta_net(ctx, q, k, v, g, beta, state, K);
+ if (K > 1 && n_seq_tokens > K) {
+ // n_tokens > K: only slot 0 is guaranteed, so keep the scores and slot 0
+ out = ggml_view_2d(ctx, out, out->ne[0], out->ne[1] - (K - 1) * head_size * n_seqs, out->nb[1], 0);
+ }
return out;
}