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
change
sglang
Commits
a8ba3279
Unverified
Commit
a8ba3279
authored
Oct 20, 2025
by
fzyzcjy
Committed by
GitHub
Oct 20, 2025
Browse files
Fix triton_kernels import error on some hardwares (#11831)
parent
3b80232d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
4 deletions
+1
-4
python/sglang/srt/layers/quantization/unquant.py
python/sglang/srt/layers/quantization/unquant.py
+1
-4
No files found.
python/sglang/srt/layers/quantization/unquant.py
View file @
a8ba3279
from
__future__
import
annotations
from
__future__
import
annotations
import
importlib.util
from
typing
import
TYPE_CHECKING
,
List
,
Optional
from
typing
import
TYPE_CHECKING
,
List
,
Optional
import
torch
import
torch
...
@@ -31,8 +30,6 @@ if TYPE_CHECKING:
...
@@ -31,8 +30,6 @@ if TYPE_CHECKING:
StandardDispatchOutput
,
StandardDispatchOutput
,
)
)
has_triton_kernels
=
importlib
.
util
.
find_spec
(
"triton_kernels"
)
is
not
None
_is_cpu_amx_available
=
cpu_has_amx_support
()
_is_cpu_amx_available
=
cpu_has_amx_support
()
_is_hip
=
is_hip
()
_is_hip
=
is_hip
()
...
@@ -143,7 +140,7 @@ class UnquantizedFusedMoEMethod(FusedMoEMethodBase, CustomOp):
...
@@ -143,7 +140,7 @@ class UnquantizedFusedMoEMethod(FusedMoEMethodBase, CustomOp):
self
.
triton_kernel_moe_forward
=
None
self
.
triton_kernel_moe_forward
=
None
self
.
triton_kernel_moe_with_bias_forward
=
None
self
.
triton_kernel_moe_with_bias_forward
=
None
if
torch
.
cuda
.
is_available
()
and
has
_triton_kernels
:
if
torch
.
cuda
.
is_available
()
and
use
_triton_kernels
:
from
sglang.srt.layers.moe.fused_moe_triton.triton_kernels_moe
import
(
from
sglang.srt.layers.moe.fused_moe_triton.triton_kernels_moe
import
(
triton_kernel_moe_forward
as
_tk_forward
,
triton_kernel_moe_forward
as
_tk_forward
,
)
)
...
...
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