mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00: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:
parent
33c27be017
commit
e1e83015d2
2 changed files with 4 additions and 0 deletions
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Reference in a new issue