Run test_serialization serially (for 2xlarge runners) (#94613)

Fixes https://github.com/pytorch/pytorch/issues/92746
Pull Request resolved: https://github.com/pytorch/pytorch/pull/94613
Approved by: https://github.com/clee2000
This commit is contained in:
Huy Do
2023-02-11 00:15:10 +00:00
committed by PyTorch MergeBot
parent 680fc84e7b
commit d51ca38ef0
2 changed files with 4 additions and 0 deletions

View File

@ -319,6 +319,7 @@ CI_SERIAL_LIST = [
'functorch/test_vmap', # OOM
'test_fx', # gets SIGKILL
'test_dataloader', # frequently hangs for ROCm
'test_serialization', # test_serialization_2gb_file allocates a tensor of 2GB, and could cause OOM
]
# A subset of our TEST list that validates PyTorch's ops, modules, and autograd function as expected

View File

@ -5,6 +5,7 @@ import unittest
import io
import tempfile
import os
import gc
import sys
import zipfile
import warnings
@ -905,6 +906,8 @@ class TestSerialization(TestCase, SerializationMixin):
# Ensure large zip64 serialization works properly
def test_serialization_2gb_file(self):
# Run GC to clear up as much memory as possible before running this test
gc.collect()
big_model = torch.nn.Conv2d(20000, 3200, kernel_size=3)
with BytesIOContext() as f: