mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-02 01:28:31 +00:00
[example] update examples related to zero/gemini (#3431)
* [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
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
from colossalai.zero.shard_utils import TensorShardStrategy
|
||||
from colossalai.nn.optimizer import FusedAdam
|
||||
|
||||
try:
|
||||
from colossalai.zero.shard_utils import TensorShardStrategy
|
||||
except ImportError:
|
||||
# colossalai > 0.2.8
|
||||
from colossalai.zero.legacy import TensorShardStrategy
|
||||
|
||||
clip_grad_norm = 1.0
|
||||
|
@@ -1,6 +1,11 @@
|
||||
from colossalai.zero.shard_utils import TensorShardStrategy
|
||||
from colossalai.nn.optimizer import FusedAdam
|
||||
|
||||
try:
|
||||
from colossalai.zero.shard_utils import TensorShardStrategy
|
||||
except ImportError:
|
||||
# colossalai > 0.2.8
|
||||
from colossalai.zero.legacy import TensorShardStrategy
|
||||
|
||||
# fp16 = dict(
|
||||
# mode=AMP_TYPE.TORCH,
|
||||
# )
|
||||
@@ -29,4 +34,4 @@ optimizer = dict(
|
||||
weight_decay=1e-2,
|
||||
)
|
||||
|
||||
# 64433
|
||||
# 64433
|
||||
|
Reference in New Issue
Block a user