mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[dynamo, 3.13t] raise error if torch.compile is attempted in 3.13t (nogil) (#143404)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/143404 Approved by: https://github.com/colesbury, https://github.com/atalman
This commit is contained in:
committed by
PyTorch MergeBot
parent
33c27be017
commit
e1e83015d2
@ -2494,6 +2494,8 @@ def compile(
|
||||
_C._log_api_usage_once("torch.compile")
|
||||
if sys.version_info >= (3, 14):
|
||||
raise RuntimeError("Dynamo is not supported on Python 3.14+")
|
||||
elif sys.version_info >= (3, 13) and not sys._is_gil_enabled():
|
||||
raise RuntimeError("Dynamo is not supported on Python with GIL disabled")
|
||||
|
||||
# Decorator mode
|
||||
if model is None:
|
||||
|
@ -809,6 +809,8 @@ class _NullDecorator(contextlib.nullcontext): # type: ignore[type-arg]
|
||||
def check_if_dynamo_supported():
|
||||
if sys.version_info >= (3, 14):
|
||||
raise RuntimeError("Python 3.14+ not yet supported for torch.compile")
|
||||
elif sys.version_info >= (3, 13) and not sys._is_gil_enabled():
|
||||
raise RuntimeError("Dynamo is not supported on Python with GIL disabled")
|
||||
|
||||
|
||||
def is_dynamo_supported():
|
||||
|
Reference in New Issue
Block a user