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
2b84890b
"ssh:/git@developer.sourcefind.cn:2222/OpenDAS/vllm_cscc.git" did not exist on "ff578cae54d23812b53b6c9b94b8bd0bb293a1fe"
Commit
2b84890b
authored
Sep 11, 2025
by
zhuwenwen
Browse files
update fa interface
parent
9c663e50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
16 deletions
+34
-16
vllm/attention/backends/dual_chunk_flash_attn.py
vllm/attention/backends/dual_chunk_flash_attn.py
+34
-16
No files found.
vllm/attention/backends/dual_chunk_flash_attn.py
View file @
2b84890b
...
@@ -1215,22 +1215,40 @@ class DualChunkFlashAttentionImpl(FlashAttentionImpl):
...
@@ -1215,22 +1215,40 @@ class DualChunkFlashAttentionImpl(FlashAttentionImpl):
s_lse
=
s_lse
.
view
(
q_len
,
q_heads
,
1
).
transpose
(
0
,
2
).
float
()
s_lse
=
s_lse
.
view
(
q_len
,
q_heads
,
1
).
transpose
(
0
,
2
).
float
()
return
res
,
s_lse
return
res
,
s_lse
output
,
softmax_lse
=
flash_attn_varlen_func
(
if
not
current_platform
.
is_rocm
():
q
=
query_states
,
output
,
softmax_lse
=
flash_attn_varlen_func
(
k
=
key_states
,
q
=
query_states
,
v
=
value_states
,
k
=
key_states
,
softmax_scale
=
softmax_scale
,
v
=
value_states
,
cu_seqlens_q
=
torch
.
tensor
([
0
,
query_states
.
shape
[
0
]],
softmax_scale
=
softmax_scale
,
dtype
=
torch
.
int32
,
cu_seqlens_q
=
torch
.
tensor
([
0
,
query_states
.
shape
[
0
]],
device
=
query_states
.
device
),
dtype
=
torch
.
int32
,
max_seqlen_q
=
query_states
.
shape
[
0
],
device
=
query_states
.
device
),
cu_seqlens_k
=
torch
.
tensor
([
0
,
max_seqlen_k
],
max_seqlen_q
=
query_states
.
shape
[
0
],
dtype
=
torch
.
int32
,
cu_seqlens_k
=
torch
.
tensor
([
0
,
max_seqlen_k
],
device
=
query_states
.
device
),
dtype
=
torch
.
int32
,
max_seqlen_k
=
max_seqlen_k
,
device
=
query_states
.
device
),
causal
=
causal
,
max_seqlen_k
=
max_seqlen_k
,
return_softmax_lse
=
True
,
causal
=
causal
,
)
return_softmax_lse
=
True
,
)
else
:
output
,
softmax_lse
=
flash_attn_varlen_func
(
q
=
query_states
,
k
=
key_states
,
v
=
value_states
,
softmax_scale
=
softmax_scale
,
cu_seqlens_q
=
torch
.
tensor
([
0
,
query_states
.
shape
[
0
]],
dtype
=
torch
.
int32
,
device
=
query_states
.
device
),
max_seqlen_q
=
query_states
.
shape
[
0
],
cu_seqlens_k
=
torch
.
tensor
([
0
,
max_seqlen_k
],
dtype
=
torch
.
int32
,
device
=
query_states
.
device
),
max_seqlen_k
=
max_seqlen_k
,
causal
=
causal
,
return_attn_probs
=
True
,
)
softmax_lse
=
softmax_lse
.
view
(
q_len
,
q_heads
,
1
).
transpose
(
0
,
softmax_lse
=
softmax_lse
.
view
(
q_len
,
q_heads
,
1
).
transpose
(
0
,
2
).
float
()
2
).
float
()
return
output
,
softmax_lse
return
output
,
softmax_lse
...
...
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