vllm - 💡(How to fix) Fix [Bug]: Gemma4 26B-A4B fails because GELU_TANH is unsupported in CPU fused MoE path

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

AssertionError: MoEActivation.GELU_TANH is not supported.

Root Cause

google/gemma-4-26B-A4B-it fails on the vLLM CPU backend because the CPU fused MoE path does not support MoEActivation.GELU_TANH.

Fix Action

Fix / Workaround

============================== CPU Info

Architecture: aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 96 On-line CPU(s) list: 0-95 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per socket: 96 Socket(s): 1 Stepping: r0p1 BogoMIPS: 2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 6 MiB (96 instances) L1i cache: 6 MiB (96 instances) L2 cache: 192 MiB (96 instances) L3 cache: 36 MiB (1 instance) NUMA node(s): 1 NUMA node0 CPU(s): 0-95 Vulnerability Gather data sampling: Not affected Vulnerability Ghostwrite: Not affected Vulnerability Indirect target selection: 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 Old microcode: Not affected Vulnerability Reg file data sampling: Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1: Mitigation; __user pointer sanitization Vulnerability Spectre v2: Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected

Code Example

Collecting environment information...
==============================
        System Info
==============================
OS                           : Ubuntu 24.04.3 LTS (aarch64)
GCC version                  : (Ubuntu 12.4.0-2ubuntu1~24.04.1) 12.4.0
Clang version                : 18.1.3 (1ubuntu1)
CMake version                : version 4.3.2
Libc version                 : glibc-2.39

==============================
       PyTorch Info
==============================
PyTorch version              : 2.11.0+cpu
Is debug build               : False
CUDA used to build PyTorch   : None
ROCM used to build PyTorch   : N/A

==============================
      Python Environment
==============================
Python version               : 3.12.13 (main, May 10 2026, 19:27:23) [Clang 22.1.3 ] (64-bit runtime)
Python platform              : Linux-6.17.0-1013-aws-aarch64-with-glibc2.39

==============================
       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:                            aarch64
CPU op-mode(s):                    64-bit
Byte Order:                              Little Endian
CPU(s):                                    96
On-line CPU(s) list:                0-95
Vendor ID:                               ARM
Model name:                           Neoverse-V2
Model:                                     1
Thread(s) per core:                1
Core(s) per socket:                96
Socket(s):                               1
Stepping:                                r0p1
BogoMIPS:                             2000.00
Flags:                                     fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               6 MiB (96 instances)
L1i cache:                               6 MiB (96 instances)
L2 cache:                                192 MiB (96 instances)
L3 cache:                                36 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-95
Vulnerability Gather data sampling:      Not affected
Vulnerability Ghostwrite:                Not affected
Vulnerability Indirect target selection: 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 Old microcode:             Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected

==============================
Versions of relevant libraries
==============================
[pip3] numpy==2.3.5
[pip3] pyzmq==27.1.0
[pip3] torch==2.11.0+cpu
[pip3] torchaudio==2.11.0+cpu
[pip3] torchvision==0.26.0+cpu
[pip3] transformers==5.8.1
[conda] Could not collect

==============================
         vLLM Info
==============================
ROCM Version                 : Could not collect
vLLM Version                 : 0.21.1rc1.dev70+g47829b115.d20260521 (git sha: 47829b115, date: 20260521)
vLLM-Omni Version            : N/A (vllm_omni not installed)
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
TORCHINDUCTOR_CACHE_DIR=/tmp/torchinductor_gausah01

---

AssertionError: MoEActivation.GELU_TANH is not supported.

---

VLLM_TARGET_DEVICE=cpu \
vllm bench throughput \
  --model google/gemma-4-26B-A4B-it \
  --dataset-name sonnet \
  --dataset-path vllm_source/benchmarks/sonnet.txt \
  --num-prompts 1 \
  --max-model-len 2048 \
  --override-generation-config '{"temperature": "0.0", "top_p": "1.0"}'

---

vLLM CPU engine should initialize and run the benchmark for google/gemma-4-26B-A4B-it.

---

Engine initialization fails because GELU_TANH is not supported in the CPU fused MoE activation mapping.

---

torch._dynamo.exc.Unsupported: Observed exception

Developer debug context:
raised exception AssertionError([ConstantVariable(str: 'MoEActivation.GELU_TANH is not supported.')])

from user code:
  File ".../vllm/model_executor/models/gemma4.py", line 1330, in forward
    hidden_states, residual = layer(

  File ".../vllm/model_executor/models/gemma4.py", line 732, in forward
    hidden_states_2 = self.moe(hidden_states_2, router_logits)

  File ".../vllm/model_executor/models/gemma4.py", line 365, in forward
    return self.experts(x, router_logits)

  File ".../vllm/model_executor/layers/fused_moe/layer.py", line 1311, in forward
    return self.runner.forward(

  File ".../vllm/model_executor/layers/fused_moe/unquantized_fused_moe_method.py", line 354, in apply_monolithic
    return self.cpu_fused_moe(

  File ".../vllm/model_executor/layers/fused_moe/cpu_fused_moe.py", line 261, in __call__
    assert activation in _CPU_MOE_ACT_FN, f"{activation} is not supported."

---

vllm/model_executor/layers/fused_moe/activation.py

---

vllm/model_executor/layers/fused_moe/cpu_fused_moe.py

---

_CPU_MOE_ACT_FN = {
    MoEActivation.SILU: ...,
    MoEActivation.SWIGLUOAI: ...,
    MoEActivation.GELU: _gelu_and_mul,
}
RAW_BUFFERClick to expand / collapse

Your current environment

<details> <summary>The output of <code>python collect_env.py</code></summary>
Collecting environment information...
==============================
        System Info
==============================
OS                           : Ubuntu 24.04.3 LTS (aarch64)
GCC version                  : (Ubuntu 12.4.0-2ubuntu1~24.04.1) 12.4.0
Clang version                : 18.1.3 (1ubuntu1)
CMake version                : version 4.3.2
Libc version                 : glibc-2.39

==============================
       PyTorch Info
==============================
PyTorch version              : 2.11.0+cpu
Is debug build               : False
CUDA used to build PyTorch   : None
ROCM used to build PyTorch   : N/A

==============================
      Python Environment
==============================
Python version               : 3.12.13 (main, May 10 2026, 19:27:23) [Clang 22.1.3 ] (64-bit runtime)
Python platform              : Linux-6.17.0-1013-aws-aarch64-with-glibc2.39

==============================
       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:                            aarch64
CPU op-mode(s):                    64-bit
Byte Order:                              Little Endian
CPU(s):                                    96
On-line CPU(s) list:                0-95
Vendor ID:                               ARM
Model name:                           Neoverse-V2
Model:                                     1
Thread(s) per core:                1
Core(s) per socket:                96
Socket(s):                               1
Stepping:                                r0p1
BogoMIPS:                             2000.00
Flags:                                     fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               6 MiB (96 instances)
L1i cache:                               6 MiB (96 instances)
L2 cache:                                192 MiB (96 instances)
L3 cache:                                36 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-95
Vulnerability Gather data sampling:      Not affected
Vulnerability Ghostwrite:                Not affected
Vulnerability Indirect target selection: 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 Old microcode:             Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected

==============================
Versions of relevant libraries
==============================
[pip3] numpy==2.3.5
[pip3] pyzmq==27.1.0
[pip3] torch==2.11.0+cpu
[pip3] torchaudio==2.11.0+cpu
[pip3] torchvision==0.26.0+cpu
[pip3] transformers==5.8.1
[conda] Could not collect

==============================
         vLLM Info
==============================
ROCM Version                 : Could not collect
vLLM Version                 : 0.21.1rc1.dev70+g47829b115.d20260521 (git sha: 47829b115, date: 20260521)
vLLM-Omni Version            : N/A (vllm_omni not installed)
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
TORCHINDUCTOR_CACHE_DIR=/tmp/torchinductor_gausah01
</details>

🐛 Describe the bug

google/gemma-4-26B-A4B-it fails on the vLLM CPU backend because the CPU fused MoE path does not support MoEActivation.GELU_TANH.

The model loads successfully, but engine initialization fails during warmup in the CPU fused MoE path with:

AssertionError: MoEActivation.GELU_TANH is not supported.

Minimal reproduction:

VLLM_TARGET_DEVICE=cpu \
vllm bench throughput \
  --model google/gemma-4-26B-A4B-it \
  --dataset-name sonnet \
  --dataset-path vllm_source/benchmarks/sonnet.txt \
  --num-prompts 1 \
  --max-model-len 2048 \
  --override-generation-config '{"temperature": "0.0", "top_p": "1.0"}'

Expected behavior:

vLLM CPU engine should initialize and run the benchmark for google/gemma-4-26B-A4B-it.

Actual behavior:

Engine initialization fails because GELU_TANH is not supported in the CPU fused MoE activation mapping.

Relevant traceback:

Relevant traceback:

torch._dynamo.exc.Unsupported: Observed exception

Developer debug context:
raised exception AssertionError([ConstantVariable(str: 'MoEActivation.GELU_TANH is not supported.')])

from user code:
  File ".../vllm/model_executor/models/gemma4.py", line 1330, in forward
    hidden_states, residual = layer(

  File ".../vllm/model_executor/models/gemma4.py", line 732, in forward
    hidden_states_2 = self.moe(hidden_states_2, router_logits)

  File ".../vllm/model_executor/models/gemma4.py", line 365, in forward
    return self.experts(x, router_logits)

  File ".../vllm/model_executor/layers/fused_moe/layer.py", line 1311, in forward
    return self.runner.forward(

  File ".../vllm/model_executor/layers/fused_moe/unquantized_fused_moe_method.py", line 354, in apply_monolithic
    return self.cpu_fused_moe(

  File ".../vllm/model_executor/layers/fused_moe/cpu_fused_moe.py", line 261, in __call__
    assert activation in _CPU_MOE_ACT_FN, f"{activation} is not supported."

Initial debugging:

MoEActivation.GELU_TANH is already defined in:

vllm/model_executor/layers/fused_moe/activation.py

and appears to be supported in other MoE paths. However, the CPU fused MoE activation mapping in:

vllm/model_executor/layers/fused_moe/cpu_fused_moe.py

currently only includes:

_CPU_MOE_ACT_FN = {
    MoEActivation.SILU: ...,
    MoEActivation.SWIGLUOAI: ...,
    MoEActivation.GELU: _gelu_and_mul,
}

MoEActivation.GELU_TANH is missing from this mapping, so Gemma4 26B-A4B seems to be failing on CPU.

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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING