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
23fea871
Unverified
Commit
23fea871
authored
Oct 05, 2024
by
TJian
Committed by
GitHub
Oct 06, 2024
Browse files
[Bugfix] Fix try-catch conditions to import correct Flash Attention Backend in Draft Model (#9101)
parent
f4dd830e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
vllm/spec_decode/draft_model_runner.py
vllm/spec_decode/draft_model_runner.py
+10
-5
No files found.
vllm/spec_decode/draft_model_runner.py
View file @
23fea871
...
...
@@ -6,11 +6,16 @@ from vllm.forward_context import set_forward_context
from
vllm.model_executor.layers.sampler
import
SamplerOutput
try
:
try
:
from
vllm.attention.backends.flash_attn
import
FlashAttentionMetadata
except
ModuleNotFoundError
:
# vllm_flash_attn is not installed,
use
the
identical
ROCm FA metadata
except
(
ModuleNotFoundError
,
ImportError
)
:
# vllm_flash_attn is not installed,
try
the ROCm FA metadata
from
vllm.attention.backends.rocm_flash_attn
import
(
ROCmFlashAttentionMetadata
as
FlashAttentionMetadata
)
except
(
ModuleNotFoundError
,
ImportError
)
as
err
:
raise
RuntimeError
(
"Draft model speculative decoding currently only supports"
"CUDA and ROCm flash attention backend."
)
from
err
from
vllm.config
import
(
CacheConfig
,
DeviceConfig
,
LoadConfig
,
LoRAConfig
,
ModelConfig
,
ObservabilityConfig
,
ParallelConfig
,
...
...
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