Skip to content

Commit fb5fefd

Browse files
committed
SYCL: set extras only on GGML_TYPE_Q4_0
1 parent 074c4fd commit fb5fefd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,11 @@ ggml_backend_sycl_buffer_init_tensor(ggml_backend_buffer_t buffer,
332332
assert(tensor->view_src->buffer->buft == buffer->buft);
333333
return GGML_STATUS_SUCCESS;
334334
}
335-
336-
ggml_tensor_extra_gpu * extra = new ggml_tensor_extra_gpu{};
337-
tensor->extra = extra;
338-
ctx->tensor_extras.push_back(extra); //used to release it when destroy ctx.
335+
if (tensor->type == GGML_TYPE_Q4_0) {
336+
ggml_tensor_extra_gpu * extra = new ggml_tensor_extra_gpu{};
337+
tensor->extra = extra;
338+
ctx->tensor_extras.push_back(extra); //used to release it when destroy ctx.
339+
}
339340

340341
if (ggml_is_quantized(tensor->type)) {
341342
// initialize padding to 0 to avoid possible NaN values

0 commit comments

Comments
 (0)