vllm - 💡(How to fix) Fix [Bug]: Gemma-4 + DFlash unservable on Ampere — non-causal + head_dim=256 has no compatible attention backend

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

pydantic_core._pydantic_core.ValidationError: 1 validation error for SpeculativeConfig Value error, A speculative model was provided, but neither speculative_token_tree nor num_speculative_tokens was provided

Fix Action

Fix / Workaround

Workaround: set \"num_speculative_tokens\": 8 explicitly (matching the draft's speculative_tokens in its speculators_config). Worth forwarding this field automatically.

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

Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 48 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: AuthenticAMD Model name: AMD EPYC 7543 32-Core Processor CPU family: 25 Model: 1 Thread(s) per core: 1 Core(s) per socket: 16 Socket(s): 1 Stepping: 1 BogoMIPS: 5599.65 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 rep_good nopl cpuid extd_apicid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw perfctr_core ssbd ibrs ibpb stibp vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr wbnoinvd arat npt lbrv nrip_save tsc_scale vmcb_clean flushbyasid pausefilter pfthreshold v_vmsave_vmload vgif umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor fsrm Virtualization: AMD-V L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache: 8 MiB (16 instances) L3 cache: 256 MiB (16 instances) NUMA node(s): 1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: 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 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 disabled; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected Vulnerability Srbds: Not affected Vulnerability Tsa: Vulnerable: Clear CPU buffers attempted, no microcode Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected

Code Example

pydantic_core._pydantic_core.ValidationError: 1 validation error for SpeculativeConfig
  Value error, A speculative model was provided, but neither `speculative_token_tree` nor `num_speculative_tokens` was provided

---

docker run --rm --gpus all -p 8000:8000 \\
  -v /models:/models \\
  vllm/vllm-openai:nightly \\
  --model /models/gemma-4-31B-it-int4-AutoRound \\
  --tensor-parallel-size 2 \\
  --disable-custom-all-reduce \\
  --attention-backend FLASHINFER \\
  --speculative-config '{\"method\":\"dflash\",\"model\":\"/models/gemma-4-31B-it-speculator-dflash\",\"num_speculative_tokens\":8}'

---

Collecting environment information...
==============================
        System Info
==============================
OS                           : Ubuntu 22.04.5 LTS (x86_64)
GCC version                  : (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0
Clang version                : Could not collect
CMake version                : Could not collect
Libc version                 : glibc-2.35

==============================
       PyTorch Info
==============================
PyTorch version              : 2.11.0+cu129
Is debug build               : False
CUDA used to build PyTorch   : 12.9
ROCM used to build PyTorch   : N/A
XPU used to build PyTorch    : N/A

==============================
      Python Environment
==============================
Python version               : 3.12.13 (main, Mar  4 2026, 09:23:07) [GCC 11.4.0] (64-bit runtime)
Python platform              : Linux-6.8.0-110-generic-x86_64-with-glibc2.35
    
==============================
       CUDA / GPU Info
==============================
Is CUDA available            : True
CUDA runtime version         : 12.9.86
CUDA_MODULE_LOADING set to   : 
GPU models and configuration : 
GPU 0: NVIDIA GeForce RTX 3090
GPU 1: NVIDIA GeForce RTX 3090

Nvidia driver version        : 595.58.03
cuDNN version                : Could not collect
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:                           48 bits physical, 48 bits virtual
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               AuthenticAMD
Model name:                              AMD EPYC 7543 32-Core Processor
CPU family:                              25
Model:                                   1
Thread(s) per core:                      1
Core(s) per socket:                      16
Socket(s):                               1
Stepping:                                1
BogoMIPS:                                5599.65
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 rep_good nopl cpuid extd_apicid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw perfctr_core ssbd ibrs ibpb stibp vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr wbnoinvd arat npt lbrv nrip_save tsc_scale vmcb_clean flushbyasid pausefilter pfthreshold v_vmsave_vmload vgif umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor fsrm
Virtualization:                          AMD-V
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                8 MiB (16 instances)
L3 cache:                                256 MiB (16 instances)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      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 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 disabled; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Vulnerable: Clear CPU buffers attempted, no microcode
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected

==============================
Versions of relevant libraries
==============================
[pip3] flashinfer-python==0.6.7
[pip3] numpy==2.2.6
RAW_BUFFERClick to expand / collapse

Your current environment

2× NVIDIA RTX 3090 (Ampere sm_86), CUDA 12.9, vLLM v0.19.2rc1.dev21+g893611813 (nightly). Full collect-env at the bottom.

🐛 Describe the bug

Serving RedHatAI/gemma-4-31B-it-speculator.dflash (DFlash draft for Gemma-4) against an AutoRound-Int4 Gemma-4 target on TP=2 fails to initialize on every available Ampere-compatible attention backend. DFlash's block-parallel drafting requires non-causal attention; Gemma-4 has head_dim=256. On sm_86, no backend supports both.

Backend matrix

BackendError / constraint
FLASH_ATTN (FA2)head_size not supported — head_dim=256 is not enabled in the stock FA2 wheel on sm_86
FLASH_ATTN_DIFFKVhead_size not supported
FLASHINFERnon-causal attention not supported
TRITON_ATTNnon-causal attention not supported
FLEX_ATTENTIONnon-causal attention not supported
TREE_ATTNnon-causal attention not supported

Minor pydantic auto-detect gap

Separate smaller issue: speculators auto-detect doesn't populate num_speculative_tokens from the draft's speculators_config.proposal_methods[0].speculative_tokens. Passing just {\"model\": \"…speculator.dflash\"} raises:

pydantic_core._pydantic_core.ValidationError: 1 validation error for SpeculativeConfig
  Value error, A speculative model was provided, but neither `speculative_token_tree` nor `num_speculative_tokens` was provided

Workaround: set \"num_speculative_tokens\": 8 explicitly (matching the draft's speculative_tokens in its speculators_config). Worth forwarding this field automatically.

Reproduction

docker run --rm --gpus all -p 8000:8000 \\
  -v /models:/models \\
  vllm/vllm-openai:nightly \\
  --model /models/gemma-4-31B-it-int4-AutoRound \\
  --tensor-parallel-size 2 \\
  --disable-custom-all-reduce \\
  --attention-backend FLASHINFER \\
  --speculative-config '{\"method\":\"dflash\",\"model\":\"/models/gemma-4-31B-it-speculator-dflash\",\"num_speculative_tokens\":8}'

Swap --attention-backend across FLASH_ATTN / FLASH_ATTN_DIFFKV / FLASHINFER / TRITON_ATTN / FLEX_ATTENTION / TREE_ATTN to reproduce each row above.

What would unblock Ampere

  • Non-causal support added to FLASHINFER / FLEX_ATTENTION / TREE_ATTN, OR
  • head_dim=256 enabled in FA2/FA3 wheels for sm_86

Red Hat's card already notes "validated on H100, other hardware validation pending" (https://huggingface.co/RedHatAI/gemma-4-31B-it-speculator.dflash) — this issue is upstream of their draft, so filing here. Cross-references:

Environment

Collecting environment information...
==============================
        System Info
==============================
OS                           : Ubuntu 22.04.5 LTS (x86_64)
GCC version                  : (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0
Clang version                : Could not collect
CMake version                : Could not collect
Libc version                 : glibc-2.35

==============================
       PyTorch Info
==============================
PyTorch version              : 2.11.0+cu129
Is debug build               : False
CUDA used to build PyTorch   : 12.9
ROCM used to build PyTorch   : N/A
XPU used to build PyTorch    : N/A

==============================
      Python Environment
==============================
Python version               : 3.12.13 (main, Mar  4 2026, 09:23:07) [GCC 11.4.0] (64-bit runtime)
Python platform              : Linux-6.8.0-110-generic-x86_64-with-glibc2.35
    
==============================
       CUDA / GPU Info
==============================
Is CUDA available            : True
CUDA runtime version         : 12.9.86
CUDA_MODULE_LOADING set to   : 
GPU models and configuration : 
GPU 0: NVIDIA GeForce RTX 3090
GPU 1: NVIDIA GeForce RTX 3090

Nvidia driver version        : 595.58.03
cuDNN version                : Could not collect
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:                           48 bits physical, 48 bits virtual
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               AuthenticAMD
Model name:                              AMD EPYC 7543 32-Core Processor
CPU family:                              25
Model:                                   1
Thread(s) per core:                      1
Core(s) per socket:                      16
Socket(s):                               1
Stepping:                                1
BogoMIPS:                                5599.65
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 rep_good nopl cpuid extd_apicid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw perfctr_core ssbd ibrs ibpb stibp vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr wbnoinvd arat npt lbrv nrip_save tsc_scale vmcb_clean flushbyasid pausefilter pfthreshold v_vmsave_vmload vgif umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor fsrm
Virtualization:                          AMD-V
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                8 MiB (16 instances)
L3 cache:                                256 MiB (16 instances)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      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 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 disabled; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Vulnerable: Clear CPU buffers attempted, no microcode
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected

==============================
Versions of relevant libraries
==============================
[pip3] flashinfer-python==0.6.7
[pip3] numpy==2.2.6

(Truncated; full dump available on request.)

AI-assisted (Claude) finding, human review & submit.

extent analysis

TL;DR

To unblock Ampere, either add non-causal support to FLASHINFER, FLEX_ATTENTION, or TREE_ATTN, or enable head_dim=256 in FA2/FA3 wheels for sm_86.

Guidance

  • The issue is caused by the lack of support for non-causal attention in the available attention backends (FLASHINFER, FLEX_ATTENTION, TREE_ATTN) or the lack of support for head_dim=256 in the FA2/FA3 wheels for sm_86.
  • To verify the issue, run the provided reproduction command with different attention backends (FLASH_ATTN, FLASH_ATTN_DIFFKV, FLASHINFER, TRITON_ATTN, FLEX_ATTENTION, TREE_ATTN) to reproduce the error.
  • As a temporary workaround, set num_speculative_tokens explicitly in the speculative config to match the draft's speculative_tokens in its speculators_config.
  • Consider forwarding the num_speculative_tokens field automatically to avoid manual configuration.

Example

No code snippet is provided as the issue is related to the configuration and support of attention backends.

Notes

The issue is specific to the Ampere architecture (sm_86) and the Gemma-4 model. The solution may require updates to the attention backends or the FA2/FA3 wheels.

Recommendation

Apply a workaround by setting num_speculative_tokens explicitly until non-causal support is added to the attention backends or head_dim=256 is enabled in the FA2/FA3 wheels for sm_86.

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