A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 2, 01:00 UTC
[Minor] Remove FlashInfer version check in topk_topp_sampler (#44442)
Signed-off-by: Woosuk Kwon <woosuk@inferact.ai>
Woosuk Kwon committed
Jun 3, 2026 at 14:06 UTC
6bad553f4e7a1d628b2c81ccc03c13f16f6cfd1a
1 file changed
+5
-20
vllm/v1/sample/ops/topk_topp_sampler.py
+5
-20
@@ -4,7 +4,6 @@
4
5
import torch
6
import torch.nn as nn
7
-from packaging import version
7
8
from vllm import envs
9
from vllm._aiter_ops import rocm_aiter_ops
@@ -19,17 +18,16 @@ if HAS_TRITON:
18
logger = init_logger(__name__)
19
20
22
-_FLASHINFER_MIN_VERSION = "0.2.3"
23
-
24
-
21
def flashinfer_sampler_supported() -> bool:
22
"""Decide whether FlashInfer's top-p/top-k sampler can be used.
23
24
Returns False (with appropriate logging) when ``VLLM_USE_FLASHINFER_SAMPLER``
25
is 0, when the platform isn't CUDA, when the GPU's compute capability is
30
- unsupported, or when the installed flashinfer is missing or too old. Raises
31
- ``RuntimeError`` if the user explicitly opted in via the env var but
32
- FlashInfer is unavailable.
26
+ unsupported. Raises ``RuntimeError`` if the user explicitly opted in
27
+ via the env var but FlashInfer is unavailable.
28
+
29
+ Assumes flashinfer is installed, as guaranteed by ``requirements/cuda.txt``;
30
+ otherwise importing the FlashInfer backend below raises ``ImportError``.
31
32
Note: callers must additionally ensure ``logprobs_mode`` doesn't require
33
post-top-k/top-p logits/logprobs for any request whose logprobs will be
@@ -52,19 +50,6 @@ def flashinfer_sampler_supported() -> bool:
50
unsupported_reason = (
51
f"unsupported compute capability {capability.as_version_str()}"
52
)
55
- else:
56
- try:
57
- import flashinfer
58
-
59
- if version.parse(flashinfer.__version__) < version.parse(
60
- _FLASHINFER_MIN_VERSION
61
- ):
62
- unsupported_reason = (
63
- f"flashinfer {flashinfer.__version__} is too old "
64
- f"(>={_FLASHINFER_MIN_VERSION} required)"
65
- )
66
- except ImportError:
67
- unsupported_reason = "flashinfer is not installed"
53
54
if unsupported_reason is None:
55
logger.info_once("Using FlashInfer for top-p & top-k sampling.", scope="global")