Skip to content

Commit 741c138

Browse files
committed
ggml : add asserts for type conversion in fattn kernels (llama/9971)
ggml-ci
1 parent 25f9fee commit 741c138

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ggml/src/ggml.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,9 @@ struct ggml_logger_state {
325325
static struct ggml_logger_state g_logger_state = {ggml_log_callback_default, NULL};
326326

327327
static void ggml_log_internal_v(enum ggml_log_level level, const char * format, va_list args) {
328-
if (format == NULL)
328+
if (format == NULL) {
329329
return;
330+
}
330331
va_list args_copy;
331332
va_copy(args_copy, args);
332333
char buffer[128];
@@ -15690,6 +15691,9 @@ static void ggml_compute_forward_flash_attn_ext_f16(
1569015691
ggml_vec_dot_t const kq_vec_dot = type_traits[k->type].vec_dot;
1569115692
ggml_to_float_t const v_to_float = type_traits[v->type].to_float;
1569215693

15694+
GGML_ASSERT(q_to_vec_dot && "fattn: unsupported K-type");
15695+
GGML_ASSERT(v_to_float && "fattn: unsupported V-type");
15696+
1569315697
// loop over n_batch and n_head
1569415698
for (int ir = ir0; ir < ir1; ++ir) {
1569515699
// q indices

0 commit comments

Comments
 (0)