cast embeds for F32 if necessary (#2319)

This commit is contained in:
Samuel Oliveira Alves 2026-08-15 01:21:56 -03:00 committed by GitHub
parent 43afea46c2
commit 85a784505d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 7 deletions

View File

@ -65,8 +65,9 @@ ggml_cgraph * llm_build_context::build_qwen35moe() {
} }
if (lctx.cparams.mtp) { if (lctx.cparams.mtp) {
cb(inpL, "result_mtp_embd", -1); ggml_tensor * mtp_embd = inpL->type == GGML_TYPE_F32 ? inpL : ggml_cast(ctx0, inpL, GGML_TYPE_F32);
ggml_set_output(inpL); cb(mtp_embd, "result_mtp_embd", -1);
ggml_set_output(mtp_embd);
} }
cur = build_output(lctx, ctx0, inpL, model.output, model.output_norm, cb); cur = build_output(lctx, ctx0, inpL, model.output, model.output_norm, cb);
@ -136,11 +137,9 @@ ggml_cgraph * llm_build_context::build_qwen35() {
} }
if (lctx.cparams.mtp) { if (lctx.cparams.mtp) {
//struct ggml_tensor * embd_copy = ggml_dup(ctx0, inpL); ggml_tensor * mtp_embd = inpL->type == GGML_TYPE_F32 ? inpL : ggml_cast(ctx0, inpL, GGML_TYPE_F32);
//cb(embd_copy, "result_mtp_embd", -1); cb(mtp_embd, "result_mtp_embd", -1);
//ggml_set_output(embd_copy); ggml_set_output(mtp_embd);
cb(inpL, "result_mtp_embd", -1);
ggml_set_output(inpL);
} }
cur = build_output(lctx, ctx0, inpL, model.output, model.output_norm, cb); cur = build_output(lctx, ctx0, inpL, model.output, model.output_norm, cb);