mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Run standalone compile tests on cpu/gpu (#151768)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/151768 Approved by: https://github.com/zou3519
This commit is contained in:
parent
cea43f721a
commit
287998b87f
|
|
@ -1471,11 +1471,15 @@ class TestStandaloneCompile(TestCase):
|
|||
@config.patch({"fx_graph_cache": True})
|
||||
@config.patch({"fx_graph_remote_cache": False})
|
||||
@functorch_config.patch({"enable_autograd_cache": True})
|
||||
@parametrize("device", (GPU_TYPE, "cpu"))
|
||||
@parametrize("format", ("binary", "unpacked"))
|
||||
@parametrize("dynamic", (False, True))
|
||||
def test_basic(self, format: str, dynamic: bool) -> None:
|
||||
mod = torch.nn.Linear(1, 3)
|
||||
x = torch.randn(4, 1)
|
||||
def test_basic(self, device: str, format: str, dynamic: bool) -> None:
|
||||
if device == GPU_TYPE and not HAS_GPU:
|
||||
raise unittest.SkipTest(f"requires {GPU_TYPE}")
|
||||
|
||||
mod = torch.nn.Linear(1, 3, device=device)
|
||||
x = torch.randn(4, 1, device=device)
|
||||
if dynamic:
|
||||
torch._dynamo.mark_dynamic(x, 0)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user