From b611fb01e251e978cc62f5dd4e2ed50df4cb0a48 Mon Sep 17 00:00:00 2001 From: atalman Date: Thu, 23 Jan 2025 15:31:10 -0800 Subject: [PATCH 1/2] Fix vision torch.compile test --- test/smoke_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/smoke_test.py b/test/smoke_test.py index 38f0054e6b6..1bba1892fdd 100644 --- a/test/smoke_test.py +++ b/test/smoke_test.py @@ -2,6 +2,7 @@ import os import sys +import sysconfig from pathlib import Path import torch @@ -134,8 +135,8 @@ def main() -> None: smoke_test_torchvision_decode_jpeg("cuda") smoke_test_torchvision_resnet50_classify("cuda") - # TODO: remove once pytorch/pytorch#110436 is resolved - if sys.version_info < (3, 12, 0): + # torch.compile is not supported on Python 3.14+ and Python built with GIL disabled + if sys.version_info < (3, 14, 0) and sysconfig.get_config_var("Py_GIL_DISABLED") == 0: smoke_test_compile() if torch.backends.mps.is_available(): From a3263c12e1d17197bf710a98ac207f0b8bfded86 Mon Sep 17 00:00:00 2001 From: atalman Date: Thu, 23 Jan 2025 15:39:56 -0800 Subject: [PATCH 2/2] fix_logic --- test/smoke_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/smoke_test.py b/test/smoke_test.py index 1bba1892fdd..6f1ec06da30 100644 --- a/test/smoke_test.py +++ b/test/smoke_test.py @@ -136,7 +136,7 @@ def main() -> None: smoke_test_torchvision_resnet50_classify("cuda") # torch.compile is not supported on Python 3.14+ and Python built with GIL disabled - if sys.version_info < (3, 14, 0) and sysconfig.get_config_var("Py_GIL_DISABLED") == 0: + if sys.version_info < (3, 14, 0) and not sysconfig.get_config_var("Py_GIL_DISABLED"): smoke_test_compile() if torch.backends.mps.is_available():