Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions test/smoke_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import os
from pathlib import Path
from sys import platform

import torch
import torch.nn as nn
Expand Down Expand Up @@ -29,11 +30,17 @@ def smoke_test_torchvision_read_decode() -> None:


def smoke_test_compile() -> None:
model = resnet50().cuda()
model = torch.compile(model)
x = torch.randn(1, 3, 224, 224, device="cuda")
out = model(x)
print(f"torch.compile model output: {out.shape}")
try:
model = resnet50().cuda()
model = torch.compile(model)
x = torch.randn(1, 3, 224, 224, device="cuda")
out = model(x)
print(f"torch.compile model output: {out.shape}")
except RuntimeError:
if platform == "win32":
print("Successfully caught torch.compile RuntimeError on win")
else:
raise


def smoke_test_torchvision_resnet50_classify(device: str = "cpu") -> None:
Expand Down