8000 Undo changes to verify_dynamo.py · pytorch/pytorch@63f344f · GitHub
[go: up one dir, main page]

Skip to content

Commit 63f344f

Browse files
committed
Undo changes to verify_dynamo.py
1 parent 6459143 commit 63f344f

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

tools/dynamo/verify_dynamo.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def check_rocm():
142142
return rocm_ver if torch.version.hip else "None"
143143

144144

145-
def check_dynamo(backend: str, device: str, err_msg: str) -> None:
145+
def check_dynamo(backend, device, err_msg) -> None:
146146
import torch
147147

148148
if device == "cuda" and not torch.cuda.is_available():
@@ -151,15 +151,17 @@ def check_dynamo(backend: str, device: str, err_msg: str) -> None:
151151

152152
try:
153153
import torch._dynamo as dynamo
154-
from torch._dynamo.eval_frame import raise_if_inductor_unavailable
155154

156-
try:
157-
raise_if_inductor_unavailable(device)
158-
except RuntimeError as e:
159-
print(
160-
f"WARNING: Inductor not available for {device} ({e}). Skipping check."
161-
)
162-
return
155+
if device == "cuda":
156+
from torch.utils._triton import has_triton
157+
158+
if not has_triton():
159+
print(
160+
f"WARNING: CUDA available but triton cannot be used. "
161+
f"Your GPU may not be supported. "
162+
f"Skipping CUDA check on {backend} backend\n"
163+
)
164+
return
163165

164166
dynamo.reset()
165167

@@ -203,8 +205,6 @@ def forward(self, x):
203205

204206

205207
def main() -> None:
206-
from torch._dynamo.eval_frame import is_dynamo_supported
207-
208208
python_ver = check_python()
209209
torch_ver = check_torch()
210210
cuda_ver = check_cuda()
@@ -215,10 +215,10 @@ def main() -> None:
215215
f"CUDA version: {cuda_ver}\n"
216216
f"ROCM version: {rocm_ver}\n"
217217
)
218-
if not is_dynamo_supported():
219-
warnings.warn("Dynamo is not supported on this platform. Skipping check.")
220-
return
221218
for args in _SANITY_CHECK_ARGS:
219+
if sys.version_info >= (3, 13):
220+
warnings.warn("Dynamo not yet supported in Python 3.13. Skipping check.")
221+
continue
222222
check_dynamo(*args)
223223
print("All required checks passed")
224224

0 commit comments

Comments
 (0)
0