Skip to content

[Bug]: Gemma3 multimodal always returns the same response for different image input request #1113

@saltysoup

Description

@saltysoup

Your current environment

The output of commands above
Collecting environment information...
uv is set
==============================
        System Info
==============================
OS                           : Ubuntu 22.04.5 LTS (x86_64)
GCC version                  : (Ubuntu 11.4.0-1ubuntu1~22.04.2) 11.4.0
Clang version                : Could not collect
CMake version                : version 4.1.2
Libc version                 : glibc-2.35

==============================
       PyTorch Info
==============================
PyTorch version              : 2.8.0+cu128
Is debug build               : False
CUDA used to build PyTorch   : 12.8
ROCM used to build PyTorch   : N/A

==============================
      Python Environment
==============================
Python version               : 3.11.13 (main, Jun  4 2025, 08:57:29) [GCC 11.4.0] (64-bit runtime)
Python platform              : Linux-6.8.0-1015-gcp-x86_64-with-glibc2.35

==============================
       CUDA / GPU Info
==============================
Is CUDA available            : False
CUDA runtime version         : No CUDA
CUDA_MODULE_LOADING set to   : N/A
GPU models and configuration : No CUDA
Nvidia driver version        : No CUDA
cuDNN version                : No CUDA
HIP runtime version          : N/A
MIOpen runtime version       : N/A
Is XNNPACK available         : True

==============================
          CPU Info
==============================
Architecture:                         x86_64
CPU op-mode(s):                       32-bit, 64-bit
Address sizes:                        52 bits physical, 57 bits virtual
Byte Order:                           Little Endian
CPU(s):                               180
On-line CPU(s) list:                  0-179
Vendor ID:                            AuthenticAMD
Model name:                           AMD EPYC 9B14
CPU family:                           25
Model:                                17
Thread(s) per core:                   2
Core(s) per socket:                   90
Socket(s):                            1
Stepping:                             1
BogoMIPS:                             5199.99
Flags:                                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext ssbd ibrs ibpb stibp vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves avx512_bf16 clzero xsaveerptr wbnoinvd arat avx512vbmi umip avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid fsrm
Hypervisor vendor:                    KVM
Virtualization type:                  full
L1d cache:                            2.8 MiB (90 instances)
L1i cache:                            2.8 MiB (90 instances)
L2 cache:                             90 MiB (90 instances)
L3 cache:                             384 MiB (12 instances)
NUMA node(s):                         1
NUMA node0 CPU(s):                    0-179
Vulnerability Gather data sampling:   Not affected
Vulnerability Itlb multihit:          Not affected
Vulnerability L1tf:                   Not affected
Vulnerability Mds:                    Not affected
Vulnerability Meltdown:               Not affected
Vulnerability Mmio stale data:        Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed:               Not affected
Vulnerability Spec rstack overflow:   Mitigation; Safe RET
Vulnerability Spec store bypass:      Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:             Mitigation; Retpolines; IBPB conditional; IBRS_FW; STIBP always-on; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Not affected

==============================
Versions of relevant libraries
==============================
[pip3] numpy==2.3.4
[pip3] nvidia-cublas-cu12==12.8.4.1
[pip3] nvidia-cuda-cupti-cu12==12.8.90
[pip3] nvidia-cuda-nvrtc-cu12==12.8.93
[pip3] nvidia-cuda-runtime-cu12==12.8.90
[pip3] nvidia-cudnn-cu12==9.10.2.21
[pip3] nvidia-cufft-cu12==11.3.3.83
[pip3] nvidia-cufile-cu12==1.13.1.3
[pip3] nvidia-curand-cu12==10.3.9.90
[pip3] nvidia-cusolver-cu12==11.7.3.90
[pip3] nvidia-cusparse-cu12==12.5.8.93
[pip3] nvidia-cusparselt-cu12==0.7.1
[pip3] nvidia-nccl-cu12==2.27.3
[pip3] nvidia-nvjitlink-cu12==12.8.93
[pip3] nvidia-nvtx-cu12==12.8.90
[pip3] pyzmq==27.1.0
[pip3] torch==2.8.0
[pip3] torchax==0.0.7
[pip3] torchvision==0.23.0
[pip3] transformers==4.57.1
[pip3] triton==3.4.0
[conda] Could not collect

==============================
         vLLM Info
==============================
ROCM Version                 : Could not collect
vLLM Version                 : 0.11.1
vLLM Build Flags:
  CUDA Archs: Not Set; ROCm: Disabled
GPU Topology:
  Could not collect

==============================
     Environment Variables
==============================
PYTORCH_NVML_BASED_CUDA_CHECK=1
TORCHINDUCTOR_COMPILE_THREADS=1

🐛 Describe the bug

I am testing the multi modal functionality of gemma3-27b model using below. However, it appears to return the same response even if different image url is passed in the client request.

I can confirm that another multimodal (qwen2.5 VL 7b) is working fine. Using the same client requests with different image urls, I get expected and different responses.

Just gemma3 multimodal seem to be behaving strangely.

gemma3 vLLM server command

vllm serve google/gemma-3-27b-it --download-dir /data --seed 42 --max-model-len 16384 --max-num-batched-tokens 16384 --gpu-memory-utilization 0.95 --tensor-parallel-size 4 &

Should return a response about a yellow rubber ducky

(env) ikwak_google_com@t1v-n-bfb3e0ee-w-0:~$ curl -X POST "http://localhost:8000/v1/chat/completions"   -H "Content-Type: application/json"   -d '{
    "model": "google/gemma-3-27b-it",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "What is in this image?"
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSbS7Kx2nyYRKLeNA7AqJyI6NMox_VC9mylKg&s"
            }
          }
        ]
      }
    ],
    "max_tokens": 100
  }'
(APIServer pid=389703) INFO:     127.0.0.1:54440 - "POST /v1/chat/completions HTTP/1.1" 200 OK
{"id":"chatcmpl-789503ed3220405e9c3b8bcd0821ab00","object":"chat.completion","created":1763240620,"model":"google/gemma-3-27b-it","choices":[{"index":0,"message":{"role":"assistant","content":"The image consists entirely of a repeating pattern of a symbol that appears to be a Devanagari letter. Specifically, it's the letter \"दा\" (dā). \n\nIt's a densely packed, abstract image made up solely of this script. Without further context, it's hard to say *why* this image was created. It could be a design element, a representation of a word or phrase, or a visual exploration of the letter itself.","refusal":null,"annotations":null,"audio":null,"function_call":null,"tool_calls":[],"reasoning_content":null},"logprobs":null,"finish_reason":"stop","stop_reason":106,"token_ids":null}],"service_tier":null,"system_fingerprint":null,"usage":{"prompt_tokens":275,"total_tokens":372,"completion_tokens":97,"prompt_tokens_details":null},"prompt_logprobs":null,"prompt_token_ids":null,"kv_transfer_params":null}

Should return a response about a puppy

(env) ikwak_google_com@t1v-n-bfb3e0ee-w-0:~$ curl -X POST "http://localhost:8000/v1/chat/completions"   -H "Content-Type: application/json"   -d '{
    "model": "google/gemma-3-27b-it",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "What is in this image?"
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "https://www.nylabone.com/-/media/project/oneweb/nylabone/images/dog101/9-fluffy-dog-breeds/pomeranian-sitting-in-grass.jpg"
            }
          }
        ]
      }
    ],
    "max_tokens": 100
  }'
(APIServer pid=389703) INFO:     127.0.0.1:37836 - "POST /v1/chat/completions HTTP/1.1" 200 OK
{"id":"chatcmpl-53d7ea4aa7214807bea4a99cde622f54","object":"chat.completion","created":1763240495,"model":"google/gemma-3-27b-it","choices":[{"index":0,"message":{"role":"assistant","content":"The image consists entirely of a repeating pattern of a symbol that appears to be a Devanagari letter. Specifically, it's the letter \"दा\" (dā). \n\nIt's a densely packed, abstract image made up solely of this script. Without further context, it's hard to say *why* this image was created. It could be a design element, a representation of a word or phrase, or a visual exploration of the letter itself.","refusal":null,"annotations":null,"audio":null,"function_call":null,"tool_calls":[],"reasoning_content":null},"logprobs":null,"finish_reason":"stop","stop_reason":106,"token_ids":null}],"service_tier":null,"system_fingerprint":null,"usage":{"prompt_tokens":275,"total_tokens":372,"completion_tokens":97,"prompt_tokens_details":null},"prompt_logprobs":null,"prompt_token_ids":null,"kv_transfer_params":null}(env) ikwak_google_com@t1v-n-bfb3e0ee-w-0:~$ (APIServer pid=389703) INFO 11-15 21:01:44 [loggers.py:181] Engine 000: Avg prompt throughput: 27.5 tokens/s

Before submitting a new issue...

  • Make sure you already searched for relevant issues and checked the documentation page, which can answer lots of frequently asked questions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions