[ROCm] Fix AttributeError for torch.compiler.skip_all_guards_unsafe on older PyTorch (#37219)
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
(cherry picked from commit 54a62a79f7)
This commit is contained in:
@@ -112,7 +112,12 @@ class TorchCompileWithNoGuardsWrapper:
|
|||||||
entry.guard_type == "SHAPE_ENV" for entry in x
|
entry.guard_type == "SHAPE_ENV" for entry in x
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
options["guard_filter_fn"] = torch.compiler.skip_all_guards_unsafe
|
if hasattr(torch.compiler, "skip_all_guards_unsafe"):
|
||||||
|
# Torch 2.10+ provides skip_all_guards_unsafe
|
||||||
|
options["guard_filter_fn"] = torch.compiler.skip_all_guards_unsafe
|
||||||
|
else:
|
||||||
|
# Equivalent fallback for older PyTorch: skip all guards
|
||||||
|
options["guard_filter_fn"] = lambda x: [False for _ in x]
|
||||||
|
|
||||||
compiled_ptr: Any = self.forward
|
compiled_ptr: Any = self.forward
|
||||||
# Validate that unbacked dynamic shapes require VLLM_USE_BYTECODE_HOOK=False
|
# Validate that unbacked dynamic shapes require VLLM_USE_BYTECODE_HOOK=False
|
||||||
|
|||||||
Reference in New Issue
Block a user