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
c01d1c5a
Unverified
Commit
c01d1c5a
authored
Jun 24, 2025
by
Boyuan Feng
Committed by
GitHub
Jun 24, 2025
Browse files
use .dev for version comparison with pytorch nightly release (#20031)
Signed-off-by:
Boyuan Feng
<
boyuan@meta.com
>
parent
ead36984
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
5 deletions
+19
-5
tests/compile/test_config.py
tests/compile/test_config.py
+9
-0
vllm/compilation/backends.py
vllm/compilation/backends.py
+1
-1
vllm/model_executor/layers/quantization/torchao.py
vllm/model_executor/layers/quantization/torchao.py
+2
-2
vllm/utils.py
vllm/utils.py
+7
-2
No files found.
tests/compile/test_config.py
View file @
c01d1c5a
...
@@ -5,6 +5,15 @@ import pytest
...
@@ -5,6 +5,15 @@ import pytest
import
vllm
import
vllm
from
vllm.compilation.counter
import
compilation_counter
from
vllm.compilation.counter
import
compilation_counter
from
vllm.config
import
VllmConfig
from
vllm.config
import
VllmConfig
from
vllm.utils
import
_is_torch_equal_or_newer
def
test_version
():
assert
_is_torch_equal_or_newer
(
'2.8.0.dev20250624+cu128'
,
'2.8.0.dev'
)
assert
_is_torch_equal_or_newer
(
'2.8.0a0+gitc82a174'
,
'2.8.0.dev'
)
assert
_is_torch_equal_or_newer
(
'2.8.0'
,
'2.8.0.dev'
)
assert
_is_torch_equal_or_newer
(
'2.8.1'
,
'2.8.0.dev'
)
assert
not
_is_torch_equal_or_newer
(
'2.7.1'
,
'2.8.0.dev'
)
def
test_use_cudagraphs_dynamic
(
monkeypatch
):
def
test_use_cudagraphs_dynamic
(
monkeypatch
):
...
...
vllm/compilation/backends.py
View file @
c01d1c5a
...
@@ -32,7 +32,7 @@ logger = init_logger(__name__)
...
@@ -32,7 +32,7 @@ logger = init_logger(__name__)
def
make_compiler
(
compilation_config
:
CompilationConfig
)
->
CompilerInterface
:
def
make_compiler
(
compilation_config
:
CompilationConfig
)
->
CompilerInterface
:
if
compilation_config
.
use_inductor
:
if
compilation_config
.
use_inductor
:
if
envs
.
VLLM_USE_STANDALONE_COMPILE
and
is_torch_equal_or_newer
(
if
envs
.
VLLM_USE_STANDALONE_COMPILE
and
is_torch_equal_or_newer
(
"2.8.0
a
"
):
"2.8.0
.dev
"
):
logger
.
debug
(
"Using InductorStandaloneAdaptor"
)
logger
.
debug
(
"Using InductorStandaloneAdaptor"
)
return
InductorStandaloneAdaptor
()
return
InductorStandaloneAdaptor
()
else
:
else
:
...
...
vllm/model_executor/layers/quantization/torchao.py
View file @
c01d1c5a
...
@@ -44,14 +44,14 @@ class TorchAOConfig(QuantizationConfig):
...
@@ -44,14 +44,14 @@ class TorchAOConfig(QuantizationConfig):
"""
"""
# TorchAO quantization relies on tensor subclasses. In order,
# TorchAO quantization relies on tensor subclasses. In order,
# to enable proper caching this needs standalone compile
# to enable proper caching this needs standalone compile
if is_torch_equal_or_newer("2.8.0
a
"):
if is_torch_equal_or_newer("2.8.0
.dev
"):
os.environ["VLLM_TEST_STANDALONE_COMPILE"] = "1"
os.environ["VLLM_TEST_STANDALONE_COMPILE"] = "1"
logger.info(
logger.info(
"Using TorchAO: Setting VLLM_TEST_STANDALONE_COMPILE=1")
"Using TorchAO: Setting VLLM_TEST_STANDALONE_COMPILE=1")
# TODO: remove after the torch dependency is updated to 2.8
# TODO: remove after the torch dependency is updated to 2.8
if is_torch_equal_or_newer(
if is_torch_equal_or_newer(
"2.7.0") and not is_torch_equal_or_newer("2.8.0
a
"):
"2.7.0") and not is_torch_equal_or_newer("2.8.0
.dev
"):
os.environ["VLLM_DISABLE_COMPILE_CACHE"] = "1"
os.environ["VLLM_DISABLE_COMPILE_CACHE"] = "1"
logger.info("Using TorchAO: Setting VLLM_DISABLE_COMPILE_CACHE=1")
logger.info("Using TorchAO: Setting VLLM_DISABLE_COMPILE_CACHE=1")
"""
"""
...
...
vllm/utils.py
View file @
c01d1c5a
...
@@ -2919,8 +2919,13 @@ def is_torch_equal_or_newer(target: str) -> bool:
...
@@ -2919,8 +2919,13 @@ def is_torch_equal_or_newer(target: str) -> bool:
Whether the condition meets.
Whether the condition meets.
"""
"""
try
:
try
:
torch_version
=
version
.
parse
(
str
(
torch
.
__version__
))
return
_is_torch_equal_or_newer
(
str
(
torch
.
__version__
),
target
)
return
torch_version
>=
version
.
parse
(
target
)
except
Exception
:
except
Exception
:
# Fallback to PKG-INFO to load the package info, needed by the doc gen.
# Fallback to PKG-INFO to load the package info, needed by the doc gen.
return
Version
(
importlib
.
metadata
.
version
(
'torch'
))
>=
Version
(
target
)
return
Version
(
importlib
.
metadata
.
version
(
'torch'
))
>=
Version
(
target
)
# Helper function used in testing.
def
_is_torch_equal_or_newer
(
torch_version
:
str
,
target
:
str
)
->
bool
:
torch_version
=
version
.
parse
(
torch_version
)
return
torch_version
>=
version
.
parse
(
target
)
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