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
ecff8309
Unverified
Commit
ecff8309
authored
Mar 27, 2025
by
Gregory Shtrasberg
Committed by
GitHub
Mar 26, 2025
Browse files
[ROCm] Env variable to trigger custom PA (#15557)
Signed-off-by:
Gregory Shtrasberg
<
Gregory.Shtrasberg@amd.com
>
parent
dcf2a590
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
vllm/attention/backends/rocm_flash_attn.py
vllm/attention/backends/rocm_flash_attn.py
+2
-1
vllm/envs.py
vllm/envs.py
+6
-0
No files found.
vllm/attention/backends/rocm_flash_attn.py
View file @
ecff8309
...
@@ -908,4 +908,5 @@ def _use_rocm_custom_paged_attention(qtype: torch.dtype, head_size: int,
...
@@ -908,4 +908,5 @@ def _use_rocm_custom_paged_attention(qtype: torch.dtype, head_size: int,
and
(
qtype
==
torch
.
half
or
qtype
==
torch
.
bfloat16
)
and
(
qtype
==
torch
.
half
or
qtype
==
torch
.
bfloat16
)
and
(
head_size
==
64
or
head_size
==
128
)
and
(
head_size
==
64
or
head_size
==
128
)
and
(
block_size
==
16
or
block_size
==
32
)
and
(
block_size
==
16
or
block_size
==
32
)
and
(
gqa_ratio
>=
1
and
gqa_ratio
<=
16
)
and
max_seq_len
<=
32768
)
and
(
gqa_ratio
>=
1
and
gqa_ratio
<=
16
)
and
max_seq_len
<=
32768
and
envs
.
VLLM_ROCM_CUSTOM_PAGED_ATTN
)
vllm/envs.py
View file @
ecff8309
...
@@ -78,6 +78,7 @@ if TYPE_CHECKING:
...
@@ -78,6 +78,7 @@ if TYPE_CHECKING:
VLLM_ROCM_USE_AITER_RMSNORM
:
bool
=
True
VLLM_ROCM_USE_AITER_RMSNORM
:
bool
=
True
VLLM_ROCM_FP8_PADDING
:
bool
=
True
VLLM_ROCM_FP8_PADDING
:
bool
=
True
VLLM_ROCM_MOE_PADDING
:
bool
=
True
VLLM_ROCM_MOE_PADDING
:
bool
=
True
VLLM_ROCM_CUSTOM_PAGED_ATTN
:
bool
=
True
VLLM_ENABLE_V1_MULTIPROCESSING
:
bool
=
True
VLLM_ENABLE_V1_MULTIPROCESSING
:
bool
=
True
VLLM_LOG_BATCHSIZE_INTERVAL
:
float
=
-
1
VLLM_LOG_BATCHSIZE_INTERVAL
:
float
=
-
1
VLLM_DISABLE_COMPILE_CACHE
:
bool
=
False
VLLM_DISABLE_COMPILE_CACHE
:
bool
=
False
...
@@ -541,6 +542,11 @@ environment_variables: dict[str, Callable[[], Any]] = {
...
@@ -541,6 +542,11 @@ environment_variables: dict[str, Callable[[], Any]] = {
"VLLM_ROCM_MOE_PADDING"
:
"VLLM_ROCM_MOE_PADDING"
:
lambda
:
bool
(
int
(
os
.
getenv
(
"VLLM_ROCM_MOE_PADDING"
,
"1"
))),
lambda
:
bool
(
int
(
os
.
getenv
(
"VLLM_ROCM_MOE_PADDING"
,
"1"
))),
# custom paged attention kernel for MI3* cards
"VLLM_ROCM_CUSTOM_PAGED_ATTN"
:
lambda
:
(
os
.
getenv
(
"VLLM_ROCM_CUSTOM_PAGED_ATTN"
,
"True"
).
lower
()
in
(
"true"
,
"1"
)),
# Divisor for dynamic query scale factor calculation for FP8 KV Cache
# Divisor for dynamic query scale factor calculation for FP8 KV Cache
"Q_SCALE_CONSTANT"
:
"Q_SCALE_CONSTANT"
:
lambda
:
int
(
os
.
getenv
(
"Q_SCALE_CONSTANT"
,
"200"
)),
lambda
:
int
(
os
.
getenv
(
"Q_SCALE_CONSTANT"
,
"200"
)),
...
...
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