vllm - 💡(How to fix) Fix [Bug]: gpt-oss-20b unquantized model outputting gibberish with non-triton backends (built from main) [1 participants]

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…
GitHub stats
vllm-project/vllm#39545Fetched 2026-04-11 06:12:50
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
renamed ×2labeled ×1

Error Message

#!/usr/bin/env python3 """Minimal vLLM-only repro for gpt-oss generation issues."""

import os import platform import subprocess import sys import time

MODEL = os.environ.get("MODEL", "unsloth/gpt-oss-20b-BF16") MOE_BACKEND = os.environ.get("MOE_BACKEND", "auto") DTYPE = os.environ.get("DTYPE", "auto") TEMPERATURE = float(os.environ.get("TEMPERATURE", "0.8")) TOP_P = float(os.environ.get("TOP_P", "0.95")) MAX_TOKENS = int(os.environ.get("MAX_TOKENS", "64")) MAX_MODEL_LEN = int(os.environ.get("MAX_MODEL_LEN", "1024")) TENSOR_PARALLEL_SIZE = int(os.environ.get("TENSOR_PARALLEL_SIZE", "1")) GPU_MEMORY_UTILIZATION = float(os.environ.get("GPU_MEMORY_UTILIZATION", "0.85")) SEED = int(os.environ.get("SEED", "0")) TRUST_REMOTE_CODE = os.environ.get("TRUST_REMOTE_CODE", "1") != "0" ENFORCE_EAGER = os.environ.get("ENFORCE_EAGER", "0") == "1"

PROMPTS = [ "Hello, my name is", "The president of the United States is", "The capital of France is", "The future of AI is", ]

def print_env() -> None: print(f"Python: {sys.version.split()[0]}") print(f"Platform: {platform.platform()}") print(f"CUDA_VISIBLE_DEVICES: {os.environ.get('CUDA_VISIBLE_DEVICES', '<unset>')}")

try:
    import torch

    print(f"torch: {torch.__version__}")
    print(f"torch.cuda.is_available(): {torch.cuda.is_available()}")
    print(f"torch.cuda.device_count(): {torch.cuda.device_count()}")
    if torch.cuda.is_available():
        for idx in range(torch.cuda.device_count()):
            print(f"cuda:{idx}: {torch.cuda.get_device_name(idx)}")
except Exception as exc:
    print(f"torch import failed: {exc}")

try:
    import vllm

    print(f"vllm: {vllm.__version__}")
except Exception as exc:
    print(f"vllm import failed: {exc}")

smi = subprocess.run(["nvidia-smi", "-L"], capture_output=True, text=True)
if smi.returncode == 0:
    print("nvidia-smi -L:")
    print(smi.stdout.strip())
else:
    stderr = smi.stderr.strip() or smi.stdout.strip() or "not available"
    print(f"nvidia-smi -L failed: {stderr}")

def main() -> int: print_env() print() print(f"Model: {MODEL}") print(f"Prompts: {len(PROMPTS)}") print( f"Sampling: temperature={TEMPERATURE}, top_p={TOP_P}, max_tokens={MAX_TOKENS}" ) print( "Engine:" f" tp={TENSOR_PARALLEL_SIZE}, dtype={DTYPE}, moe_backend={MOE_BACKEND}," f" max_model_len={MAX_MODEL_LEN}," f" gpu_memory_utilization={GPU_MEMORY_UTILIZATION}," f" enforce_eager={ENFORCE_EAGER}" ) print()

try:
    import torch
except Exception as exc:
    print(f"ERROR: torch import failed: {exc}", file=sys.stderr)
    return 1

if not torch.cuda.is_available():
    print("ERROR: No CUDA devices are visible in this shell.", file=sys.stderr)
    return 2

try:
    from vllm import LLM, SamplingParams
except Exception as exc:
    print(f"ERROR: vLLM import failed: {exc}", file=sys.stderr)
    return 1

sampling_params = SamplingParams(
    temperature=TEMPERATURE,
    top_p=TOP_P,
    max_tokens=MAX_TOKENS,
)

print("Initializing LLM...")
start = time.time()
llm = LLM(
    model=MODEL,
    trust_remote_code=TRUST_REMOTE_CODE,
    tensor_parallel_size=TENSOR_PARALLEL_SIZE,
    gpu_memory_utilization=GPU_MEMORY_UTILIZATION,
    max_model_len=MAX_MODEL_LEN,
    dtype=DTYPE,
    moe_backend=MOE_BACKEND,
    seed=SEED,
    enforce_eager=ENFORCE_EAGER,
)
print(f"LLM initialized in {time.time() - start:.1f}s")

print("Generating...")
start = time.time()
outputs = llm.generate(PROMPTS, sampling_params)
print(f"Generation finished in {time.time() - start:.1f}s")
print()

for output in outputs:
    generated = output.outputs[0]
    print(f"Prompt: {output.prompt!r}")
    print(f"Text:   {generated.text!r}")
    print(f"Tokens: {len(generated.token_ids)}")
    print("-" * 80)

return 0

if name == "main": raise SystemExit(main())

Fix Action

Fix / Workaround

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

Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 46 bits physical, 57 bits virtual Byte Order: Little Endian CPU(s): 128 On-line CPU(s) list: 0-127 Vendor ID: GenuineIntel Model name: INTEL(R) XEON(R) GOLD 6548Y+ CPU family: 6 Model: 207 Thread(s) per core: 2 Core(s) per socket: 32 Socket(s): 2 Stepping: 2 CPU(s) scaling MHz: 33% CPU max MHz: 4100.0000 CPU min MHz: 800.0000 BogoMIPS: 5000.00 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect user_shstk avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts hfi vnmi avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr ibt amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities Virtualization: VT-x L1d cache: 3 MiB (64 instances) L1i cache: 2 MiB (64 instances) L2 cache: 128 MiB (64 instances) L3 cache: 120 MiB (2 instances) NUMA node(s): 2 NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126 NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127 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: Not affected 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; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Not affected

Code Example

==============================
        System Info
==============================
OS                           : Ubuntu 24.04.4 LTS (x86_64)
GCC version                  : (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
Clang version                : Could not collect
CMake version                : version 4.2.3
Libc version                 : glibc-2.39

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

==============================
      Python Environment
==============================
Python version               : 3.12.12 | packaged by Anaconda, Inc. | (main, Oct 21 2025, 20:16:04) [GCC 11.2.0] (64-bit runtime)
Python platform              : Linux-6.8.0-51-generic-x86_64-with-glibc2.39

==============================
       CUDA / GPU Info
==============================
Is CUDA available            : False
CUDA runtime version         : 13.1.80
CUDA_MODULE_LOADING set to   : N/A
GPU models and configuration : Could not collect
Nvidia driver version        : Could not collect
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:                        46 bits physical, 57 bits virtual
Byte Order:                           Little Endian
CPU(s):                               128
On-line CPU(s) list:                  0-127
Vendor ID:                            GenuineIntel
Model name:                           INTEL(R) XEON(R) GOLD 6548Y+
CPU family:                           6
Model:                                207
Thread(s) per core:                   2
Core(s) per socket:                   32
Socket(s):                            2
Stepping:                             2
CPU(s) scaling MHz:                   33%
CPU max MHz:                          4100.0000
CPU min MHz:                          800.0000
BogoMIPS:                             5000.00
Flags:                                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect user_shstk avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts hfi vnmi avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr ibt amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities
Virtualization:                       VT-x
L1d cache:                            3 MiB (64 instances)
L1i cache:                            2 MiB (64 instances)
L2 cache:                             128 MiB (64 instances)
L3 cache:                             120 MiB (2 instances)
NUMA node(s):                         2
NUMA node0 CPU(s):                    0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126
NUMA node1 CPU(s):                    1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127
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:   Not affected
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; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Not affected

==============================
Versions of relevant libraries
==============================
[pip3] flash_attn==2.8.3+cu130torch2.10
[pip3] flashinfer-python==0.6.7
[pip3] numpy==2.2.6
[pip3] nvidia-cublas==13.1.0.3
[pip3] nvidia-cuda-cupti==13.0.85
[pip3] nvidia-cuda-nvrtc==13.0.88
[pip3] nvidia-cuda-runtime==13.0.96
[pip3] nvidia-cudnn-cu13==9.19.0.56
[pip3] nvidia-cudnn-frontend==1.18.0
[pip3] nvidia-cufft==12.0.0.61
[pip3] nvidia-cufile==1.15.1.6
[pip3] nvidia-curand==10.4.0.35
[pip3] nvidia-cusolver==12.0.4.66
[pip3] nvidia-cusparse==12.6.3.3
[pip3] nvidia-cusparselt-cu13==0.8.0
[pip3] nvidia-cutlass-dsl==4.4.2
[pip3] nvidia-cutlass-dsl-libs-base==4.4.2
[pip3] nvidia-ml-py==13.590.48
[pip3] nvidia-nccl-cu13==2.28.9
[pip3] nvidia-nvjitlink==13.0.88
[pip3] nvidia-nvshmem-cu13==3.4.5
[pip3] nvidia-nvtx==13.0.85
[pip3] optree==0.19.0
[pip3] pynvml==13.0.1
[pip3] pyzmq==27.1.0
[pip3] torch==2.11.0
[pip3] torch_c_dlpack_ext==0.1.5
[pip3] torch-geometric==2.7.0
[pip3] torchdata==0.11.0
[pip3] torchmetrics==1.9.0
[pip3] torchvision==0.26.0
[pip3] transformers==4.57.6
[pip3] transformers-stream-generator==0.0.5
[pip3] triton==3.6.0+git9844da95
[conda] flash-attn                2.8.3+cu130torch2.10          pypi_0    pypi
[conda] flashinfer-python         0.6.7                    pypi_0    pypi
[conda] numpy                     2.2.6                    pypi_0    pypi
[conda] nvidia-cublas             13.1.0.3                 pypi_0    pypi
[conda] nvidia-cuda-cupti         13.0.85                  pypi_0    pypi
[conda] nvidia-cuda-nvrtc         13.0.88                  pypi_0    pypi
[conda] nvidia-cuda-runtime       13.0.96                  pypi_0    pypi
[conda] nvidia-cudnn-cu13         9.19.0.56                pypi_0    pypi
[conda] nvidia-cudnn-frontend     1.18.0                   pypi_0    pypi
[conda] nvidia-cufft              12.0.0.61                pypi_0    pypi
[conda] nvidia-cufile             1.15.1.6                 pypi_0    pypi
[conda] nvidia-curand             10.4.0.35                pypi_0    pypi
[conda] nvidia-cusolver           12.0.4.66                pypi_0    pypi
[conda] nvidia-cusparse           12.6.3.3                 pypi_0    pypi
[conda] nvidia-cusparselt-cu13    0.8.0                    pypi_0    pypi
[conda] nvidia-cutlass-dsl        4.4.2                    pypi_0    pypi
[conda] nvidia-cutlass-dsl-libs-base 4.4.2                    pypi_0    pypi
[conda] nvidia-ml-py              13.590.48                pypi_0    pypi
[conda] nvidia-nccl-cu13          2.28.9                   pypi_0    pypi
[conda] nvidia-nvjitlink          13.0.88                  pypi_0    pypi
[conda] nvidia-nvshmem-cu13       3.4.5                    pypi_0    pypi
[conda] nvidia-nvtx               13.0.85                  pypi_0    pypi
[conda] optree                    0.19.0                   pypi_0    pypi
[conda] pynvml                    13.0.1                   pypi_0    pypi
[conda] pyzmq                     27.1.0                   pypi_0    pypi
[conda] torch                     2.11.0                   pypi_0    pypi
[conda] torch-c-dlpack-ext        0.1.5                    pypi_0    pypi
[conda] torch-geometric           2.7.0                    pypi_0    pypi
[conda] torchdata                 0.11.0                   pypi_0    pypi
[conda] torchmetrics              1.9.0                    pypi_0    pypi
[conda] torchvision               0.26.0                   pypi_0    pypi
[conda] transformers              4.57.6                   pypi_0    pypi
[conda] transformers-stream-generator 0.0.5                    pypi_0    pypi
[conda] triton                    3.6.0+git9844da95          pypi_0    pypi

==============================
         vLLM Info
==============================
ROCM Version                 : Could not collect
vLLM Version                 : 0.19.1rc1.dev173+gec68d53b2.d20260410 (git sha: ec68d53b2, date: 20260410)
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

---

#!/usr/bin/env python3
"""Minimal vLLM-only repro for gpt-oss generation issues."""

import os
import platform
import subprocess
import sys
import time


MODEL = os.environ.get("MODEL", "unsloth/gpt-oss-20b-BF16")
MOE_BACKEND = os.environ.get("MOE_BACKEND", "auto")
DTYPE = os.environ.get("DTYPE", "auto")
TEMPERATURE = float(os.environ.get("TEMPERATURE", "0.8"))
TOP_P = float(os.environ.get("TOP_P", "0.95"))
MAX_TOKENS = int(os.environ.get("MAX_TOKENS", "64"))
MAX_MODEL_LEN = int(os.environ.get("MAX_MODEL_LEN", "1024"))
TENSOR_PARALLEL_SIZE = int(os.environ.get("TENSOR_PARALLEL_SIZE", "1"))
GPU_MEMORY_UTILIZATION = float(os.environ.get("GPU_MEMORY_UTILIZATION", "0.85"))
SEED = int(os.environ.get("SEED", "0"))
TRUST_REMOTE_CODE = os.environ.get("TRUST_REMOTE_CODE", "1") != "0"
ENFORCE_EAGER = os.environ.get("ENFORCE_EAGER", "0") == "1"

PROMPTS = [
    "Hello, my name is",
    "The president of the United States is",
    "The capital of France is",
    "The future of AI is",
]


def print_env() -> None:
    print(f"Python: {sys.version.split()[0]}")
    print(f"Platform: {platform.platform()}")
    print(f"CUDA_VISIBLE_DEVICES: {os.environ.get('CUDA_VISIBLE_DEVICES', '<unset>')}")

    try:
        import torch

        print(f"torch: {torch.__version__}")
        print(f"torch.cuda.is_available(): {torch.cuda.is_available()}")
        print(f"torch.cuda.device_count(): {torch.cuda.device_count()}")
        if torch.cuda.is_available():
            for idx in range(torch.cuda.device_count()):
                print(f"cuda:{idx}: {torch.cuda.get_device_name(idx)}")
    except Exception as exc:
        print(f"torch import failed: {exc}")

    try:
        import vllm

        print(f"vllm: {vllm.__version__}")
    except Exception as exc:
        print(f"vllm import failed: {exc}")

    smi = subprocess.run(["nvidia-smi", "-L"], capture_output=True, text=True)
    if smi.returncode == 0:
        print("nvidia-smi -L:")
        print(smi.stdout.strip())
    else:
        stderr = smi.stderr.strip() or smi.stdout.strip() or "not available"
        print(f"nvidia-smi -L failed: {stderr}")


def main() -> int:
    print_env()
    print()
    print(f"Model: {MODEL}")
    print(f"Prompts: {len(PROMPTS)}")
    print(
        f"Sampling: temperature={TEMPERATURE}, top_p={TOP_P}, max_tokens={MAX_TOKENS}"
    )
    print(
        "Engine:"
        f" tp={TENSOR_PARALLEL_SIZE}, dtype={DTYPE}, moe_backend={MOE_BACKEND},"
        f" max_model_len={MAX_MODEL_LEN},"
        f" gpu_memory_utilization={GPU_MEMORY_UTILIZATION},"
        f" enforce_eager={ENFORCE_EAGER}"
    )
    print()

    try:
        import torch
    except Exception as exc:
        print(f"ERROR: torch import failed: {exc}", file=sys.stderr)
        return 1

    if not torch.cuda.is_available():
        print("ERROR: No CUDA devices are visible in this shell.", file=sys.stderr)
        return 2

    try:
        from vllm import LLM, SamplingParams
    except Exception as exc:
        print(f"ERROR: vLLM import failed: {exc}", file=sys.stderr)
        return 1

    sampling_params = SamplingParams(
        temperature=TEMPERATURE,
        top_p=TOP_P,
        max_tokens=MAX_TOKENS,
    )

    print("Initializing LLM...")
    start = time.time()
    llm = LLM(
        model=MODEL,
        trust_remote_code=TRUST_REMOTE_CODE,
        tensor_parallel_size=TENSOR_PARALLEL_SIZE,
        gpu_memory_utilization=GPU_MEMORY_UTILIZATION,
        max_model_len=MAX_MODEL_LEN,
        dtype=DTYPE,
        moe_backend=MOE_BACKEND,
        seed=SEED,
        enforce_eager=ENFORCE_EAGER,
    )
    print(f"LLM initialized in {time.time() - start:.1f}s")

    print("Generating...")
    start = time.time()
    outputs = llm.generate(PROMPTS, sampling_params)
    print(f"Generation finished in {time.time() - start:.1f}s")
    print()

    for output in outputs:
        generated = output.outputs[0]
        print(f"Prompt: {output.prompt!r}")
        print(f"Text:   {generated.text!r}")
        print(f"Tokens: {len(generated.token_ids)}")
        print("-" * 80)

    return 0


if __name__ == "__main__":
    raise SystemExit(main())
RAW_BUFFERClick to expand / collapse

Your current environment

<details> <summary>The output of <code>python collect_env.py</code></summary>
==============================
        System Info
==============================
OS                           : Ubuntu 24.04.4 LTS (x86_64)
GCC version                  : (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
Clang version                : Could not collect
CMake version                : version 4.2.3
Libc version                 : glibc-2.39

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

==============================
      Python Environment
==============================
Python version               : 3.12.12 | packaged by Anaconda, Inc. | (main, Oct 21 2025, 20:16:04) [GCC 11.2.0] (64-bit runtime)
Python platform              : Linux-6.8.0-51-generic-x86_64-with-glibc2.39

==============================
       CUDA / GPU Info
==============================
Is CUDA available            : False
CUDA runtime version         : 13.1.80
CUDA_MODULE_LOADING set to   : N/A
GPU models and configuration : Could not collect
Nvidia driver version        : Could not collect
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:                        46 bits physical, 57 bits virtual
Byte Order:                           Little Endian
CPU(s):                               128
On-line CPU(s) list:                  0-127
Vendor ID:                            GenuineIntel
Model name:                           INTEL(R) XEON(R) GOLD 6548Y+
CPU family:                           6
Model:                                207
Thread(s) per core:                   2
Core(s) per socket:                   32
Socket(s):                            2
Stepping:                             2
CPU(s) scaling MHz:                   33%
CPU max MHz:                          4100.0000
CPU min MHz:                          800.0000
BogoMIPS:                             5000.00
Flags:                                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect user_shstk avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts hfi vnmi avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr ibt amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities
Virtualization:                       VT-x
L1d cache:                            3 MiB (64 instances)
L1i cache:                            2 MiB (64 instances)
L2 cache:                             128 MiB (64 instances)
L3 cache:                             120 MiB (2 instances)
NUMA node(s):                         2
NUMA node0 CPU(s):                    0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126
NUMA node1 CPU(s):                    1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127
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:   Not affected
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; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Not affected

==============================
Versions of relevant libraries
==============================
[pip3] flash_attn==2.8.3+cu130torch2.10
[pip3] flashinfer-python==0.6.7
[pip3] numpy==2.2.6
[pip3] nvidia-cublas==13.1.0.3
[pip3] nvidia-cuda-cupti==13.0.85
[pip3] nvidia-cuda-nvrtc==13.0.88
[pip3] nvidia-cuda-runtime==13.0.96
[pip3] nvidia-cudnn-cu13==9.19.0.56
[pip3] nvidia-cudnn-frontend==1.18.0
[pip3] nvidia-cufft==12.0.0.61
[pip3] nvidia-cufile==1.15.1.6
[pip3] nvidia-curand==10.4.0.35
[pip3] nvidia-cusolver==12.0.4.66
[pip3] nvidia-cusparse==12.6.3.3
[pip3] nvidia-cusparselt-cu13==0.8.0
[pip3] nvidia-cutlass-dsl==4.4.2
[pip3] nvidia-cutlass-dsl-libs-base==4.4.2
[pip3] nvidia-ml-py==13.590.48
[pip3] nvidia-nccl-cu13==2.28.9
[pip3] nvidia-nvjitlink==13.0.88
[pip3] nvidia-nvshmem-cu13==3.4.5
[pip3] nvidia-nvtx==13.0.85
[pip3] optree==0.19.0
[pip3] pynvml==13.0.1
[pip3] pyzmq==27.1.0
[pip3] torch==2.11.0
[pip3] torch_c_dlpack_ext==0.1.5
[pip3] torch-geometric==2.7.0
[pip3] torchdata==0.11.0
[pip3] torchmetrics==1.9.0
[pip3] torchvision==0.26.0
[pip3] transformers==4.57.6
[pip3] transformers-stream-generator==0.0.5
[pip3] triton==3.6.0+git9844da95
[conda] flash-attn                2.8.3+cu130torch2.10          pypi_0    pypi
[conda] flashinfer-python         0.6.7                    pypi_0    pypi
[conda] numpy                     2.2.6                    pypi_0    pypi
[conda] nvidia-cublas             13.1.0.3                 pypi_0    pypi
[conda] nvidia-cuda-cupti         13.0.85                  pypi_0    pypi
[conda] nvidia-cuda-nvrtc         13.0.88                  pypi_0    pypi
[conda] nvidia-cuda-runtime       13.0.96                  pypi_0    pypi
[conda] nvidia-cudnn-cu13         9.19.0.56                pypi_0    pypi
[conda] nvidia-cudnn-frontend     1.18.0                   pypi_0    pypi
[conda] nvidia-cufft              12.0.0.61                pypi_0    pypi
[conda] nvidia-cufile             1.15.1.6                 pypi_0    pypi
[conda] nvidia-curand             10.4.0.35                pypi_0    pypi
[conda] nvidia-cusolver           12.0.4.66                pypi_0    pypi
[conda] nvidia-cusparse           12.6.3.3                 pypi_0    pypi
[conda] nvidia-cusparselt-cu13    0.8.0                    pypi_0    pypi
[conda] nvidia-cutlass-dsl        4.4.2                    pypi_0    pypi
[conda] nvidia-cutlass-dsl-libs-base 4.4.2                    pypi_0    pypi
[conda] nvidia-ml-py              13.590.48                pypi_0    pypi
[conda] nvidia-nccl-cu13          2.28.9                   pypi_0    pypi
[conda] nvidia-nvjitlink          13.0.88                  pypi_0    pypi
[conda] nvidia-nvshmem-cu13       3.4.5                    pypi_0    pypi
[conda] nvidia-nvtx               13.0.85                  pypi_0    pypi
[conda] optree                    0.19.0                   pypi_0    pypi
[conda] pynvml                    13.0.1                   pypi_0    pypi
[conda] pyzmq                     27.1.0                   pypi_0    pypi
[conda] torch                     2.11.0                   pypi_0    pypi
[conda] torch-c-dlpack-ext        0.1.5                    pypi_0    pypi
[conda] torch-geometric           2.7.0                    pypi_0    pypi
[conda] torchdata                 0.11.0                   pypi_0    pypi
[conda] torchmetrics              1.9.0                    pypi_0    pypi
[conda] torchvision               0.26.0                   pypi_0    pypi
[conda] transformers              4.57.6                   pypi_0    pypi
[conda] transformers-stream-generator 0.0.5                    pypi_0    pypi
[conda] triton                    3.6.0+git9844da95          pypi_0    pypi

==============================
         vLLM Info
==============================
ROCM Version                 : Could not collect
vLLM Version                 : 0.19.1rc1.dev173+gec68d53b2.d20260410 (git sha: ec68d53b2, date: 20260410)
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
</details>

🐛 Describe the bug

Output is gibberish when running unquantized gpt-oss-20b with non-triton backends (FlashInfer CUTLASS) on latest vLLM built from main. These backends were not previously available. Forcing the triton backend, the previous default behavior, doesn't cause this issue.

#!/usr/bin/env python3
"""Minimal vLLM-only repro for gpt-oss generation issues."""

import os
import platform
import subprocess
import sys
import time


MODEL = os.environ.get("MODEL", "unsloth/gpt-oss-20b-BF16")
MOE_BACKEND = os.environ.get("MOE_BACKEND", "auto")
DTYPE = os.environ.get("DTYPE", "auto")
TEMPERATURE = float(os.environ.get("TEMPERATURE", "0.8"))
TOP_P = float(os.environ.get("TOP_P", "0.95"))
MAX_TOKENS = int(os.environ.get("MAX_TOKENS", "64"))
MAX_MODEL_LEN = int(os.environ.get("MAX_MODEL_LEN", "1024"))
TENSOR_PARALLEL_SIZE = int(os.environ.get("TENSOR_PARALLEL_SIZE", "1"))
GPU_MEMORY_UTILIZATION = float(os.environ.get("GPU_MEMORY_UTILIZATION", "0.85"))
SEED = int(os.environ.get("SEED", "0"))
TRUST_REMOTE_CODE = os.environ.get("TRUST_REMOTE_CODE", "1") != "0"
ENFORCE_EAGER = os.environ.get("ENFORCE_EAGER", "0") == "1"

PROMPTS = [
    "Hello, my name is",
    "The president of the United States is",
    "The capital of France is",
    "The future of AI is",
]


def print_env() -> None:
    print(f"Python: {sys.version.split()[0]}")
    print(f"Platform: {platform.platform()}")
    print(f"CUDA_VISIBLE_DEVICES: {os.environ.get('CUDA_VISIBLE_DEVICES', '<unset>')}")

    try:
        import torch

        print(f"torch: {torch.__version__}")
        print(f"torch.cuda.is_available(): {torch.cuda.is_available()}")
        print(f"torch.cuda.device_count(): {torch.cuda.device_count()}")
        if torch.cuda.is_available():
            for idx in range(torch.cuda.device_count()):
                print(f"cuda:{idx}: {torch.cuda.get_device_name(idx)}")
    except Exception as exc:
        print(f"torch import failed: {exc}")

    try:
        import vllm

        print(f"vllm: {vllm.__version__}")
    except Exception as exc:
        print(f"vllm import failed: {exc}")

    smi = subprocess.run(["nvidia-smi", "-L"], capture_output=True, text=True)
    if smi.returncode == 0:
        print("nvidia-smi -L:")
        print(smi.stdout.strip())
    else:
        stderr = smi.stderr.strip() or smi.stdout.strip() or "not available"
        print(f"nvidia-smi -L failed: {stderr}")


def main() -> int:
    print_env()
    print()
    print(f"Model: {MODEL}")
    print(f"Prompts: {len(PROMPTS)}")
    print(
        f"Sampling: temperature={TEMPERATURE}, top_p={TOP_P}, max_tokens={MAX_TOKENS}"
    )
    print(
        "Engine:"
        f" tp={TENSOR_PARALLEL_SIZE}, dtype={DTYPE}, moe_backend={MOE_BACKEND},"
        f" max_model_len={MAX_MODEL_LEN},"
        f" gpu_memory_utilization={GPU_MEMORY_UTILIZATION},"
        f" enforce_eager={ENFORCE_EAGER}"
    )
    print()

    try:
        import torch
    except Exception as exc:
        print(f"ERROR: torch import failed: {exc}", file=sys.stderr)
        return 1

    if not torch.cuda.is_available():
        print("ERROR: No CUDA devices are visible in this shell.", file=sys.stderr)
        return 2

    try:
        from vllm import LLM, SamplingParams
    except Exception as exc:
        print(f"ERROR: vLLM import failed: {exc}", file=sys.stderr)
        return 1

    sampling_params = SamplingParams(
        temperature=TEMPERATURE,
        top_p=TOP_P,
        max_tokens=MAX_TOKENS,
    )

    print("Initializing LLM...")
    start = time.time()
    llm = LLM(
        model=MODEL,
        trust_remote_code=TRUST_REMOTE_CODE,
        tensor_parallel_size=TENSOR_PARALLEL_SIZE,
        gpu_memory_utilization=GPU_MEMORY_UTILIZATION,
        max_model_len=MAX_MODEL_LEN,
        dtype=DTYPE,
        moe_backend=MOE_BACKEND,
        seed=SEED,
        enforce_eager=ENFORCE_EAGER,
    )
    print(f"LLM initialized in {time.time() - start:.1f}s")

    print("Generating...")
    start = time.time()
    outputs = llm.generate(PROMPTS, sampling_params)
    print(f"Generation finished in {time.time() - start:.1f}s")
    print()

    for output in outputs:
        generated = output.outputs[0]
        print(f"Prompt: {output.prompt!r}")
        print(f"Text:   {generated.text!r}")
        print(f"Tokens: {len(generated.token_ids)}")
        print("-" * 80)

    return 0


if __name__ == "__main__":
    raise SystemExit(main())

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.

extent analysis

TL;DR

The issue can be resolved by forcing the triton backend, which was the previous default behavior, as the new backends (FlashInfer CUTLASS) are causing the gibberish output.

Guidance

  • The problem seems to be related to the new backends (FlashInfer CUTLASS) used in the latest vLLM build, as forcing the triton backend resolves the issue.
  • To mitigate the problem, set the MOE_BACKEND environment variable to triton before running the script.
  • Verify that the triton backend is correctly set by checking the environment variables printed in the output of the script.
  • If the issue persists, try checking the compatibility of the new backends with the latest vLLM build and the specific model being used.

Example

To force the triton backend, you can set the MOE_BACKEND environment variable before running the script:

MOE_BACKEND = "triton"

Alternatively, you can modify the script to set the moe_backend parameter to triton when initializing the LLM object:

llm = LLM(
    model=MODEL,
    trust_remote_code=TRUST_REMOTE_CODE,
    tensor_parallel_size=TENSOR_PARALLEL_SIZE,
    gpu_memory_utilization=GPU_MEMORY_UTILIZATION,
    max_model_len=MAX_MODEL_LEN,
    dtype=DTYPE,
    moe_backend="triton",  # Set moe_backend to triton
    seed=SEED,
    enforce_eager=ENFORCE_EAGER,
)

Notes

The issue seems to be specific to the new backends (FlashInfer CUTLASS) used in the latest vLLM build, and forcing the triton backend resolves the problem. However, it is recommended to investigate the compatibility of the new backends with the latest vLLM build and the specific model being used to ensure optimal performance.

Recommendation

Apply the workaround by setting the MOE_BACKEND environment variable to triton or modifying the script to set the moe_backend parameter to triton when initializing the LLM object, as this resolves the issue and allows the script to run correctly.

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