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
f1cf6eef
"docs/source/api/python/dgl.dataloading.rst" did not exist on "6294677f8acc6bc040baf922910473e1c82995ba"
Unverified
Commit
f1cf6eef
authored
Mar 13, 2025
by
Chen Shengzhi
Committed by
GitHub
Mar 12, 2025
Browse files
[Fix] Check the device backend before calling empty_cache function (#4212)
parent
0a59a465
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
python/sglang/srt/distributed/parallel_state.py
python/sglang/srt/distributed/parallel_state.py
+10
-1
No files found.
python/sglang/srt/distributed/parallel_state.py
View file @
f1cf6eef
...
...
@@ -1228,7 +1228,16 @@ def cleanup_dist_env_and_memory(shutdown_ray: bool = False):
ray
.
shutdown
()
gc
.
collect
()
if
not
current_platform
.
is_cpu
():
torch
.
cuda
.
empty_cache
()
if
hasattr
(
torch
,
"cuda"
)
and
torch
.
cuda
.
is_available
():
torch
.
cuda
.
empty_cache
()
if
hasattr
(
torch
.
_C
,
"_host_emptyCache"
):
torch
.
_C
.
_host_emptyCache
()
else
:
logger
.
warning
(
"torch._C._host_emptyCache() only available in Pytorch >=2.5"
)
elif
hasattr
(
torch
,
"xpu"
)
and
torch
.
xpu
.
is_available
():
torch
.
xpu
.
empty_cache
()
def
in_the_same_node_as
(
pg
:
ProcessGroup
,
source_rank
:
int
=
0
)
->
List
[
bool
]:
...
...
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