mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-11-03 07:33:54 +00:00
[test] make zero engine test really work (#447)
This commit is contained in:
@@ -6,6 +6,7 @@ import torch.distributed as dist
|
||||
from colossalai.logging import get_dist_logger
|
||||
from colossalai.utils import checkpoint
|
||||
from colossalai.zero.sharded_model import ShardedModelV2
|
||||
from colossalai.nn.optimizer import CPUAdam
|
||||
|
||||
LOGGER = get_dist_logger('zero_test')
|
||||
|
||||
@@ -19,16 +20,16 @@ _ZERO_MODEL_CONFIG = dict(reduce_scatter_bucket_size_mb=25,
|
||||
use_memory_tracer=False)
|
||||
|
||||
_ZERO_OPTIMIZER_CONFIG = dict(
|
||||
optimizer_class=torch.optim.Adam,
|
||||
optimizer_class=torch.optim.Adam, #CPUAdam
|
||||
cpu_offload=False,
|
||||
initial_scale=2**32,
|
||||
initial_scale=2**5,
|
||||
min_scale=1,
|
||||
growth_factor=2,
|
||||
backoff_factor=0.5,
|
||||
growth_interval=1000,
|
||||
hysteresis=2,
|
||||
max_scale=2**32,
|
||||
)
|
||||
lr=1e-3)
|
||||
|
||||
ZERO_PARALLEL_CONFIG = dict(fp16=dict(mode=None,),
|
||||
zero=dict(
|
||||
|
||||
Reference in New Issue
Block a user