Skip to content

[Bug]: Gemma 4 E4B extremely slow on v0.19.0 forced TRITON_ATTN fallback yields ~9 tok/s on RTX 4090 (vs ~100+ tok/s for comparable Llama 3B) #38887

Description

@CunXin1

Your current environment

PyTorch version : 2.10.0+cu129
Python version : 3.12.13 (64-bit runtime)
CUDA runtime version : 12.9.86
vLLM Version : 0.19.0

[pip3] torch==2.10.0+cu129
[pip3] transformers==5.5.0
[pip3] triton==3.6.0
[pip3] flashinfer-python==0.6.6

🐛 Describe the bug

Gemma 4 E4B (google/gemma-4-e4b-it, 4.5B effective parameters) generates at only ~9 tokens/s on an RTX 4090 with vLLM v0.19.0. For comparison, a similarly-sized Llama 3.2 3B model on the same hardware with the same vLLM version generates at 100+ tokens/s.

The root cause is that Gemma 4's heterogeneous attention head dimensions force vLLM to disable FlashAttention and fall back to a much slower Triton attention kernel. Additionally, custom_ops is set to ['none'], meaning no vLLM-native CUDA kernels are used.

From vLLM server logs during inference:

INFO [config.py:104] Gemma4 model has heterogeneous head dimensions (head_dim=256, global_head_dim=512).
  Forcing TRITON_ATTN backend to prevent mixed-backend numerical divergence.

INFO [cuda.py:274] Using AttentionBackendEnum.TRITON_ATTN backend.

INFO [loggers.py:259] Engine 000: Avg prompt throughput: 1.6 tokens/s,
  Avg generation throughput: 9.2 tokens/s, Running: 1 reqs, Waiting: 0 reqs,
  GPU KV cache usage: 1.9%, Prefix cache hit rate: 94.9%

Expected behavior

A 4.5B parameter model on an RTX 4090 (24GB VRAM, BF16) should generate in the range of 50-100+ tokens/s, comparable to other models of similar size (e.g., Llama 3.2 3B at ~100-200 tok/s on the same hardware).

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of 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