Skip to content

Commit

Permalink
ggml : disable ggml_rope_back for ChatGLM
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Jul 2, 2023
1 parent 50462bb commit 97f72d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion tests/test-grad0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 97f72d8

Please sign in to comment.