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
5ec2f551
Commit
5ec2f551
authored
Jul 10, 2025
by
wangshankun
Browse files
fix bug:flashinfer version compatibility
parent
6ac3cee7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
lightx2v/attentions/common/radial_attn.py
lightx2v/attentions/common/radial_attn.py
+10
-1
No files found.
lightx2v/attentions/common/radial_attn.py
View file @
5ec2f551
...
...
@@ -2,6 +2,10 @@ import torch
try
:
import
flashinfer
from
packaging
import
version
flashinfer_version
=
version
.
parse
(
flashinfer
.
__version__
)
has_o_dtype
=
flashinfer_version
>=
version
.
parse
(
"0.2.6.post1"
)
except
ImportError
:
flashinfer
=
None
...
...
@@ -29,7 +33,8 @@ def radial_attn(
indptr
=
get_indptr_from_mask
(
mask
,
query
)
indices
=
get_indices_from_mask
(
mask
,
query
)
bsr_wrapper
.
plan
(
kwargs
=
dict
(
indptr
=
indptr
,
indices
=
indices
,
M
=
seqlen
,
...
...
@@ -43,6 +48,10 @@ def radial_attn(
kv_data_type
=
key
.
dtype
,
use_fp16_qk_reduction
=
True
,
)
if
has_o_dtype
:
kwargs
[
"o_data_type"
]
=
query
.
dtype
bsr_wrapper
.
plan
(
**
kwargs
)
o
=
bsr_wrapper
.
run
(
query
,
key
,
value
)
...
...
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