enable unbacked with aot_compile (#30462)
Signed-off-by: Laith Sakka <lsakka@meta.com>
This commit is contained in:
@@ -36,7 +36,7 @@ def get_test_models():
|
|||||||
DynamicShapesType.BACKED_SIZE_OBLIVIOUS,
|
DynamicShapesType.BACKED_SIZE_OBLIVIOUS,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
@pytest.mark.parametrize("use_aot_compile", ["0"])
|
@pytest.mark.parametrize("use_aot_compile", ["0", "1"])
|
||||||
@pytest.mark.parametrize("use_bytecode_hook", [True, False])
|
@pytest.mark.parametrize("use_bytecode_hook", [True, False])
|
||||||
@pytest.mark.parametrize("evaluate_guards", [False, True])
|
@pytest.mark.parametrize("evaluate_guards", [False, True])
|
||||||
@pytest.mark.skipif(
|
@pytest.mark.skipif(
|
||||||
@@ -54,6 +54,12 @@ def test_dynamic_shapes_compilation(
|
|||||||
if use_bytecode_hook and shapes_type == DynamicShapesType.UNBACKED:
|
if use_bytecode_hook and shapes_type == DynamicShapesType.UNBACKED:
|
||||||
pytest.skip("UNBACKED dynamic shapes require VLLM_USE_BYTECODE_HOOK=0")
|
pytest.skip("UNBACKED dynamic shapes require VLLM_USE_BYTECODE_HOOK=0")
|
||||||
|
|
||||||
|
if evaluate_guards and shapes_type == DynamicShapesType.UNBACKED:
|
||||||
|
pytest.skip("unbacked dynamic shapes do not add guards")
|
||||||
|
|
||||||
|
if evaluate_guards and use_aot_compile:
|
||||||
|
pytest.skip("evaluate_guards requires use_aot_compile=0")
|
||||||
|
|
||||||
monkeypatch.setenv("VLLM_USE_AOT_COMPILE", use_aot_compile)
|
monkeypatch.setenv("VLLM_USE_AOT_COMPILE", use_aot_compile)
|
||||||
monkeypatch.setenv("VLLM_USE_BYTECODE_HOOK", "1" if use_bytecode_hook else "0")
|
monkeypatch.setenv("VLLM_USE_BYTECODE_HOOK", "1" if use_bytecode_hook else "0")
|
||||||
|
|
||||||
|
|||||||
@@ -390,14 +390,6 @@ def _support_torch_compile(
|
|||||||
serialized backend artifacts), then we need to generate a new AOT
|
serialized backend artifacts), then we need to generate a new AOT
|
||||||
compile artifact from scratch.
|
compile artifact from scratch.
|
||||||
"""
|
"""
|
||||||
# Validate that AOT compile is not used with unbacked dynamic
|
|
||||||
# shapes. aot_compile re-allocates backed symbols post dynamo!
|
|
||||||
if ds_type == DynamicShapesType.UNBACKED:
|
|
||||||
raise ValueError(
|
|
||||||
"AOT compilation is not compatible with UNBACKED dynamic shapes. "
|
|
||||||
"Please use BACKED or BACKED_SIZE_OBLIVIOUS dynamic shapes type "
|
|
||||||
"when VLLM_USE_AOT_COMPILE is enabled."
|
|
||||||
)
|
|
||||||
from .caching import compilation_config_hash_factors
|
from .caching import compilation_config_hash_factors
|
||||||
|
|
||||||
factors: list[str] = compilation_config_hash_factors(self.vllm_config)
|
factors: list[str] = compilation_config_hash_factors(self.vllm_config)
|
||||||
|
|||||||
Reference in New Issue
Block a user