vllm - 💡(How to fix) Fix [Performance]: FP8 (Fp8OnlineLinearMethod) significantly slower than BF16 for ReplicatedLinear [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#38720Fetched 2026-04-08 02:23:12
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
closed ×1cross-referenced ×1labeled ×1

I am observing a severe performance regression when using FP8 quantization compared to BF16.

In my use case (OmniGen2 diffusion inference), enabling FP8 causes a dramatic slowdown:

  • BF16: ~30 denoising steps complete in ~30 seconds
  • FP8: ~30 seconds per step

This is my setup: Hardware / stack: NVIDIA RTX 4090, PyTorch 2.10+cu128, vLLM 0.18.0 with CutlassFP8ScaledMMLinearKernel.

I have a reproduce script below. If you run it, you can see FP8 is consistently much slower than BF16.

<details><summary> reproduce script </summary>
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
"""BF16 vs FP8 microbenchmark with *random* weights — no OmniGen / HF checkpoint.

Uses vLLM ``ReplicatedLinear`` + ``Fp8OnlineLinearMethod`` (same family as many DiT
linears). For each (seq_len, in_features, out_features) tuple, draws one random BF16
weight matrix (fixed seed per row for reproducibility), builds:

- Unquantized ``ReplicatedLinear`` (BF16 GEMM)
- FP8 online layer loaded via ``weight.weight_loader`` → ``process_weights_after_loading``

Then times ``y = lin(x)`` with ``x.shape == (1, seq_len, in_features)`` in BF16.

This isolates **problem shape / kernel choice** from **OmniGen-specific weights**.

Example:

  python vllm_fp8_random_weights_shape_sweep.py \\
    --shapes "1104,2520,4200;512,2520,4200;256,4096,8192" --warmup 10 --iters 50

Reference quick smoke run (illustrative; varies by GPU/driver/torch/vLLM):

  Command:

    python vllm_fp8_random_weights_shape_sweep.py \\
      --shapes "128,256,512;1104,2520,4200" --warmup 3 --iters 10 --master-port 29640

  Hardware / stack: NVIDIA RTX 4090, PyTorch 2.10+cu128, vLLM with CutlassFP8ScaledMMLinearKernel.

  S     K     N     BF16 ms   FP8 ms    FP8/BF16
  ----  ----  ----  --------  --------  --------
  128   256   512   0.0391    0.2363    6.04x
  1104  2520  4200  0.1804    11.0370   61.17x
"""

from __future__ import annotations

import argparse
import os
import time

import torch
from vllm.config import CompilationConfig, VllmConfig, set_current_vllm_config
from vllm.model_executor.layers.linear import ReplicatedLinear
from vllm.utils.torch_utils import set_default_torch_dtype

from vllm_omni.diffusion.data import OmniDiffusionConfig
from vllm_omni.diffusion.distributed.parallel_state import (
    destroy_distributed_env,
    init_distributed_environment,
    initialize_model_parallel,
)
from vllm_omni.diffusion.forward_context import set_forward_context
from vllm_omni.platforms import current_omni_platform
from vllm_omni.quantization import build_quant_config


def _bench_ms(run_once, *, warmup: int, iters: int) -> float:
    for _ in range(warmup):
        run_once()
        torch.cuda.synchronize()
    torch.cuda.synchronize()
    t0 = time.perf_counter()
    for _ in range(iters):
        run_once()
    torch.cuda.synchronize()
    return (time.perf_counter() - t0) / iters * 1000.0


def _parse_shapes(spec: str) -> list[tuple[int, int, int]]:
    rows: list[tuple[int, int, int]] = []
    for part in spec.replace(",", " ").split(";"):
        part = part.strip()
        if not part:
            continue
        nums = [int(x) for x in part.split()]
        if len(nums) != 3:
            raise ValueError(f"Expected three integers per shape (S,K,N), got {part!r}")
        rows.append((nums[0], nums[1], nums[2]))
    if not rows:
        raise ValueError("No shapes provided")
    return rows


def _make_bf16_linear(
    in_features: int,
    out_features: int,
    device: torch.device,
    weight_bf16: torch.Tensor,
) -> ReplicatedLinear:
    with torch.device(device), set_default_torch_dtype(torch.bfloat16):
        m = ReplicatedLinear(
            in_features,
            out_features,
            bias=False,
            quant_config=None,
            return_bias=False,
            prefix="rand_bf16",
        )
    with torch.no_grad():
        m.weight.copy_(weight_bf16)
    m.eval()
    return m


def _make_fp8_linear(
    in_features: int,
    out_features: int,
    device: torch.device,
    weight_bf16: torch.Tensor,
    quant_config,
) -> ReplicatedLinear:
    with torch.device(device), set_default_torch_dtype(torch.bfloat16):
        m = ReplicatedLinear(
            in_features,
            out_features,
            bias=False,
            quant_config=quant_config,
            return_bias=False,
            prefix="rand_fp8",
        )
    # Fp8Online: must use Parameter's patched loader so scaled_fp8_quant runs on CUDA.
    m.weight.weight_loader(m.weight, weight_bf16)
    m.eval()
    return m


def main() -> None:
    p = argparse.ArgumentParser(
        description="Random-weight BF16 vs FP8 ReplicatedLinear shape sweep (no HF weights)"
    )
    p.add_argument(
        "--shapes",
        type=str,
        default=(
            "1104,2520,4200;"
            "512,2520,4200;"
            "256,2520,4200;"
            "1104,2520,20480;"
            "1104,10240,2520;"
            "512,4096,8192"
        ),
        help="Semicolon-separated list of S,K,N (seq_len, in_features, out_features)",
    )
    p.add_argument("--warmup", type=int, default=10)
    p.add_argument("--iters", type=int, default=50)
    p.add_argument("--seed", type=int, default=0)
    p.add_argument("--master-port", type=int, default=29631)
    args = p.parse_args()

    os.environ.setdefault("MASTER_ADDR", "127.0.0.1")
    os.environ["MASTER_PORT"] = str(args.master_port)
    os.environ.setdefault("RANK", "0")
    os.environ.setdefault("WORLD_SIZE", "1")
    os.environ.setdefault("LOCAL_RANK", "0")

    device = current_omni_platform.get_torch_device(0)
    current_omni_platform.set_device(device)

    od_config = OmniDiffusionConfig(model="dummy", num_gpus=1, master_port=args.master_port)
    vllm_config = VllmConfig(compilation_config=CompilationConfig())
    vllm_config.parallel_config.tensor_parallel_size = 1
    vllm_config.parallel_config.data_parallel_size = 1

    shapes = _parse_shapes(args.shapes)
    fp8_cfg = build_quant_config("fp8")

    print(
        "# vLLM ReplicatedLinear random weights | BF16 vs FP8 (Fp8OnlineLinearMethod)\n"
        f"# device={device}  warmup={args.warmup}  iters={args.iters}  seed={args.seed}\n"
    )
    print("| S | K | N | BF16 ms | FP8 ms | FP8/BF16 |")
    print("| --- | ---: | ---: | ---: | ---: | ---: |")

    with (
        set_forward_context(vllm_config=vllm_config, omni_diffusion_config=od_config),
        set_current_vllm_config(vllm_config),
    ):
        init_distributed_environment(world_size=1, rank=0)
        initialize_model_parallel(
            data_parallel_size=1,
            cfg_parallel_size=1,
            sequence_parallel_size=1,
            ulysses_degree=1,
            ring_degree=1,
            tensor_parallel_size=1,
            pipeline_parallel_size=1,
        )
        try:
            for row_idx, (s, k, n) in enumerate(shapes):
                g = torch.Generator(device=device)
                g.manual_seed(args.seed + row_idx * 100_003)
                # Weight layout: (out_features, in_features) == (n, k)
                w = torch.randn(n, k, device=device, dtype=torch.bfloat16, generator=g)

                x = torch.randn(1, s, k, device=device, dtype=torch.bfloat16, generator=g)

                m_bf16 = _make_bf16_linear(k, n, device, w)
                t_bf16 = _bench_ms(lambda: m_bf16(x), warmup=args.warmup, iters=args.iters)
                del m_bf16
                torch.cuda.empty_cache()

                m_fp8 = _make_fp8_linear(k, n, device, w, fp8_cfg)
                t_fp8 = _bench_ms(lambda: m_fp8(x), warmup=args.warmup, iters=args.iters)
                del m_fp8
                torch.cuda.empty_cache()

                ratio = t_fp8 / t_bf16 if t_bf16 > 0 else float("nan")
                print(f"| {s} | {k} | {n} | {t_bf16:.4f} | {t_fp8:.4f} | {ratio:.2f}x |")
        finally:
            destroy_distributed_env()


if __name__ == "__main__":
    main()
</details>

Runtime taken : BF16 vs FP8 for a standalone vLLM ReplicatedLinear with random weights

seq_lenin_featuresout_featuresBF16 msFP8 msFP8/BF16
1282565120.03910.23636.04x
1104252042000.180411.037061.17x

Root Cause

I am observing a severe performance regression when using FP8 quantization compared to BF16.

In my use case (OmniGen2 diffusion inference), enabling FP8 causes a dramatic slowdown:

  • BF16: ~30 denoising steps complete in ~30 seconds
  • FP8: ~30 seconds per step

This is my setup: Hardware / stack: NVIDIA RTX 4090, PyTorch 2.10+cu128, vLLM 0.18.0 with CutlassFP8ScaledMMLinearKernel.

I have a reproduce script below. If you run it, you can see FP8 is consistently much slower than BF16.

<details><summary> reproduce script </summary>
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
"""BF16 vs FP8 microbenchmark with *random* weights — no OmniGen / HF checkpoint.

Uses vLLM ``ReplicatedLinear`` + ``Fp8OnlineLinearMethod`` (same family as many DiT
linears). For each (seq_len, in_features, out_features) tuple, draws one random BF16
weight matrix (fixed seed per row for reproducibility), builds:

- Unquantized ``ReplicatedLinear`` (BF16 GEMM)
- FP8 online layer loaded via ``weight.weight_loader`` → ``process_weights_after_loading``

Then times ``y = lin(x)`` with ``x.shape == (1, seq_len, in_features)`` in BF16.

This isolates **problem shape / kernel choice** from **OmniGen-specific weights**.

Example:

  python vllm_fp8_random_weights_shape_sweep.py \\
    --shapes "1104,2520,4200;512,2520,4200;256,4096,8192" --warmup 10 --iters 50

Reference quick smoke run (illustrative; varies by GPU/driver/torch/vLLM):

  Command:

    python vllm_fp8_random_weights_shape_sweep.py \\
      --shapes "128,256,512;1104,2520,4200" --warmup 3 --iters 10 --master-port 29640

  Hardware / stack: NVIDIA RTX 4090, PyTorch 2.10+cu128, vLLM with CutlassFP8ScaledMMLinearKernel.

  S     K     N     BF16 ms   FP8 ms    FP8/BF16
  ----  ----  ----  --------  --------  --------
  128   256   512   0.0391    0.2363    6.04x
  1104  2520  4200  0.1804    11.0370   61.17x
"""

from __future__ import annotations

import argparse
import os
import time

import torch
from vllm.config import CompilationConfig, VllmConfig, set_current_vllm_config
from vllm.model_executor.layers.linear import ReplicatedLinear
from vllm.utils.torch_utils import set_default_torch_dtype

from vllm_omni.diffusion.data import OmniDiffusionConfig
from vllm_omni.diffusion.distributed.parallel_state import (
    destroy_distributed_env,
    init_distributed_environment,
    initialize_model_parallel,
)
from vllm_omni.diffusion.forward_context import set_forward_context
from vllm_omni.platforms import current_omni_platform
from vllm_omni.quantization import build_quant_config


def _bench_ms(run_once, *, warmup: int, iters: int) -> float:
    for _ in range(warmup):
        run_once()
        torch.cuda.synchronize()
    torch.cuda.synchronize()
    t0 = time.perf_counter()
    for _ in range(iters):
        run_once()
    torch.cuda.synchronize()
    return (time.perf_counter() - t0) / iters * 1000.0


def _parse_shapes(spec: str) -> list[tuple[int, int, int]]:
    rows: list[tuple[int, int, int]] = []
    for part in spec.replace(",", " ").split(";"):
        part = part.strip()
        if not part:
            continue
        nums = [int(x) for x in part.split()]
        if len(nums) != 3:
            raise ValueError(f"Expected three integers per shape (S,K,N), got {part!r}")
        rows.append((nums[0], nums[1], nums[2]))
    if not rows:
        raise ValueError("No shapes provided")
    return rows


def _make_bf16_linear(
    in_features: int,
    out_features: int,
    device: torch.device,
    weight_bf16: torch.Tensor,
) -> ReplicatedLinear:
    with torch.device(device), set_default_torch_dtype(torch.bfloat16):
        m = ReplicatedLinear(
            in_features,
            out_features,
            bias=False,
            quant_config=None,
            return_bias=False,
            prefix="rand_bf16",
        )
    with torch.no_grad():
        m.weight.copy_(weight_bf16)
    m.eval()
    return m


def _make_fp8_linear(
    in_features: int,
    out_features: int,
    device: torch.device,
    weight_bf16: torch.Tensor,
    quant_config,
) -> ReplicatedLinear:
    with torch.device(device), set_default_torch_dtype(torch.bfloat16):
        m = ReplicatedLinear(
            in_features,
            out_features,
            bias=False,
            quant_config=quant_config,
            return_bias=False,
            prefix="rand_fp8",
        )
    # Fp8Online: must use Parameter's patched loader so scaled_fp8_quant runs on CUDA.
    m.weight.weight_loader(m.weight, weight_bf16)
    m.eval()
    return m


def main() -> None:
    p = argparse.ArgumentParser(
        description="Random-weight BF16 vs FP8 ReplicatedLinear shape sweep (no HF weights)"
    )
    p.add_argument(
        "--shapes",
        type=str,
        default=(
            "1104,2520,4200;"
            "512,2520,4200;"
            "256,2520,4200;"
            "1104,2520,20480;"
            "1104,10240,2520;"
            "512,4096,8192"
        ),
        help="Semicolon-separated list of S,K,N (seq_len, in_features, out_features)",
    )
    p.add_argument("--warmup", type=int, default=10)
    p.add_argument("--iters", type=int, default=50)
    p.add_argument("--seed", type=int, default=0)
    p.add_argument("--master-port", type=int, default=29631)
    args = p.parse_args()

    os.environ.setdefault("MASTER_ADDR", "127.0.0.1")
    os.environ["MASTER_PORT"] = str(args.master_port)
    os.environ.setdefault("RANK", "0")
    os.environ.setdefault("WORLD_SIZE", "1")
    os.environ.setdefault("LOCAL_RANK", "0")

    device = current_omni_platform.get_torch_device(0)
    current_omni_platform.set_device(device)

    od_config = OmniDiffusionConfig(model="dummy", num_gpus=1, master_port=args.master_port)
    vllm_config = VllmConfig(compilation_config=CompilationConfig())
    vllm_config.parallel_config.tensor_parallel_size = 1
    vllm_config.parallel_config.data_parallel_size = 1

    shapes = _parse_shapes(args.shapes)
    fp8_cfg = build_quant_config("fp8")

    print(
        "# vLLM ReplicatedLinear random weights | BF16 vs FP8 (Fp8OnlineLinearMethod)\n"
        f"# device={device}  warmup={args.warmup}  iters={args.iters}  seed={args.seed}\n"
    )
    print("| S | K | N | BF16 ms | FP8 ms | FP8/BF16 |")
    print("| --- | ---: | ---: | ---: | ---: | ---: |")

    with (
        set_forward_context(vllm_config=vllm_config, omni_diffusion_config=od_config),
        set_current_vllm_config(vllm_config),
    ):
        init_distributed_environment(world_size=1, rank=0)
        initialize_model_parallel(
            data_parallel_size=1,
            cfg_parallel_size=1,
            sequence_parallel_size=1,
            ulysses_degree=1,
            ring_degree=1,
            tensor_parallel_size=1,
            pipeline_parallel_size=1,
        )
        try:
            for row_idx, (s, k, n) in enumerate(shapes):
                g = torch.Generator(device=device)
                g.manual_seed(args.seed + row_idx * 100_003)
                # Weight layout: (out_features, in_features) == (n, k)
                w = torch.randn(n, k, device=device, dtype=torch.bfloat16, generator=g)

                x = torch.randn(1, s, k, device=device, dtype=torch.bfloat16, generator=g)

                m_bf16 = _make_bf16_linear(k, n, device, w)
                t_bf16 = _bench_ms(lambda: m_bf16(x), warmup=args.warmup, iters=args.iters)
                del m_bf16
                torch.cuda.empty_cache()

                m_fp8 = _make_fp8_linear(k, n, device, w, fp8_cfg)
                t_fp8 = _bench_ms(lambda: m_fp8(x), warmup=args.warmup, iters=args.iters)
                del m_fp8
                torch.cuda.empty_cache()

                ratio = t_fp8 / t_bf16 if t_bf16 > 0 else float("nan")
                print(f"| {s} | {k} | {n} | {t_bf16:.4f} | {t_fp8:.4f} | {ratio:.2f}x |")
        finally:
            destroy_distributed_env()


if __name__ == "__main__":
    main()
</details>

Runtime taken : BF16 vs FP8 for a standalone vLLM ReplicatedLinear with random weights

seq_lenin_featuresout_featuresBF16 msFP8 msFP8/BF16
1282565120.03910.23636.04x
1104252042000.180411.037061.17x

Fix Action

Fix / Workaround

def _make_fp8_linear( in_features: int, out_features: int, device: torch.device, weight_bf16: torch.Tensor, quant_config, ) -> ReplicatedLinear: with torch.device(device), set_default_torch_dtype(torch.bfloat16): m = ReplicatedLinear( in_features, out_features, bias=False, quant_config=quant_config, return_bias=False, prefix="rand_fp8", ) # Fp8Online: must use Parameter's patched loader so scaled_fp8_quant runs on CUDA. m.weight.weight_loader(m.weight, weight_bf16) m.eval() return m

============================== 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): 256 On-line CPU(s) list: 0-255 Vendor ID: AuthenticAMD Model name: AMD EPYC 7763 64-Core Processor CPU family: 25 Model: 1 Thread(s) per core: 2 Core(s) per socket: 64 Socket(s): 2 Stepping: 1 Frequency boost: enabled CPU max MHz: 3530.4929 CPU min MHz: 1500.0000 BogoMIPS: 4899.76 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 aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local user_shstk clzero irperf xsaveerptr rdpru wbnoinvd amd_ppin brs arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm debug_swap ibpb_exit_to_user Virtualization: AMD-V L1d cache: 4 MiB (128 instances) L1i cache: 4 MiB (128 instances) L2 cache: 64 MiB (128 instances) L3 cache: 512 MiB (16 instances) NUMA node(s): 2 NUMA node0 CPU(s): 0-63,128-191 NUMA node1 CPU(s): 64-127,192-255 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 always-on; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected Vulnerability Srbds: Not affected Vulnerability Tsa: Mitigation; Clear CPU buffers Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Mitigation; IBPB before exit to userspace

Code Example

#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
"""BF16 vs FP8 microbenchmark with *random* weights — no OmniGen / HF checkpoint.

Uses vLLM ``ReplicatedLinear`` + ``Fp8OnlineLinearMethod`` (same family as many DiT
linears). For each (seq_len, in_features, out_features) tuple, draws one random BF16
weight matrix (fixed seed per row for reproducibility), builds:

- Unquantized ``ReplicatedLinear`` (BF16 GEMM)
- FP8 online layer loaded via ``weight.weight_loader````process_weights_after_loading``

Then times ``y = lin(x)`` with ``x.shape == (1, seq_len, in_features)`` in BF16.

This isolates **problem shape / kernel choice** from **OmniGen-specific weights**.

Example:

  python vllm_fp8_random_weights_shape_sweep.py \\
    --shapes "1104,2520,4200;512,2520,4200;256,4096,8192" --warmup 10 --iters 50

Reference quick smoke run (illustrative; varies by GPU/driver/torch/vLLM):

  Command:

    python vllm_fp8_random_weights_shape_sweep.py \\
      --shapes "128,256,512;1104,2520,4200" --warmup 3 --iters 10 --master-port 29640

  Hardware / stack: NVIDIA RTX 4090, PyTorch 2.10+cu128, vLLM with CutlassFP8ScaledMMLinearKernel.

  S     K     N     BF16 ms   FP8 ms    FP8/BF16
  ----  ----  ----  --------  --------  --------
  128   256   512   0.0391    0.2363    6.04x
  1104  2520  4200  0.1804    11.0370   61.17x
"""

from __future__ import annotations

import argparse
import os
import time

import torch
from vllm.config import CompilationConfig, VllmConfig, set_current_vllm_config
from vllm.model_executor.layers.linear import ReplicatedLinear
from vllm.utils.torch_utils import set_default_torch_dtype

from vllm_omni.diffusion.data import OmniDiffusionConfig
from vllm_omni.diffusion.distributed.parallel_state import (
    destroy_distributed_env,
    init_distributed_environment,
    initialize_model_parallel,
)
from vllm_omni.diffusion.forward_context import set_forward_context
from vllm_omni.platforms import current_omni_platform
from vllm_omni.quantization import build_quant_config


def _bench_ms(run_once, *, warmup: int, iters: int) -> float:
    for _ in range(warmup):
        run_once()
        torch.cuda.synchronize()
    torch.cuda.synchronize()
    t0 = time.perf_counter()
    for _ in range(iters):
        run_once()
    torch.cuda.synchronize()
    return (time.perf_counter() - t0) / iters * 1000.0


def _parse_shapes(spec: str) -> list[tuple[int, int, int]]:
    rows: list[tuple[int, int, int]] = []
    for part in spec.replace(",", " ").split(";"):
        part = part.strip()
        if not part:
            continue
        nums = [int(x) for x in part.split()]
        if len(nums) != 3:
            raise ValueError(f"Expected three integers per shape (S,K,N), got {part!r}")
        rows.append((nums[0], nums[1], nums[2]))
    if not rows:
        raise ValueError("No shapes provided")
    return rows


def _make_bf16_linear(
    in_features: int,
    out_features: int,
    device: torch.device,
    weight_bf16: torch.Tensor,
) -> ReplicatedLinear:
    with torch.device(device), set_default_torch_dtype(torch.bfloat16):
        m = ReplicatedLinear(
            in_features,
            out_features,
            bias=False,
            quant_config=None,
            return_bias=False,
            prefix="rand_bf16",
        )
    with torch.no_grad():
        m.weight.copy_(weight_bf16)
    m.eval()
    return m


def _make_fp8_linear(
    in_features: int,
    out_features: int,
    device: torch.device,
    weight_bf16: torch.Tensor,
    quant_config,
) -> ReplicatedLinear:
    with torch.device(device), set_default_torch_dtype(torch.bfloat16):
        m = ReplicatedLinear(
            in_features,
            out_features,
            bias=False,
            quant_config=quant_config,
            return_bias=False,
            prefix="rand_fp8",
        )
    # Fp8Online: must use Parameter's patched loader so scaled_fp8_quant runs on CUDA.
    m.weight.weight_loader(m.weight, weight_bf16)
    m.eval()
    return m


def main() -> None:
    p = argparse.ArgumentParser(
        description="Random-weight BF16 vs FP8 ReplicatedLinear shape sweep (no HF weights)"
    )
    p.add_argument(
        "--shapes",
        type=str,
        default=(
            "1104,2520,4200;"
            "512,2520,4200;"
            "256,2520,4200;"
            "1104,2520,20480;"
            "1104,10240,2520;"
            "512,4096,8192"
        ),
        help="Semicolon-separated list of S,K,N (seq_len, in_features, out_features)",
    )
    p.add_argument("--warmup", type=int, default=10)
    p.add_argument("--iters", type=int, default=50)
    p.add_argument("--seed", type=int, default=0)
    p.add_argument("--master-port", type=int, default=29631)
    args = p.parse_args()

    os.environ.setdefault("MASTER_ADDR", "127.0.0.1")
    os.environ["MASTER_PORT"] = str(args.master_port)
    os.environ.setdefault("RANK", "0")
    os.environ.setdefault("WORLD_SIZE", "1")
    os.environ.setdefault("LOCAL_RANK", "0")

    device = current_omni_platform.get_torch_device(0)
    current_omni_platform.set_device(device)

    od_config = OmniDiffusionConfig(model="dummy", num_gpus=1, master_port=args.master_port)
    vllm_config = VllmConfig(compilation_config=CompilationConfig())
    vllm_config.parallel_config.tensor_parallel_size = 1
    vllm_config.parallel_config.data_parallel_size = 1

    shapes = _parse_shapes(args.shapes)
    fp8_cfg = build_quant_config("fp8")

    print(
        "# vLLM ReplicatedLinear random weights | BF16 vs FP8 (Fp8OnlineLinearMethod)\n"
        f"# device={device}  warmup={args.warmup}  iters={args.iters}  seed={args.seed}\n"
    )
    print("| S | K | N | BF16 ms | FP8 ms | FP8/BF16 |")
    print("| --- | ---: | ---: | ---: | ---: | ---: |")

    with (
        set_forward_context(vllm_config=vllm_config, omni_diffusion_config=od_config),
        set_current_vllm_config(vllm_config),
    ):
        init_distributed_environment(world_size=1, rank=0)
        initialize_model_parallel(
            data_parallel_size=1,
            cfg_parallel_size=1,
            sequence_parallel_size=1,
            ulysses_degree=1,
            ring_degree=1,
            tensor_parallel_size=1,
            pipeline_parallel_size=1,
        )
        try:
            for row_idx, (s, k, n) in enumerate(shapes):
                g = torch.Generator(device=device)
                g.manual_seed(args.seed + row_idx * 100_003)
                # Weight layout: (out_features, in_features) == (n, k)
                w = torch.randn(n, k, device=device, dtype=torch.bfloat16, generator=g)

                x = torch.randn(1, s, k, device=device, dtype=torch.bfloat16, generator=g)

                m_bf16 = _make_bf16_linear(k, n, device, w)
                t_bf16 = _bench_ms(lambda: m_bf16(x), warmup=args.warmup, iters=args.iters)
                del m_bf16
                torch.cuda.empty_cache()

                m_fp8 = _make_fp8_linear(k, n, device, w, fp8_cfg)
                t_fp8 = _bench_ms(lambda: m_fp8(x), warmup=args.warmup, iters=args.iters)
                del m_fp8
                torch.cuda.empty_cache()

                ratio = t_fp8 / t_bf16 if t_bf16 > 0 else float("nan")
                print(f"| {s} | {k} | {n} | {t_bf16:.4f} | {t_fp8:.4f} | {ratio:.2f}x |")
        finally:
            destroy_distributed_env()


if __name__ == "__main__":
    main()

---

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

==============================
       PyTorch Info
==============================
PyTorch version              : 2.10.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.10 (main, Sep  7 2024, 18:35:41) [GCC 11.4.0] (64-bit runtime)
Python platform              : Linux-6.8.0-101-generic-x86_64-with-glibc2.35

==============================
       CUDA / GPU Info
==============================
Is CUDA available            : True
CUDA runtime version         : 12.4.131
CUDA_MODULE_LOADING set to   : 
GPU models and configuration : GPU 0: NVIDIA GeForce RTX 4090
Nvidia driver version        : 580.126.20
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):                                  256
On-line CPU(s) list:                     0-255
Vendor ID:                               AuthenticAMD
Model name:                              AMD EPYC 7763 64-Core Processor
CPU family:                              25
Model:                                   1
Thread(s) per core:                      2
Core(s) per socket:                      64
Socket(s):                               2
Stepping:                                1
Frequency boost:                         enabled
CPU max MHz:                             3530.4929
CPU min MHz:                             1500.0000
BogoMIPS:                                4899.76
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 aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local user_shstk clzero irperf xsaveerptr rdpru wbnoinvd amd_ppin brs arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm debug_swap ibpb_exit_to_user
Virtualization:                          AMD-V
L1d cache:                               4 MiB (128 instances)
L1i cache:                               4 MiB (128 instances)
L2 cache:                                64 MiB (128 instances)
L3 cache:                                512 MiB (16 instances)
NUMA node(s):                            2
NUMA node0 CPU(s):                       0-63,128-191
NUMA node1 CPU(s):                       64-127,192-255
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 always-on; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Mitigation; Clear CPU buffers
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Mitigation; IBPB before exit to userspace

==============================
Versions of relevant libraries
==============================
[pip3] flashinfer-python==0.6.6
[pip3] numpy==2.2.6
[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-cudnn-frontend==1.18.0
[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-cutlass-dsl==4.4.2
[pip3] nvidia-cutlass-dsl-libs-base==4.4.2
[pip3] nvidia-ml-py==13.595.45
[pip3] nvidia-nccl-cu12==2.27.5
[pip3] nvidia-nvjitlink-cu12==12.8.93
[pip3] nvidia-nvshmem-cu12==3.4.5
[pip3] nvidia-nvtx-cu12==12.8.90
[pip3] pyzmq==27.1.0
[pip3] torch==2.10.0
[pip3] torch_c_dlpack_ext==0.1.5
[pip3] torchaudio==2.10.0
[pip3] torchvision==0.25.0
[pip3] transformers==4.57.6
[pip3] triton==3.6.0
[conda] Could not collect

==============================
         vLLM Info
==============================
ROCM Version                 : Could not collect
vLLM Version                 : 0.18.1
vLLM Build Flags:
  CUDA Archs: Not Set; ROCm: Disabled
GPU Topology:
        GPU0    NIC0    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X      NODE    64-127,192-255  1               N/A
NIC0    NODE     X 

Legend:

  X    = Self
  SYS  = Connection traversing PCIe as well as the SMP interconnect between NUMA nodes (e.g., QPI/UPI)
  NODE = Connection traversing PCIe as well as the interconnect between PCIe Host Bridges within a NUMA node
  PHB  = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
  PXB  = Connection traversing multiple PCIe bridges (without traversing the PCIe Host Bridge)
  PIX  = Connection traversing at most a single PCIe bridge
  NV#  = Connection traversing a bonded set of # NVLinks

NIC Legend:

  NIC0: mlx5_bond_0

==============================
     Environment Variables
==============================
NO_COLOR=1
PYTORCH_NVML_BASED_CUDA_CHECK=1
TORCHINDUCTOR_COMPILE_THREADS=1
TORCHINDUCTOR_CACHE_DIR=/tmp/torchinductor_root
RAW_BUFFERClick to expand / collapse

Proposal to improve performance

I'm not sure how to improve performance yet.

Report of performance regression

Description

I am observing a severe performance regression when using FP8 quantization compared to BF16.

In my use case (OmniGen2 diffusion inference), enabling FP8 causes a dramatic slowdown:

  • BF16: ~30 denoising steps complete in ~30 seconds
  • FP8: ~30 seconds per step

This is my setup: Hardware / stack: NVIDIA RTX 4090, PyTorch 2.10+cu128, vLLM 0.18.0 with CutlassFP8ScaledMMLinearKernel.

I have a reproduce script below. If you run it, you can see FP8 is consistently much slower than BF16.

<details><summary> reproduce script </summary>
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
"""BF16 vs FP8 microbenchmark with *random* weights — no OmniGen / HF checkpoint.

Uses vLLM ``ReplicatedLinear`` + ``Fp8OnlineLinearMethod`` (same family as many DiT
linears). For each (seq_len, in_features, out_features) tuple, draws one random BF16
weight matrix (fixed seed per row for reproducibility), builds:

- Unquantized ``ReplicatedLinear`` (BF16 GEMM)
- FP8 online layer loaded via ``weight.weight_loader`` → ``process_weights_after_loading``

Then times ``y = lin(x)`` with ``x.shape == (1, seq_len, in_features)`` in BF16.

This isolates **problem shape / kernel choice** from **OmniGen-specific weights**.

Example:

  python vllm_fp8_random_weights_shape_sweep.py \\
    --shapes "1104,2520,4200;512,2520,4200;256,4096,8192" --warmup 10 --iters 50

Reference quick smoke run (illustrative; varies by GPU/driver/torch/vLLM):

  Command:

    python vllm_fp8_random_weights_shape_sweep.py \\
      --shapes "128,256,512;1104,2520,4200" --warmup 3 --iters 10 --master-port 29640

  Hardware / stack: NVIDIA RTX 4090, PyTorch 2.10+cu128, vLLM with CutlassFP8ScaledMMLinearKernel.

  S     K     N     BF16 ms   FP8 ms    FP8/BF16
  ----  ----  ----  --------  --------  --------
  128   256   512   0.0391    0.2363    6.04x
  1104  2520  4200  0.1804    11.0370   61.17x
"""

from __future__ import annotations

import argparse
import os
import time

import torch
from vllm.config import CompilationConfig, VllmConfig, set_current_vllm_config
from vllm.model_executor.layers.linear import ReplicatedLinear
from vllm.utils.torch_utils import set_default_torch_dtype

from vllm_omni.diffusion.data import OmniDiffusionConfig
from vllm_omni.diffusion.distributed.parallel_state import (
    destroy_distributed_env,
    init_distributed_environment,
    initialize_model_parallel,
)
from vllm_omni.diffusion.forward_context import set_forward_context
from vllm_omni.platforms import current_omni_platform
from vllm_omni.quantization import build_quant_config


def _bench_ms(run_once, *, warmup: int, iters: int) -> float:
    for _ in range(warmup):
        run_once()
        torch.cuda.synchronize()
    torch.cuda.synchronize()
    t0 = time.perf_counter()
    for _ in range(iters):
        run_once()
    torch.cuda.synchronize()
    return (time.perf_counter() - t0) / iters * 1000.0


def _parse_shapes(spec: str) -> list[tuple[int, int, int]]:
    rows: list[tuple[int, int, int]] = []
    for part in spec.replace(",", " ").split(";"):
        part = part.strip()
        if not part:
            continue
        nums = [int(x) for x in part.split()]
        if len(nums) != 3:
            raise ValueError(f"Expected three integers per shape (S,K,N), got {part!r}")
        rows.append((nums[0], nums[1], nums[2]))
    if not rows:
        raise ValueError("No shapes provided")
    return rows


def _make_bf16_linear(
    in_features: int,
    out_features: int,
    device: torch.device,
    weight_bf16: torch.Tensor,
) -> ReplicatedLinear:
    with torch.device(device), set_default_torch_dtype(torch.bfloat16):
        m = ReplicatedLinear(
            in_features,
            out_features,
            bias=False,
            quant_config=None,
            return_bias=False,
            prefix="rand_bf16",
        )
    with torch.no_grad():
        m.weight.copy_(weight_bf16)
    m.eval()
    return m


def _make_fp8_linear(
    in_features: int,
    out_features: int,
    device: torch.device,
    weight_bf16: torch.Tensor,
    quant_config,
) -> ReplicatedLinear:
    with torch.device(device), set_default_torch_dtype(torch.bfloat16):
        m = ReplicatedLinear(
            in_features,
            out_features,
            bias=False,
            quant_config=quant_config,
            return_bias=False,
            prefix="rand_fp8",
        )
    # Fp8Online: must use Parameter's patched loader so scaled_fp8_quant runs on CUDA.
    m.weight.weight_loader(m.weight, weight_bf16)
    m.eval()
    return m


def main() -> None:
    p = argparse.ArgumentParser(
        description="Random-weight BF16 vs FP8 ReplicatedLinear shape sweep (no HF weights)"
    )
    p.add_argument(
        "--shapes",
        type=str,
        default=(
            "1104,2520,4200;"
            "512,2520,4200;"
            "256,2520,4200;"
            "1104,2520,20480;"
            "1104,10240,2520;"
            "512,4096,8192"
        ),
        help="Semicolon-separated list of S,K,N (seq_len, in_features, out_features)",
    )
    p.add_argument("--warmup", type=int, default=10)
    p.add_argument("--iters", type=int, default=50)
    p.add_argument("--seed", type=int, default=0)
    p.add_argument("--master-port", type=int, default=29631)
    args = p.parse_args()

    os.environ.setdefault("MASTER_ADDR", "127.0.0.1")
    os.environ["MASTER_PORT"] = str(args.master_port)
    os.environ.setdefault("RANK", "0")
    os.environ.setdefault("WORLD_SIZE", "1")
    os.environ.setdefault("LOCAL_RANK", "0")

    device = current_omni_platform.get_torch_device(0)
    current_omni_platform.set_device(device)

    od_config = OmniDiffusionConfig(model="dummy", num_gpus=1, master_port=args.master_port)
    vllm_config = VllmConfig(compilation_config=CompilationConfig())
    vllm_config.parallel_config.tensor_parallel_size = 1
    vllm_config.parallel_config.data_parallel_size = 1

    shapes = _parse_shapes(args.shapes)
    fp8_cfg = build_quant_config("fp8")

    print(
        "# vLLM ReplicatedLinear random weights | BF16 vs FP8 (Fp8OnlineLinearMethod)\n"
        f"# device={device}  warmup={args.warmup}  iters={args.iters}  seed={args.seed}\n"
    )
    print("| S | K | N | BF16 ms | FP8 ms | FP8/BF16 |")
    print("| --- | ---: | ---: | ---: | ---: | ---: |")

    with (
        set_forward_context(vllm_config=vllm_config, omni_diffusion_config=od_config),
        set_current_vllm_config(vllm_config),
    ):
        init_distributed_environment(world_size=1, rank=0)
        initialize_model_parallel(
            data_parallel_size=1,
            cfg_parallel_size=1,
            sequence_parallel_size=1,
            ulysses_degree=1,
            ring_degree=1,
            tensor_parallel_size=1,
            pipeline_parallel_size=1,
        )
        try:
            for row_idx, (s, k, n) in enumerate(shapes):
                g = torch.Generator(device=device)
                g.manual_seed(args.seed + row_idx * 100_003)
                # Weight layout: (out_features, in_features) == (n, k)
                w = torch.randn(n, k, device=device, dtype=torch.bfloat16, generator=g)

                x = torch.randn(1, s, k, device=device, dtype=torch.bfloat16, generator=g)

                m_bf16 = _make_bf16_linear(k, n, device, w)
                t_bf16 = _bench_ms(lambda: m_bf16(x), warmup=args.warmup, iters=args.iters)
                del m_bf16
                torch.cuda.empty_cache()

                m_fp8 = _make_fp8_linear(k, n, device, w, fp8_cfg)
                t_fp8 = _bench_ms(lambda: m_fp8(x), warmup=args.warmup, iters=args.iters)
                del m_fp8
                torch.cuda.empty_cache()

                ratio = t_fp8 / t_bf16 if t_bf16 > 0 else float("nan")
                print(f"| {s} | {k} | {n} | {t_bf16:.4f} | {t_fp8:.4f} | {ratio:.2f}x |")
        finally:
            destroy_distributed_env()


if __name__ == "__main__":
    main()
</details>

Runtime taken : BF16 vs FP8 for a standalone vLLM ReplicatedLinear with random weights

seq_lenin_featuresout_featuresBF16 msFP8 msFP8/BF16
1282565120.03910.23636.04x
1104252042000.180411.037061.17x

Misc discussion on performance

This may be related to prior reports on quantization performance:

Your current environment (if you think it is necessary)

The output of python collect_env.py are attached below.

<details>


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

==============================
       PyTorch Info
==============================
PyTorch version              : 2.10.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.10 (main, Sep  7 2024, 18:35:41) [GCC 11.4.0] (64-bit runtime)
Python platform              : Linux-6.8.0-101-generic-x86_64-with-glibc2.35

==============================
       CUDA / GPU Info
==============================
Is CUDA available            : True
CUDA runtime version         : 12.4.131
CUDA_MODULE_LOADING set to   : 
GPU models and configuration : GPU 0: NVIDIA GeForce RTX 4090
Nvidia driver version        : 580.126.20
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):                                  256
On-line CPU(s) list:                     0-255
Vendor ID:                               AuthenticAMD
Model name:                              AMD EPYC 7763 64-Core Processor
CPU family:                              25
Model:                                   1
Thread(s) per core:                      2
Core(s) per socket:                      64
Socket(s):                               2
Stepping:                                1
Frequency boost:                         enabled
CPU max MHz:                             3530.4929
CPU min MHz:                             1500.0000
BogoMIPS:                                4899.76
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 aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local user_shstk clzero irperf xsaveerptr rdpru wbnoinvd amd_ppin brs arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm debug_swap ibpb_exit_to_user
Virtualization:                          AMD-V
L1d cache:                               4 MiB (128 instances)
L1i cache:                               4 MiB (128 instances)
L2 cache:                                64 MiB (128 instances)
L3 cache:                                512 MiB (16 instances)
NUMA node(s):                            2
NUMA node0 CPU(s):                       0-63,128-191
NUMA node1 CPU(s):                       64-127,192-255
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 always-on; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Mitigation; Clear CPU buffers
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Mitigation; IBPB before exit to userspace

==============================
Versions of relevant libraries
==============================
[pip3] flashinfer-python==0.6.6
[pip3] numpy==2.2.6
[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-cudnn-frontend==1.18.0
[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-cutlass-dsl==4.4.2
[pip3] nvidia-cutlass-dsl-libs-base==4.4.2
[pip3] nvidia-ml-py==13.595.45
[pip3] nvidia-nccl-cu12==2.27.5
[pip3] nvidia-nvjitlink-cu12==12.8.93
[pip3] nvidia-nvshmem-cu12==3.4.5
[pip3] nvidia-nvtx-cu12==12.8.90
[pip3] pyzmq==27.1.0
[pip3] torch==2.10.0
[pip3] torch_c_dlpack_ext==0.1.5
[pip3] torchaudio==2.10.0
[pip3] torchvision==0.25.0
[pip3] transformers==4.57.6
[pip3] triton==3.6.0
[conda] Could not collect

==============================
         vLLM Info
==============================
ROCM Version                 : Could not collect
vLLM Version                 : 0.18.1
vLLM Build Flags:
  CUDA Archs: Not Set; ROCm: Disabled
GPU Topology:
        GPU0    NIC0    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X      NODE    64-127,192-255  1               N/A
NIC0    NODE     X 

Legend:

  X    = Self
  SYS  = Connection traversing PCIe as well as the SMP interconnect between NUMA nodes (e.g., QPI/UPI)
  NODE = Connection traversing PCIe as well as the interconnect between PCIe Host Bridges within a NUMA node
  PHB  = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
  PXB  = Connection traversing multiple PCIe bridges (without traversing the PCIe Host Bridge)
  PIX  = Connection traversing at most a single PCIe bridge
  NV#  = Connection traversing a bonded set of # NVLinks

NIC Legend:

  NIC0: mlx5_bond_0

==============================
     Environment Variables
==============================
NO_COLOR=1
PYTORCH_NVML_BASED_CUDA_CHECK=1
TORCHINDUCTOR_COMPILE_THREADS=1
TORCHINDUCTOR_CACHE_DIR=/tmp/torchinductor_root
</details>

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 most likely fix for the severe performance regression when using FP8 quantization compared to BF16 is to investigate and optimize the FP8 quantization configuration, specifically the CutlassFP8ScaledMMLinearKernel, to better match the performance of BF16.

Guidance

  • Investigate the FP8 quantization configuration and the CutlassFP8ScaledMMLinearKernel to identify potential bottlenecks or optimization opportunities.
  • Compare the performance of different FP8 quantization configurations to determine the optimal settings for the specific use case.
  • Consider updating the vLLM library to the latest version, as there may be performance improvements or bug fixes related to FP8 quantization.
  • Review the related issues mentioned in the discussion, such as https://github.com/vllm-project/vllm/issues/17487 and https://github.com/vllm-project/vllm/issues/9992, to see if they provide any insights or solutions to the performance regression.

Example

No specific code example is provided, as the issue is related to the performance of the FP8 quantization configuration, which requires a deeper investigation and optimization.

Notes

The performance regression may be related to the specific hardware and software configuration, so it's essential to investigate and optimize the FP8 quantization configuration for the particular use case.

Recommendation

Apply a workaround by investigating and optimizing the FP8 quantization configuration to improve performance, as updating to a fixed version is not explicitly implied in the issue.

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

vllm - 💡(How to fix) Fix [Performance]: FP8 (Fp8OnlineLinearMethod) significantly slower than BF16 for ReplicatedLinear [1 participants]