mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2026-04-26 01:35:21 +00:00
* [zero] update legacy import * [zero] update examples * [example] fix opt tutorial * [example] fix opt tutorial * [example] fix opt tutorial * [example] fix opt tutorial * [example] fix import
11 lines
440 B
Python
11 lines
440 B
Python
try:
|
|
from colossalai.zero.shard_utils import TensorShardStrategy
|
|
except ImportError:
|
|
# colossalai > 0.2.8
|
|
from colossalai.zero.legacy import TensorShardStrategy
|
|
|
|
zero = dict(model_config=dict(shard_strategy=TensorShardStrategy(),
|
|
tensor_placement_policy="auto",
|
|
reuse_fp16_shard=True),
|
|
optimizer_config=dict(gpu_margin_mem_ratio=0.8, initial_scale=16384))
|