Skip to content

Commit 6425a70

Browse files
committed
Add back split buffer type checks
1 parent 3c723a4 commit 6425a70

File tree

6 files changed

+16
-1
lines changed

6 files changed

+16
-1
lines changed

ggml/src/ggml-sycl/argmax.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ static void ggml_sycl_op_argmax(ggml_backend_sycl_context & ctx, ggml_tensor * d
5252

5353
GGML_ASSERT(dst->src[0]->type == GGML_TYPE_F32);
5454
GGML_ASSERT(dst->type == GGML_TYPE_I32);
55+
GGML_ASSERT(strcmp(dst->buffer->buft->iface.get_name(dst->buffer->buft), GGML_SYCL_NAME "_Split") != 0);
5556

5657
const int64_t ncols = dst->src[0]->ne[0];
5758
const int64_t nrows = ggml_nrows(dst->src[0]);

ggml/src/ggml-sycl/cpy.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ typedef void (*cpy_kernel_t)(const char * cx, char * cdst);
88

99
void ggml_sycl_cpy(ggml_backend_sycl_context & ctx, const ggml_tensor * src0, const ggml_tensor * src1);
1010

11-
#endif // GGML_SYCL_CPY_HPP
11+
#endif // GGML_SYCL_CPY_HPP

ggml/src/ggml-sycl/ggml-sycl.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,6 +1920,8 @@ static void ggml_sycl_op_get_rows(ggml_backend_sycl_context & ctx, ggml_tensor
19201920
GGML_ASSERT(dst->src[0]->nb[0] == ggml_type_size(dst->src[0]->type));
19211921
GGML_ASSERT(dst->src[1]->nb[0] == ggml_type_size(dst->src[1]->type));
19221922
GGML_ASSERT(dst->nb[0] == ggml_type_size(dst->type));
1923+
GGML_ASSERT(!ggml_backend_buffer_is_sycl_split(dst->src[1]->buffer));
1924+
GGML_ASSERT(!ggml_backend_buffer_is_sycl_split(dst->buffer));
19231925

19241926
switch (dst->src[0]->type) {
19251927
case GGML_TYPE_F16:
@@ -2087,6 +2089,7 @@ static void ggml_sycl_op_pool2d(ggml_backend_sycl_context & ctx, ggml_tensor *d
20872089

20882090
GGML_ASSERT(dst->src[0]->type == GGML_TYPE_F32);
20892091
GGML_ASSERT(dst->type == GGML_TYPE_F32);
2092+
GGML_ASSERT(!ggml_backend_buffer_is_sycl_split(dst->buffer));
20902093

20912094
const int32_t * opts = (const int32_t *)dst->op_params;
20922095
enum ggml_op_pool op = static_cast<ggml_op_pool>(opts[0]);
@@ -2125,6 +2128,7 @@ static void ggml_sycl_op_pool2d(ggml_backend_sycl_context & ctx, ggml_tensor *d
21252128
inline void ggml_sycl_op_sum(ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
21262129
GGML_ASSERT(dst->src[0]->type == GGML_TYPE_F32);
21272130
GGML_ASSERT(dst->type == GGML_TYPE_F32);
2131+
GGML_ASSERT(!ggml_backend_buffer_is_sycl_split(dst->buffer));
21282132

21292133
const int64_t ne = ggml_nelements(dst->src[0]);
21302134
dpct::queue_ptr main_stream = ctx.stream();
@@ -2138,6 +2142,7 @@ inline void ggml_sycl_op_sum_rows(ggml_backend_sycl_context & ctx, ggml_tensor *
21382142

21392143
GGML_ASSERT(dst->src[0]->type == GGML_TYPE_F32);
21402144
GGML_ASSERT(dst->type == GGML_TYPE_F32);
2145+
GGML_ASSERT(!ggml_backend_buffer_is_sycl_split(dst->buffer));
21412146

21422147
const int64_t ncols = dst->src[0]->ne[0];
21432148
const int64_t nrows = ggml_nrows(dst->src[0]);
@@ -2152,6 +2157,7 @@ inline void ggml_sycl_op_diag_mask_inf(ggml_backend_sycl_context & ctx, ggml_ten
21522157

21532158
GGML_ASSERT(dst->src[0]->type == GGML_TYPE_F32);
21542159
GGML_ASSERT(dst->type == GGML_TYPE_F32);
2160+
GGML_ASSERT(!ggml_backend_buffer_is_sycl_split(dst->buffer));
21552161

21562162
const int64_t ne00 = dst->src[0]->ne[0];
21572163
const int64_t ne01 = dst->src[0]->ne[1];
@@ -2169,6 +2175,7 @@ inline void ggml_sycl_op_scale(ggml_backend_sycl_context & ctx, ggml_tensor * ds
21692175

21702176
GGML_ASSERT(dst->src[0]->type == GGML_TYPE_F32);
21712177
GGML_ASSERT(dst->type == GGML_TYPE_F32);
2178+
GGML_ASSERT(!ggml_backend_buffer_is_sycl_split(dst->buffer));
21722179

21732180
float scale;
21742181
memcpy(&scale, dst->op_params, sizeof(float));
@@ -2189,6 +2196,7 @@ inline void ggml_sycl_op_clamp(ggml_backend_sycl_context & ctx, ggml_tensor *dst
21892196

21902197
GGML_ASSERT(dst->src[0]->type == GGML_TYPE_F32);
21912198
GGML_ASSERT(dst->type == GGML_TYPE_F32);
2199+
GGML_ASSERT(!ggml_backend_buffer_is_sycl_split(dst->buffer));
21922200

21932201
float min;
21942202
float max;

ggml/src/ggml-sycl/im2col.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ void ggml_sycl_op_im2col(ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
8686

8787
GGML_ASSERT(dst->src[0]->type == GGML_TYPE_F16);
8888
GGML_ASSERT(dst->src[1]->type == GGML_TYPE_F32);
89+
GGML_ASSERT(strcmp(dst->src[1]->buffer->buft->iface.get_name(dst->src[1]->buffer->buft), GGML_SYCL_NAME "_Split") != 0);
8990
GGML_ASSERT(dst->type == GGML_TYPE_F16 || dst->type == GGML_TYPE_F32);
9091

9192
const int32_t s0 = ((const int32_t*)(dst->op_params))[0];

ggml/src/ggml-sycl/norm.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ void ggml_sycl_op_norm(ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
315315

316316
GGML_ASSERT(dst->src[0]->type == GGML_TYPE_F32);
317317
GGML_ASSERT(dst->type == GGML_TYPE_F32);
318+
GGML_ASSERT(strcmp(dst->buffer->buft->iface.get_name(dst->buffer->buft), GGML_SYCL_NAME "_Split") != 0);
318319

319320
const int64_t ne00 = dst->src[0]->ne[0];
320321
const int64_t nrows = ggml_nrows(dst->src[0]);
@@ -333,6 +334,7 @@ void ggml_sycl_op_group_norm(ggml_backend_sycl_context& ctx, ggml_tensor* dst) {
333334

334335
GGML_ASSERT(dst->src[0]->type == GGML_TYPE_F32);
335336
GGML_ASSERT(dst->type == GGML_TYPE_F32);
337+
GGML_ASSERT(strcmp(dst->buffer->buft->iface.get_name(dst->buffer->buft), GGML_SYCL_NAME "_Split") != 0);
336338

337339
int num_groups = dst->op_params[0];
338340

@@ -350,6 +352,7 @@ void ggml_sycl_op_rms_norm(ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
350352

351353
GGML_ASSERT(dst->src[0]->type == GGML_TYPE_F32);
352354
GGML_ASSERT(dst->type == GGML_TYPE_F32);
355+
GGML_ASSERT(strcmp(dst->buffer->buft->iface.get_name(dst->buffer->buft), GGML_SYCL_NAME "_Split") != 0);
353356

354357
const int64_t ne00 = dst->src[0]->ne[0];
355358
const int64_t nrows = ggml_nrows(dst->src[0]);

ggml/src/ggml-sycl/rope.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ void ggml_sycl_op_rope(ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
197197
GGML_ASSERT(dst->src[0]->type == GGML_TYPE_F32 || dst->src[0]->type == GGML_TYPE_F16);
198198
GGML_ASSERT(dst->type == GGML_TYPE_F32 || dst->type == GGML_TYPE_F16);
199199
GGML_ASSERT(dst->src[0]->type == dst->type);
200+
GGML_ASSERT(strcmp(dst->src[1]->buffer->buft->iface.get_name(dst->src[1]->buffer->buft), GGML_SYCL_NAME "_Split") != 0);
201+
GGML_ASSERT(strcmp(dst->buffer->buft->iface.get_name(dst->buffer->buft), GGML_SYCL_NAME "_Split") != 0);
200202

201203
const int64_t ne00 = dst->src[0]->ne[0];
202204
const int64_t ne01 = dst->src[0]->ne[1];

0 commit comments

Comments
 (0)