Skip to content

Eval bug: gemma-4-12B-it-GGUF crashes with Floating point exception #163

@guarismo

Description

@guarismo

Name and Version

$ llama-server --version
version: 1 (2cbfdc6)
built with GNU 15.2.0 for Linux x86_64

Operating systems

Linux

GGML backends

CUDA

Hardware

1x RTX 3060 12GB

Models

the new Gemma4 12B

Problem description & steps to reproduce

The new Gemma 4 12B model does not use an encoder and therefore n_head and d_head are 0. This causes a floating point exception when kq_scale and d_head are calculated with a 0 denominator.

Please see main repo: ggml-org#24085

First Bad Commit

No response

Relevant log output

Logs
0x00007ffff57748ac in clip_graph::clip_graph (this=0x55555575e580, ctx=0x5555556a4a30, img=...) at /nas/achin/devel/llama.cpp/tools/mtmd/clip.cpp:250
250             d_head(n_embd / n_head),
(gdb) bt
#0  0x00007ffff57748ac in clip_graph::clip_graph (this=0x55555575e580, ctx=0x5555556a4a30, img=...) at /nas/achin/devel/llama.cpp/tools/mtmd/clip.cpp:250
#1  0x00007ffff577fda3 in clip_graph_gemma4uv::clip_graph_gemma4uv (this=0x55555575e580, ctx=0x5555556a4a30, img=...) at /nas/achin/devel/llama.cpp/tools/mtmd/models/models.h:22
#2  0x00007ffff579c730 in std::make_unique<clip_graph_gemma4uv, clip_ctx*&, clip_image_f32 const&> () at /usr/include/c++/14/bits/unique_ptr.h:1077
#3  0x00007ffff5776cd2 in clip_image_build_graph (ctx=0x5555556a4a30, imgs=...) at /nas/achin/devel/llama.cpp/tools/mtmd/clip.cpp:871
#4  0x00007ffff579a77f in clip_model_loader::reserve_compute_meta (ctx_clip=..., batch=...) at /nas/achin/devel/llama.cpp/tools/mtmd/clip.cpp:2816
#5  0x00007ffff579a06c in clip_model_loader::warmup (ctx_clip=..., batch=...) at /nas/achin/devel/llama.cpp/tools/mtmd/clip.cpp:2751
#6  0x00007ffff5799ddb in clip_model_loader::warmup (ctx_clip=...) at /nas/achin/devel/llama.cpp/tools/mtmd/clip.cpp:2742
#7  0x00007ffff5777638 in clip_init (
    fname=0x5555555b6ca0 "/home/achin/.cache/huggingface/hub/models--ggml-org--gemma-4-12B-it-GGUF/snapshots/0f3915622134b2b6279d02f482cb12adc3d9ca3d/mmproj-gemma-4-12B-it-Q8_0.gguf",
    ctx_params=...) at /nas/achin/devel/llama.cpp/tools/mtmd/clip.cpp:2980
#8  0x00007ffff56905b3 in mtmd_context::mtmd_context (this=0x5555556bbec0,
    mmproj_fname=0x5555555b6ca0 "/home/achin/.cache/huggingface/hub/models--ggml-org--gemma-4-12B-it-GGUF/snapshots/0f3915622134b2b6279d02f482cb12adc3d9ca3d/mmproj-gemma-4-12B-it-Q8_0.gguf", text_model=0x0, ctx_params=..., no_alloc=false) at /nas/achin/devel/llama.cpp/tools/mtmd/mtmd.cpp:228
#9  0x00007ffff568dd98 in mtmd_get_memory_usage (
    mmproj_fname=0x5555555b6ca0 "/home/achin/.cache/huggingface/hub/models--ggml-org--gemma-4-12B-it-GGUF/snapshots/0f3915622134b2b6279d02f482cb12adc3d9ca3d/mmproj-gemma-4-12B-it-Q8_0.gguf", ctx_params=...) at /nas/achin/devel/llama.cpp/tools/mtmd/mtmd.cpp:1604
#10 0x00007ffff7444564 in server_context_impl::load_model (this=0x5555556cf9f0, params=...) at /nas/achin/devel/llama.cpp/tools/server/server-context.cpp:789
#11 0x00007ffff741c9c2 in server_context::load_model (this=0x7fffffffb168, params=...) at /nas/achin/devel/llama.cpp/tools/server/server-context.cpp:3542
#12 0x00007ffff734acb5 in llama_server (argc=3, argv=0x7fffffffde08) at /nas/achin/devel/llama.cpp/tools/server/server.cpp:296
#13 0x0000555555556239 in main (argc=3, argv=0x7fffffffde08) at /nas/achin/devel/llama.cpp/tools/server/main.cpp:4

(gdb) print(n_embd)
$1 = 3840
(gdb) print(n_head)
$2 = 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions