Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
acaea3bb
Unverified
Commit
acaea3bb
authored
Mar 15, 2025
by
DefTruth
Committed by
GitHub
Mar 14, 2025
Browse files
[Bugfix][V1] Fix flashinfer sampling (#14815)
parent
9f374227
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
vllm/v1/sample/ops/topk_topp_sampler.py
vllm/v1/sample/ops/topk_topp_sampler.py
+18
-1
No files found.
vllm/v1/sample/ops/topk_topp_sampler.py
View file @
acaea3bb
...
@@ -24,7 +24,24 @@ class TopKTopPSampler(nn.Module):
...
@@ -24,7 +24,24 @@ class TopKTopPSampler(nn.Module):
super
().
__init__
()
super
().
__init__
()
if
current_platform
.
is_cuda
():
if
current_platform
.
is_cuda
():
if
is_flashinfer_available
:
if
is_flashinfer_available
:
if
envs
.
VLLM_USE_FLASHINFER_SAMPLER
is
not
False
:
flashinfer_version
=
flashinfer
.
__version__
if
flashinfer_version
>=
"0.2.3"
:
# FIXME(DefTruth): Currently, we have errors when using
# FlashInfer>=v0.2.3 for top-p & top-k sampling. As a
# workaround, we disable FlashInfer for top-p & top-k
# sampling by default while FlashInfer>=v0.2.3.
# The sampling API removes the success return value
# of all sampling API, which is not compatible with
# earlier design.
# https://github.com/flashinfer-ai/flashinfer/releases/
# tag/v0.2.3
logger
.
info
(
"Currently, FlashInfer top-p & top-k sampling sampler "
"is disabled because FlashInfer>=v0.2.3 is not "
"backward compatible. Falling back to the PyTorch-"
"native implementation of top-p & top-k sampling."
)
self
.
forward
=
self
.
forward_native
elif
envs
.
VLLM_USE_FLASHINFER_SAMPLER
is
not
False
:
# NOTE(woosuk): The V0 sampler doesn't use FlashInfer for
# NOTE(woosuk): The V0 sampler doesn't use FlashInfer for
# sampling unless VLLM_USE_FLASHINFER_SAMPLER=1 (i.e., by
# sampling unless VLLM_USE_FLASHINFER_SAMPLER=1 (i.e., by
# default it is unused). For backward compatibility, we set
# default it is unused). For backward compatibility, we set
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment