From: Georgi Gerganov Date: Sun, 2 Jul 2023 15:53:42 +0000 (+0300) Subject: ggml : disable ggml_rope_back for ChatGLM X-Git-Tag: upstream/0.0.1642~1363 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=97f72d8459923409679e61b5eb1cc976bdaed17c;p=pkg%2Fggml%2Fsources%2Fggml ggml : disable ggml_rope_back for ChatGLM --- diff --git a/src/ggml.c b/src/ggml.c index 60b195b5..aed3fcf5 100644 --- a/src/ggml.c +++ b/src/ggml.c @@ -7002,6 +7002,8 @@ struct ggml_tensor * ggml_rope_back( int n_dims, int mode) { GGML_ASSERT(n_past >= 0); + GGML_ASSERT((mode & 4) == 0 && "ggml_rope_back() for ChatGLM not implemented yet"); + bool is_node = false; if (a->grad) { @@ -15718,7 +15720,7 @@ static void ggml_compute_backward(struct ggml_context * ctx, struct ggml_tensor // necessary for llama if (src0->grad) { assert(src1->type == GGML_TYPE_I32); - assert(ggml_nelements(src1) == 3); + assert(ggml_nelements(src1) == 4); const int n_past = ((int32_t *) src1->data)[0]; const int n_dims = ((int32_t *) src1->data)[1]; const int mode = ((int32_t *) src1->data)[2]; diff --git a/tests/test-grad0.c b/tests/test-grad0.c index ce5dc32b..a3e25214 100644 --- a/tests/test-grad0.c +++ b/tests/test-grad0.c @@ -1139,7 +1139,7 @@ int main(int argc, const char ** argv) { int n_rot = ne2[0]; for (int ndims = 3; ndims <= 4; ++ndims) { - for (int mode = 0; mode < 8; ++mode) { + for (int mode = 0; mode < 4; ++mode) { for (int n_past = 1; n_past < ne2[2]; ++n_past) { x[0] = get_random_tensor(ctx0, ndims, ne2, -1.0f, 1.0f);