@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / f569c654e1
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 11, 12:30 UTC

enable unbacked with aot_compile (#30462)

Signed-off-by: Laith Sakka <lsakka@meta.com>

Laith Sakka committed Dec 14, 2025 at 11:14 UTC f569c654e14b19a0725788fadcb6a4ac045e50fe
2 files changed +8 -10
tests/compile/test_dynamic_shapes_compilation.py
+8 -2
@@ -36,7 +36,7 @@ def get_test_models():
36 DynamicShapesType.BACKED_SIZE_OBLIVIOUS,
37 ],
38 )
39 -@pytest.mark.parametrize("use_aot_compile", ["0"])
39 +@pytest.mark.parametrize("use_aot_compile", ["0", "1"])
40 @pytest.mark.parametrize("use_bytecode_hook", [True, False])
41 @pytest.mark.parametrize("evaluate_guards", [False, True])
42 @pytest.mark.skipif(
@@ -54,6 +54,12 @@ def test_dynamic_shapes_compilation(
54 if use_bytecode_hook and shapes_type == DynamicShapesType.UNBACKED:
55 pytest.skip("UNBACKED dynamic shapes require VLLM_USE_BYTECODE_HOOK=0")
56
57 + if evaluate_guards and shapes_type == DynamicShapesType.UNBACKED:
58 + pytest.skip("unbacked dynamic shapes do not add guards")
59 +
60 + if evaluate_guards and use_aot_compile:
61 + pytest.skip("evaluate_guards requires use_aot_compile=0")
62 +
63 monkeypatch.setenv("VLLM_USE_AOT_COMPILE", use_aot_compile)
64 monkeypatch.setenv("VLLM_USE_BYTECODE_HOOK", "1" if use_bytecode_hook else "0")
65
@@ -120,7 +126,7 @@ def test_model_specialization_with_evaluate_guards(
126 and dynamic_shapes_type == DynamicShapesType.BACKED
127 and evaluate_guards
128 ):
123 - pytest.skip("evaluate_guards for backed does not work with aot_compile =1")
129 + pytest.skip("evaluate_guards for backed does not work with aot_compile=1")
130
131 @support_torch_compile
132 class ModelWithSizeCheck(torch.nn.Module):
vllm/compilation/decorators.py
-8
@@ -390,14 +390,6 @@ def _support_torch_compile(
390 serialized backend artifacts), then we need to generate a new AOT
391 compile artifact from scratch.
392 """
393 - # Validate that AOT compile is not used with unbacked dynamic
394 - # shapes. aot_compile re-allocates backed symbols post dynamo!
395 - if ds_type == DynamicShapesType.UNBACKED:
396 - raise ValueError(
397 - "AOT compilation is not compatible with UNBACKED dynamic shapes. "
398 - "Please use BACKED or BACKED_SIZE_OBLIVIOUS dynamic shapes type "
399 - "when VLLM_USE_AOT_COMPILE is enabled."
400 - )
393 from .caching import compilation_config_hash_factors
394
395 factors: list[str] = compilation_config_hash_factors(self.vllm_config)