Skip to content

Commit 83928e8

Browse files
committed
abort when rope type not supported, remove GLM from test-rope
1 parent a0bf696 commit 83928e8

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

ggml/src/ggml-cpu/ops.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5674,8 +5674,7 @@ static void ggml_compute_forward_rope_flt(
56745674
rotate_pairs<T>(ne0, n_dims, cache, src, dst_data);
56755675
break;
56765676
default:
5677-
//rope type not supported, silently default to NORMAL
5678-
rotate_pairs<T>(n_dims, 1, cache, src, dst_data, 1);
5677+
GGML_ABORT("rope type not supported");
56795678
}
56805679

56815680
if (!is_vision) {

tests/test-rope.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ int main(int /*argc*/, const char ** /*argv*/) {
138138
struct ggml_tensor * x;
139139

140140
// rope f32
141-
for (int m = 0; m < 5; ++m) {
141+
for (int m = 0; m < 4; ++m) {
142142
const int ndims = 4;
143143

144144
const int64_t n_rot = 128;
@@ -153,7 +153,7 @@ int main(int /*argc*/, const char ** /*argv*/) {
153153
x = get_random_tensor_f32(ctx0, ndims, ne, -1.0f, 1.0f);
154154
int mode = -1;
155155

156-
if (m < 3) {
156+
if (m < 2) {
157157
struct ggml_tensor * p0 = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, ne[2]);
158158
struct ggml_tensor * p1 = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, ne[2]);
159159
struct ggml_tensor * p2 = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, ne[2]);
@@ -163,9 +163,8 @@ int main(int /*argc*/, const char ** /*argv*/) {
163163
((int32_t *) p1->data)[i] = n_past_2 - n_past_0;
164164
((int32_t *) p2->data)[i] = n_past_2 + i;
165165
}
166-
// test mode 0, 2, 4 (standard, GPT-NeoX, GLM)
167-
// note: GLM is not implemented, it will default to standard
168-
mode = m == 0 ? 0 : m == 1 ? 2 : 4;
166+
// test mode 0, 2 (standard, GPT-NeoX)
167+
mode = m == 0 ? GGML_ROPE_TYPE_NORMAL : GGML_ROPE_TYPE_NEOX;
169168

170169
// 100, 101, 102, ..., 172
171170
r0 = ggml_rope(ctx0, x, p0, n_rot, mode);
@@ -181,7 +180,7 @@ int main(int /*argc*/, const char ** /*argv*/) {
181180
struct ggml_tensor * p2 = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, ne[2] * 4);
182181

183182
int sections[4] = {16, 24, 24, 0};
184-
mode = (m == 3) ? GGML_ROPE_TYPE_MROPE : GGML_ROPE_TYPE_VISION;
183+
mode = (m == 2) ? GGML_ROPE_TYPE_MROPE : GGML_ROPE_TYPE_VISION;
185184

186185
for (int i = 0; i < ne[2]; ++i) {
187186
for (int j = 0; j < 4; ++j) {

0 commit comments

Comments
 (0)