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
5f2595be
Unverified
Commit
5f2595be
authored
Dec 15, 2024
by
Yineng Zhang
Committed by
GitHub
Dec 15, 2024
Browse files
hotfix: checking for HIP (#2485)
parent
0ba2c589
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
8 deletions
+2
-8
python/sglang/srt/layers/fused_moe_triton/layer.py
python/sglang/srt/layers/fused_moe_triton/layer.py
+1
-1
python/sglang/srt/utils.py
python/sglang/srt/utils.py
+1
-7
No files found.
python/sglang/srt/layers/fused_moe_triton/layer.py
View file @
5f2595be
...
...
@@ -19,7 +19,7 @@ from sglang.srt.layers.quantization.base_config import (
)
from
sglang.srt.utils
import
set_weight_attrs
if
torch
.
cuda
.
is_available
()
or
torch
.
hip
.
is_available
()
:
if
torch
.
cuda
.
is_available
():
from
sglang.srt.layers.fused_moe_triton.fused_moe
import
fused_experts
else
:
fused_experts
=
None
# type: ignore
...
...
python/sglang/srt/utils.py
View file @
5f2595be
...
...
@@ -92,7 +92,7 @@ def is_flashinfer_available():
"""
if
not
get_bool_env_var
(
"SGLANG_IS_FLASHINFER_AVAILABLE"
,
default
=
"true"
):
return
False
return
torch
.
cuda
.
is_available
()
and
not
is_hip
()
return
torch
.
cuda
.
is_available
()
and
torch
.
version
.
cuda
def
is_ipv6
(
address
):
...
...
@@ -1071,9 +1071,6 @@ def get_device_name(device_id: int = 0) -> str:
if
hasattr
(
torch
,
"cuda"
)
and
torch
.
cuda
.
is_available
():
return
torch
.
cuda
.
get_device_name
(
device_id
)
if
hasattr
(
torch
,
"hip"
)
and
torch
.
hip
.
is_available
():
return
torch
.
hip
.
get_device_name
(
device_id
)
if
hasattr
(
torch
,
"xpu"
)
and
torch
.
xpu
.
is_available
():
return
torch
.
xpu
.
get_device_name
(
device_id
)
...
...
@@ -1086,9 +1083,6 @@ def get_device_capability(device_id: int = 0) -> Tuple[int, int]:
if
hasattr
(
torch
,
"cuda"
)
and
torch
.
cuda
.
is_available
():
major
,
minor
=
torch
.
cuda
.
get_device_capability
(
device_id
)
if
hasattr
(
torch
,
"hip"
)
and
torch
.
hip
.
is_available
():
major
,
minor
=
torch
.
cuda
.
get_device_capability
(
device_id
)
if
hasattr
(
torch
,
"xpu"
)
and
torch
.
xpu
.
is_available
():
major
,
minor
,
*
_
=
torch
.
xpu
.
get_device_capability
(
device_id
)[
"version"
].
split
(
"."
...
...
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