Skip to content

Commit 1eeec1c

Browse files
committed
fix prec
1 parent 6372f54 commit 1eeec1c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

ggml/src/ggml.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3061,9 +3061,6 @@ struct ggml_tensor * ggml_reshape_2d(
30613061
int64_t ne0,
30623062
int64_t ne1) {
30633063
GGML_ASSERT(ggml_is_contiguous(a));
3064-
if (ggml_nelements(a) != ne0*ne1) {
3065-
GGML_LOG_ERROR("ggml_reshape_2d: number of elements mismatch name: %s\n", a->name);
3066-
}
30673064
GGML_ASSERT(ggml_nelements(a) == ne0*ne1);
30683065

30693066
const int64_t ne[2] = { ne0, ne1 };

src/llama.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,9 @@ static struct ggml_tensor * llm_build_kqv(
600600
cur = ggml_flash_attn_ext(ctx, q, k, padded_v, kq_mask, kq_scale, hparams.f_max_alibi_bias,
601601
hparams.attn_soft_cap ? hparams.f_attn_logit_softcapping : 0.0f);
602602

603-
ggml_flash_attn_ext_set_prec(cur, GGML_PREC_F32);
603+
if (v->type == GGML_TYPE_F32) {
604+
ggml_flash_attn_ext_set_prec(cur, GGML_PREC_F32);
605+
}
604606

605607
if (n_embd_head_v < n_embd_head_k) {
606608
cur = ggml_reshape_3d(ctx, cur, n_embd_head_v_out, n_head, n_tokens);

0 commit comments

Comments
 (0)