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
62920e37
Commit
62920e37
authored
Apr 29, 2025
by
zhuwenwen
Browse files
add triton_key
parent
abf008ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
vllm/attention/backends/rocm_flash_attn.py
vllm/attention/backends/rocm_flash_attn.py
+4
-1
No files found.
vllm/attention/backends/rocm_flash_attn.py
View file @
62920e37
...
@@ -5,6 +5,8 @@ from dataclasses import dataclass
...
@@ -5,6 +5,8 @@ from dataclasses import dataclass
from
typing
import
TYPE_CHECKING
,
Any
,
Dict
,
List
,
Optional
,
Tuple
,
Type
from
typing
import
TYPE_CHECKING
,
Any
,
Dict
,
List
,
Optional
,
Tuple
,
Type
import
torch
import
torch
import
triton
from
triton.compiler.compiler
import
triton_key
import
vllm.envs
as
envs
import
vllm.envs
as
envs
from
vllm
import
_custom_ops
as
ops
from
vllm
import
_custom_ops
as
ops
...
@@ -30,7 +32,7 @@ _ON_NAVI = "gfx1" in _GPU_ARCH
...
@@ -30,7 +32,7 @@ _ON_NAVI = "gfx1" in _GPU_ARCH
_ON_MI250_MI300
=
any
(
arch
in
_GPU_ARCH
_ON_MI250_MI300
=
any
(
arch
in
_GPU_ARCH
for
arch
in
[
"gfx90a"
,
"gfx940"
,
"gfx941"
,
"gfx942"
])
for
arch
in
[
"gfx90a"
,
"gfx940"
,
"gfx941"
,
"gfx942"
])
class
ROCmFlashAttentionBackend
(
AttentionBackend
):
class
ROCmFlashAttentionBackend
(
AttentionBackend
):
@
staticmethod
@
staticmethod
...
@@ -778,6 +780,7 @@ class ROCmFlashAttentionImpl(AttentionImpl):
...
@@ -778,6 +780,7 @@ class ROCmFlashAttentionImpl(AttentionImpl):
else
:
else
:
# prefix-enabled attention
# prefix-enabled attention
# not applicable for encoder-only models
# not applicable for encoder-only models
version_key
=
triton_key
()
if
self
.
attn_type
!=
AttentionType
.
ENCODER_ONLY
:
if
self
.
attn_type
!=
AttentionType
.
ENCODER_ONLY
:
output
[:
output
[:
num_prefill_tokens
]
=
PagedAttention
.
forward_prefix
(
num_prefill_tokens
]
=
PagedAttention
.
forward_prefix
(
...
...
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