Skip to content

Commit 49e0415

Browse files
committed
[megatron] compat megatron-core 0.11 (#4655)
1 parent 0a2247e commit 49e0415

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

examples/train/grpo/multi_node/train_dlc.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# This script is used in DLC (Deep Learning Containers)
2-
# For more information, visit:https://www.aliyun.com/activity/bigdata/pai-dlc
2+
# For more information, visit: https://www.aliyun.com/activity/bigdata/pai-dlc
3+
# https://help.aliyun.com/zh/pai/user-guide/general-environment-variables
34
NNODES=$WORLD_SIZE \
45
NODE_RANK=$RANK \
5-
PYTHONPATH=. \
66
torchrun \
77
--nproc_per_node=8 \
88
--nnodes=${WORLD_SIZE} \

examples/train/multi-node/dlc/train.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# For more information, visit: https://www.aliyun.com/activity/bigdata/pai-dlc
12
# https://help.aliyun.com/zh/pai/user-guide/general-environment-variables
23
NNODES=$WORLD_SIZE \
34
NODE_RANK=$RANK \

swift/megatron/argument/megatron_args.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,10 @@ def _args_to_argv(self) -> Tuple[List[Any], Dict[str, Any]]:
264264
extra_megatron_kwargs = args_dict.pop('extra_megatron_kwargs')
265265
args_dict.update(extra_megatron_kwargs)
266266
use_core_011 = version.parse(megatron.core.__version__) < version.parse('0.12')
267-
core_012_arguments = {'recompute_modules', 'moe_router_dtype', 'cross_entropy_fusion_impl', 'moe_enable_deepep'}
267+
core_012_arguments = {
268+
'recompute_modules', 'moe_router_dtype', 'cross_entropy_fusion_impl', 'moe_enable_deepep',
269+
'optimizer_offload_fraction'
270+
}
268271
for k, value in args_dict.items():
269272
if k not in MegatronArguments.__annotations__ and k not in extra_megatron_kwargs:
270273
extra_args[k] = value

0 commit comments

Comments
 (0)