Skip to content

Commit d51ca38

Browse files
huydhnpytorchmergebot
authored andcommitted
Run test_serialization serially (for 2xlarge runners) (#94613)
Fixes #92746 Pull Request resolved: #94613 Approved by: https://github.com/clee2000
1 parent 680fc84 commit d51ca38

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

test/run_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ def skip_test_p(name: str) -> bool:
319319
'functorch/test_vmap', # OOM
320320
'test_fx', # gets SIGKILL
321321
'test_dataloader', # frequently hangs for ROCm
322+
'test_serialization', # test_serialization_2gb_file allocates a tensor of 2GB, and could cause OOM
322323
]
323324

324325
# A subset of our TEST list that validates PyTorch's ops, modules, and autograd function as expected

test/test_serialization.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import io
66
import tempfile
77
import os
8+
import gc
89
import sys
910
import zipfile
1011
import warnings
@@ -905,6 +906,8 @@ def test_serialization_zipfile_actually_jit(self):
905906

906907
# Ensure large zip64 serialization works properly
907908
def test_serialization_2gb_file(self):
909+
# Run GC to clear up as much memory as possible before running this test
910+
gc.collect()
908911
big_model = torch.nn.Conv2d(20000, 3200, kernel_size=3)
909912

910913
with BytesIOContext() as f:

0 commit comments

Comments
 (0)