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
a1e5d781
Unverified
Commit
a1e5d781
authored
Sep 02, 2025
by
Xiaoyu Zhang
Committed by
GitHub
Sep 02, 2025
Browse files
fix parallel_state.py `current_platform` bug (#9919)
parent
b7361cc4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
python/sglang/srt/distributed/parallel_state.py
python/sglang/srt/distributed/parallel_state.py
+3
-1
No files found.
python/sglang/srt/distributed/parallel_state.py
View file @
a1e5d781
...
@@ -43,6 +43,7 @@ from sglang.srt.utils import (
...
@@ -43,6 +43,7 @@ from sglang.srt.utils import (
direct_register_custom_op
,
direct_register_custom_op
,
get_bool_env_var
,
get_bool_env_var
,
get_int_env_var
,
get_int_env_var
,
is_cpu
,
is_cuda_alike
,
is_cuda_alike
,
is_hip
,
is_hip
,
is_npu
,
is_npu
,
...
@@ -51,6 +52,7 @@ from sglang.srt.utils import (
...
@@ -51,6 +52,7 @@ from sglang.srt.utils import (
)
)
_is_npu
=
is_npu
()
_is_npu
=
is_npu
()
_is_cpu
=
is_cpu
()
IS_ONE_DEVICE_PER_PROCESS
=
get_bool_env_var
(
"SGLANG_ONE_DEVICE_PER_PROCESS"
)
IS_ONE_DEVICE_PER_PROCESS
=
get_bool_env_var
(
"SGLANG_ONE_DEVICE_PER_PROCESS"
)
...
@@ -1643,7 +1645,7 @@ def cleanup_dist_env_and_memory(shutdown_ray: bool = False):
...
@@ -1643,7 +1645,7 @@ def cleanup_dist_env_and_memory(shutdown_ray: bool = False):
ray
.
shutdown
()
ray
.
shutdown
()
gc
.
collect
()
gc
.
collect
()
if
not
current_platform
.
is_cpu
()
:
if
not
_
is_cpu
:
if
hasattr
(
torch
,
"cuda"
)
and
torch
.
cuda
.
is_available
():
if
hasattr
(
torch
,
"cuda"
)
and
torch
.
cuda
.
is_available
():
torch
.
cuda
.
empty_cache
()
torch
.
cuda
.
empty_cache
()
if
hasattr
(
torch
.
_C
,
"_host_emptyCache"
):
if
hasattr
(
torch
.
_C
,
"_host_emptyCache"
):
...
...
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