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
a521ef06
Unverified
Commit
a521ef06
authored
May 29, 2025
by
Richard Zou
Committed by
GitHub
May 30, 2025
Browse files
Use standalone_compile by default in torch >= 2.8.0 (#18846)
Signed-off-by:
rzou
<
zou3519@gmail.com
>
parent
64eaf5fe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
vllm/compilation/backends.py
vllm/compilation/backends.py
+3
-2
vllm/compilation/compiler_interface.py
vllm/compilation/compiler_interface.py
+1
-1
vllm/envs.py
vllm/envs.py
+8
-6
No files found.
vllm/compilation/backends.py
View file @
a521ef06
...
...
@@ -16,7 +16,7 @@ import vllm.envs as envs
from
vllm.config
import
CompilationConfig
,
VllmConfig
from
vllm.logger
import
init_logger
from
vllm.platforms
import
current_platform
from
vllm.utils
import
resolve_obj_by_qualname
from
vllm.utils
import
is_torch_equal_or_newer
,
resolve_obj_by_qualname
from
.compiler_interface
import
(
CompilerInterface
,
EagerAdaptor
,
InductorAdaptor
,
InductorStandaloneAdaptor
)
...
...
@@ -29,7 +29,8 @@ logger = init_logger(__name__)
def
make_compiler
(
compilation_config
:
CompilationConfig
)
->
CompilerInterface
:
if
compilation_config
.
use_inductor
:
if
envs
.
VLLM_TEST_STANDALONE_COMPILE
:
if
envs
.
VLLM_USE_STANDALONE_COMPILE
and
is_torch_equal_or_newer
(
"2.8.0"
):
logger
.
info
(
"Using InductorStandaloneAdaptor"
)
return
InductorStandaloneAdaptor
()
else
:
...
...
vllm/compilation/compiler_interface.py
View file @
a521ef06
...
...
@@ -155,7 +155,7 @@ class InductorStandaloneAdaptor(CompilerInterface):
This is not on by default yet, but we plan to turn it on by default for
PyTorch 2.8.
Use VLLM_
TEST
_STANDALONE_COMPILE to toggle this on or off.
Use VLLM_
USE
_STANDALONE_COMPILE to toggle this on or off.
"""
name
=
"inductor_standalone"
...
...
vllm/envs.py
View file @
a521ef06
...
...
@@ -143,10 +143,10 @@ def maybe_convert_int(value: Optional[str]) -> Optional[int]:
def
get_vllm_port
()
->
Optional
[
int
]:
"""Get the port from VLLM_PORT environment variable.
Returns:
The port number as an integer if VLLM_PORT is set, None otherwise.
Raises:
ValueError: If VLLM_PORT is a URI, suggest k8s service discovery issue.
"""
...
...
@@ -308,9 +308,11 @@ environment_variables: dict[str, Callable[[], Any]] = {
lambda
:
bool
(
os
.
environ
.
get
(
"VLLM_TEST_DYNAMO_FULLGRAPH_CAPTURE"
,
"1"
)
!=
"0"
),
# Internal flag to enable/disable Inductor standalone compile
"VLLM_TEST_STANDALONE_COMPILE"
:
lambda
:
os
.
environ
.
get
(
"VLLM_TEST_STANDALONE_COMPILE"
,
"0"
)
!=
"0"
,
# Feature flag to enable/disable Inductor standalone compile.
# In torch <= 2.7 we ignore this flag; in torch >= 2.8 this is
# enabled by default.
"VLLM_USE_STANDALONE_COMPILE"
:
lambda
:
os
.
environ
.
get
(
"VLLM_USE_STANDALONE_COMPILE"
,
"1"
)
==
"1"
,
# local rank of the process in the distributed setting, used to determine
# the GPU device id
...
...
@@ -892,7 +894,7 @@ def compute_hash() -> str:
"VLLM_USE_TRITON_AWQ"
,
"VLLM_DP_RANK"
,
"VLLM_DP_SIZE"
,
"VLLM_
TEST
_STANDALONE_COMPILE"
,
"VLLM_
USE
_STANDALONE_COMPILE"
,
]
for
key
in
environment_variables_to_hash
:
if
key
in
environment_variables
:
...
...
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