Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
xuwx1
LightX2V
Commits
1c4bd4d8
Commit
1c4bd4d8
authored
Apr 14, 2025
by
helloyongyang
Browse files
fix sage_attn2 cu_seqlens_kv
parent
83c12f2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
lightx2v/attentions/common/sage_attn2.py
lightx2v/attentions/common/sage_attn2.py
+2
-2
No files found.
lightx2v/attentions/common/sage_attn2.py
View file @
1c4bd4d8
...
...
@@ -22,7 +22,7 @@ def sage_attn2(q, k, v, cu_seqlens_q=None, cu_seqlens_kv=None, max_seqlen_q=None
if
model_cls
==
"hunyuan"
:
x1
=
sageattn
(
q
[:,
:
cu_seqlens_q
[
1
],
:].
unsqueeze
(
0
),
k
[:,
:
cu_seqlens_
q
[
1
],
:].
unsqueeze
(
0
),
k
[:,
:
cu_seqlens_
kv
[
1
],
:].
unsqueeze
(
0
),
v
[:,
:
cu_seqlens_kv
[
1
],
:].
unsqueeze
(
0
),
)
x2
=
sageattn
(
...
...
@@ -36,7 +36,7 @@ def sage_attn2(q, k, v, cu_seqlens_q=None, cu_seqlens_kv=None, max_seqlen_q=None
x
=
(
sageattn
(
q
[:,
:
cu_seqlens_q
[
1
],
:].
unsqueeze
(
0
),
k
[:,
:
cu_seqlens_
q
[
1
],
:].
unsqueeze
(
0
),
k
[:,
:
cu_seqlens_
kv
[
1
],
:].
unsqueeze
(
0
),
v
[:,
:
cu_seqlens_kv
[
1
],
:].
unsqueeze
(
0
),
)
.
transpose
(
2
,
1
)
...
...
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