Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions vllm/model_executor/kernels/linear/mxfp8/flashinfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
)
from vllm.platforms import current_platform
from vllm.utils import flashinfer as vllm_flashinfer
from vllm.utils.flashinfer import has_flashinfer_cutedsl
from vllm.utils.flashinfer import has_flashinfer, has_flashinfer_cutedsl

from .Mxfp8LinearKernel import Mxfp8LinearKernel, Mxfp8LinearLayerConfig

Expand All @@ -23,9 +23,13 @@ class FlashInferCutlassMxfp8LinearKernel(Mxfp8LinearKernel):
def is_supported(
cls, compute_capability: int | None = None
) -> tuple[bool, str | None]:
if current_platform.has_device_capability(100):
return True, None
return False, "requires >=sm_100 (Blackwell)"
if not (
current_platform.is_cuda() and current_platform.has_device_capability(100)
):
return False, "requires >=sm_100 (Blackwell)"
if not has_flashinfer():
return False, "requires FlashInfer"
return True, None

@classmethod
def can_implement(cls, c: Mxfp8LinearLayerConfig) -> tuple[bool, str | None]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ def _mxfp8_e4m3_quantize_impl(
alignment: int = 0,
) -> tuple[torch.Tensor, torch.Tensor]:
from vllm.platforms import current_platform
from vllm.utils.flashinfer import has_flashinfer

if current_platform.has_device_capability(100):
if current_platform.has_device_capability(100) and has_flashinfer():
from flashinfer import mxfp8_quantize as flashinfer_mxfp8_quantize

x_q, x_scales = flashinfer_mxfp8_quantize(
Expand Down
Loading