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
7fafc730
Commit
7fafc730
authored
Sep 20, 2024
by
zhuwenwen
Browse files
choose ck or cutlass implementation based on the fa version
parent
5b62725e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
21 deletions
+17
-21
vllm/attention/backends/rocm_flash_attn.py
vllm/attention/backends/rocm_flash_attn.py
+17
-15
vllm/envs.py
vllm/envs.py
+0
-6
No files found.
vllm/attention/backends/rocm_flash_attn.py
View file @
7fafc730
...
...
@@ -303,7 +303,7 @@ class ROCmFlashAttentionImpl(AttentionImpl):
try
:
from
flash_attn
import
flash_attn_varlen_func
# noqa: F401
self
.
attn_func
=
flash_attn_varlen_func
logger
.
debug
(
"Using CK FA in ROCmBackend"
)
logger
.
debug
(
"Using CK
/CUTLASS
FA in ROCmBackend"
)
except
ModuleNotFoundError
:
self
.
use_naive_attn
=
True
...
...
@@ -453,7 +453,9 @@ class ROCmFlashAttentionImpl(AttentionImpl):
attn_masks
,
)
else
:
if
envs
.
VLLM_USE_CL_FLASH_ATTN
:
import
flash_attn
major
,
minor
,
_
=
flash_attn
.
__version__
.
split
(
'.'
)
if
(
major
,
minor
)
>=
(
'2'
,
'6'
):
out
=
self
.
attn_func
(
q
=
query
,
k
=
key
,
...
...
vllm/envs.py
View file @
7fafc730
...
...
@@ -12,7 +12,6 @@ if TYPE_CHECKING:
VLLM_NCCL_SO_PATH
:
Optional
[
str
]
=
None
LD_LIBRARY_PATH
:
Optional
[
str
]
=
None
VLLM_USE_TRITON_FLASH_ATTN
:
bool
=
False
VLLM_USE_CL_FLASH_ATTN
:
bool
=
False
VLLM_USE_OPT_OP
:
bool
=
False
VLLM_USE_PA_PRINT_PARAM
:
bool
=
False
LOCAL_RANK
:
int
=
0
...
...
@@ -197,11 +196,6 @@ environment_variables: Dict[str, Callable[[], Any]] = {
lambda
:
(
os
.
environ
.
get
(
"VLLM_USE_TRITON_FLASH_ATTN"
,
"False"
).
lower
()
in
(
"true"
,
"1"
)),
# flag to control if vllm should use cutlass flash attention
"VLLM_USE_CL_FLASH_ATTN"
:
lambda
:
(
os
.
environ
.
get
(
"VLLM_USE_CL_FLASH_ATTN"
,
"True"
).
lower
()
in
(
"true"
,
"1"
)),
# flag to control vllm to use optimized kernels
"VLLM_USE_OPT_OP"
:
lambda
:
(
os
.
environ
.
get
(
"VLLM_USE_OPT_OP"
,
"True"
).
lower
()
in
...
...
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