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
2071c380
Commit
2071c380
authored
Sep 13, 2025
by
zhuwenwen
Browse files
add VLLM_USE_MERGE_ATTN_STATES_OPT to control merge_attn_states support
parent
48b4c41d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
vllm/attention/ops/merge_attn_states.py
vllm/attention/ops/merge_attn_states.py
+2
-1
vllm/envs.py
vllm/envs.py
+5
-0
No files found.
vllm/attention/ops/merge_attn_states.py
View file @
2071c380
...
@@ -5,6 +5,7 @@ from typing import Optional
...
@@ -5,6 +5,7 @@ from typing import Optional
import
torch
import
torch
from
vllm.platforms
import
current_platform
from
vllm.platforms
import
current_platform
from
vllm
import
envs
def
merge_attn_states
(
def
merge_attn_states
(
...
@@ -31,7 +32,7 @@ def merge_attn_states(
...
@@ -31,7 +32,7 @@ def merge_attn_states(
return
headdim
%
4
==
0
return
headdim
%
4
==
0
return
headdim
%
8
==
0
return
headdim
%
8
==
0
if
(
current_platform
.
is_cuda
()
or
current_platform
.
is_rocm
()
and
supported_dtypes
(
output
)
if
(
current_platform
.
is_cuda
()
or
envs
.
VLLM_USE_MERGE_ATTN_STATES_OPT
and
supported_dtypes
(
output
)
and
supported_headdim
(
output
)):
and
supported_headdim
(
output
)):
from
vllm._custom_ops
import
merge_attn_states
from
vllm._custom_ops
import
merge_attn_states
return
merge_attn_states
(
output
,
prefix_output
,
prefix_lse
,
return
merge_attn_states
(
output
,
prefix_output
,
prefix_lse
,
...
...
vllm/envs.py
View file @
2071c380
...
@@ -166,6 +166,7 @@ if TYPE_CHECKING:
...
@@ -166,6 +166,7 @@ if TYPE_CHECKING:
VLLM_USE_GLOBAL_CACHE13
:
bool
=
False
VLLM_USE_GLOBAL_CACHE13
:
bool
=
False
VLLM_USE_LIGHT_OP
:
bool
=
False
VLLM_USE_LIGHT_OP
:
bool
=
False
VLLM_USE_TRITON_CAT
:
bool
=
False
VLLM_USE_TRITON_CAT
:
bool
=
False
VLLM_USE_MERGE_ATTN_STATES_OPT
:
bool
=
False
def
get_default_cache_root
():
def
get_default_cache_root
():
return
os
.
getenv
(
return
os
.
getenv
(
...
@@ -1099,6 +1100,10 @@ environment_variables: dict[str, Callable[[], Any]] = {
...
@@ -1099,6 +1100,10 @@ environment_variables: dict[str, Callable[[], Any]] = {
"VLLM_USE_TRITON_CAT"
:
"VLLM_USE_TRITON_CAT"
:
lambda
:
(
os
.
environ
.
get
(
"VLLM_USE_TRITON_CAT"
,
"True"
).
lower
()
in
lambda
:
(
os
.
environ
.
get
(
"VLLM_USE_TRITON_CAT"
,
"True"
).
lower
()
in
(
"true"
,
"1"
)),
(
"true"
,
"1"
)),
# vLLM will use opt merge_aatn_states,not triton
"VLLM_USE_MERGE_ATTN_STATES_OPT"
:
lambda
:
(
os
.
environ
.
get
(
"VLLM_USE_MERGE_ATTN_STATES_OPT"
,
"True"
).
lower
()
in
(
"true"
,
"1"
)),
}
}
# --8<-- [end:env-vars-definition]
# --8<-- [end:env-vars-definition]
...
...
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