Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
7058d7dd
Unverified
Commit
7058d7dd
authored
Jul 01, 2025
by
Wentao Ye
Committed by
GitHub
Jul 01, 2025
Browse files
[Refactor] Remove duplicate `find_free_port` (#20333)
Signed-off-by:
yewentao256
<
zhyanwentao@126.com
>
parent
a0389e05
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
11 deletions
+2
-11
tests/kernels/moe/utils.py
tests/kernels/moe/utils.py
+2
-2
vllm/model_executor/layers/fused_moe/utils.py
vllm/model_executor/layers/fused_moe/utils.py
+0
-9
No files found.
tests/kernels/moe/utils.py
View file @
7058d7dd
...
@@ -14,7 +14,7 @@ from torch.multiprocessing import (
...
@@ -14,7 +14,7 @@ from torch.multiprocessing import (
spawn
)
# pyright: ignore[reportPrivateImportUsage]
spawn
)
# pyright: ignore[reportPrivateImportUsage]
from
typing_extensions
import
Concatenate
,
ParamSpec
from
typing_extensions
import
Concatenate
,
ParamSpec
from
vllm.
model_executor.layers.fused_moe.
utils
import
find_free
_port
from
vllm.utils
import
get_open
_port
has_deep_ep
=
importlib
.
util
.
find_spec
(
"deep_ep"
)
is
not
None
has_deep_ep
=
importlib
.
util
.
find_spec
(
"deep_ep"
)
is
not
None
if
has_deep_ep
:
if
has_deep_ep
:
...
@@ -95,7 +95,7 @@ def parallel_launch(
...
@@ -95,7 +95,7 @@ def parallel_launch(
world_size
,
world_size
,
world_size
,
world_size
,
0
,
0
,
f
"tcp://
{
os
.
getenv
(
'LOCALHOST'
,
'localhost'
)
}
:
{
find_free
_port
()
}
"
,
f
"tcp://
{
os
.
getenv
(
'LOCALHOST'
,
'localhost'
)
}
:
{
get_open
_port
()
}
"
,
worker
,
worker
,
)
+
args
,
)
+
args
,
nprocs
=
world_size
,
nprocs
=
world_size
,
...
...
vllm/model_executor/layers/fused_moe/utils.py
View file @
7058d7dd
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import
socket
from
contextlib
import
closing
from
math
import
prod
from
math
import
prod
from
typing
import
Optional
from
typing
import
Optional
...
@@ -98,10 +96,3 @@ def _fp8_perm(m: torch.Tensor, idx: torch.Tensor) -> torch.Tensor:
...
@@ -98,10 +96,3 @@ def _fp8_perm(m: torch.Tensor, idx: torch.Tensor) -> torch.Tensor:
return
m
.
view
(
dtype
=
torch
.
uint8
)[
idx
,
...].
view
(
dtype
=
m
.
dtype
)
return
m
.
view
(
dtype
=
torch
.
uint8
)[
idx
,
...].
view
(
dtype
=
m
.
dtype
)
else
:
else
:
return
m
[
idx
,
...]
return
m
[
idx
,
...]
def
find_free_port
():
with
closing
(
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
))
as
s
:
s
.
bind
((
''
,
0
))
s
.
setsockopt
(
socket
.
SOL_SOCKET
,
socket
.
SO_REUSEADDR
,
1
)
return
s
.
getsockname
()[
1
]
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