mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-11 05:49:55 +00:00
[test] refactor tests with spawn (#3452)
* [test] added spawn decorator * polish code * polish code * polish code * polish code * polish code * polish code
This commit is contained in:
@@ -6,6 +6,7 @@ from torch.optim import Adam
|
||||
from torchvision.models import resnet18
|
||||
|
||||
from colossalai.checkpoint_io import GeneralCheckpointIO
|
||||
from colossalai.testing import clear_cache_before_run, parameterize
|
||||
|
||||
# ========
|
||||
# Note:
|
||||
@@ -15,7 +16,8 @@ from colossalai.checkpoint_io import GeneralCheckpointIO
|
||||
# ========
|
||||
|
||||
|
||||
@pytest.mark.parametrize('use_safetensors', [True, False])
|
||||
@clear_cache_before_run()
|
||||
@parameterize('use_safetensors', [True, False])
|
||||
def test_unsharded_checkpoint(use_safetensors: bool):
|
||||
# create a model and optimizer
|
||||
model = resnet18()
|
||||
|
Reference in New Issue
Block a user