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
zhaoyu6
sglang
Commits
ca63f075
Unverified
Commit
ca63f075
authored
Sep 15, 2025
by
fzyzcjy
Committed by
GitHub
Sep 14, 2025
Browse files
Revert "Fix FA4 import cause moe_fused_gate output be illegal memory" (#10432)
parent
f9ee6ae1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
sgl-kernel/python/sgl_kernel/flash_attn.py
sgl-kernel/python/sgl_kernel/flash_attn.py
+8
-2
No files found.
sgl-kernel/python/sgl_kernel/flash_attn.py
View file @
ca63f075
...
@@ -9,6 +9,11 @@ try:
...
@@ -9,6 +9,11 @@ try:
except
:
except
:
raise
ImportError
(
"Can not import sgl_kernel. Please check your installation."
)
raise
ImportError
(
"Can not import sgl_kernel. Please check your installation."
)
try
:
from
._fa4_interface
import
flash_attn_varlen_func
as
flash_attn_varlen_func_v4
except
ImportError
:
flash_attn_varlen_func_v4
=
None
@
lru_cache
(
maxsize
=
1
)
@
lru_cache
(
maxsize
=
1
)
def
is_fa3_supported
(
device
=
None
)
->
bool
:
def
is_fa3_supported
(
device
=
None
)
->
bool
:
...
@@ -244,8 +249,9 @@ def flash_attn_varlen_func(
...
@@ -244,8 +249,9 @@ def flash_attn_varlen_func(
ver
=
3
,
ver
=
3
,
):
):
if
ver
==
4
:
if
ver
==
4
:
from
._fa4_interface
import
flash_attn_varlen_func
as
flash_attn_varlen_func_v4
assert
(
flash_attn_varlen_func_v4
is
not
None
),
"FA4 is not available, please check your installation."
# Using `(-1, -1)` as no sliding window causes correctness issues for FA4.
# Using `(-1, -1)` as no sliding window causes correctness issues for FA4.
if
window_size
==
(
-
1
,
-
1
):
if
window_size
==
(
-
1
,
-
1
):
window_size
=
(
None
,
None
)
window_size
=
(
None
,
None
)
...
...
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