Skip to content

Commit 717531b

Browse files
committed
ggml-blas: add note
Signed-off-by: Aaron Teo <[email protected]>
1 parent aae6d1e commit 717531b

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

ggml/src/ggml-blas/ggml-blas.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -513,13 +513,14 @@ static bool ggml_backend_blas_device_supports_op(ggml_backend_dev_t dev, const g
513513
// TODO: find the optimal value
514514
const int64_t min_batch = 32;
515515

516-
return ggml_is_contiguous(src0) &&
517-
ggml_is_contiguous(src1) &&
518-
src0->view_src == nullptr &&
519-
src1->view_src == nullptr &&
520-
src1->type == GGML_TYPE_F32 &&
521-
(ne0 >= min_batch && ne1 >= min_batch && ne10 >= min_batch) &&
522-
(src0->type == GGML_TYPE_F32 || ggml_get_type_traits(src0->type)->to_float != NULL);
516+
return ggml_is_contiguous(src0)
517+
&& ggml_is_contiguous(src1)
518+
&& src1->type == GGML_TYPE_F32
519+
// NOTE: llama-bench creates views that somehow does not go through init_tensor
520+
// this prevents the uninitialized views from being used in BLAS
521+
&& src0->view_src == nullptr && src1->view_src == nullptr
522+
&& (ne0 >= min_batch && ne1 >= min_batch && ne10 >= min_batch)
523+
&& (src0->type == GGML_TYPE_F32 || ggml_get_type_traits(src0->type)->to_float != NULL);
523524
}
524525

525526
default:

0 commit comments

Comments
 (0)