[torch.compile] Allow usage of Opaque Objects in PyTorch 2.11 (#39286)

Signed-off-by: Richard Zou <zou3519@gmail.com>
This commit is contained in:
Richard Zou
2026-04-08 23:21:10 +00:00
committed by GitHub
parent f3c7941ec8
commit ba4a78eb5d
5 changed files with 69 additions and 45 deletions
+7
View File
@@ -143,6 +143,13 @@ class TorchCompileWithNoGuardsWrapper:
compiled_ptr = self.check_invariants_and_forward
# Apply the constrain_to_fx_strides patch before first compilation.
# This covers STOCK_TORCH_COMPILE and DYNAMO_ONCE paths. The VLLM
# compile paths call this from their own compile() methods too.
from vllm.env_override import _apply_constrain_to_fx_strides_patch
_apply_constrain_to_fx_strides_patch()
aot_context = nullcontext()
if envs.VLLM_USE_AOT_COMPILE:
if hasattr(torch._dynamo.config, "enable_aot_compile"):