From a77f7a33302178f608a034c8050f82cba51984eb Mon Sep 17 00:00:00 2001 From: liurong1995 Date: Wed, 18 Jun 2025 15:03:37 +0800 Subject: [PATCH] docs:modify docs for multiparameter --- docs/features/multi_parameter_pipeline.md | 3 +-- .../multi_parameter_pipeline_and_variable_seq_lengths.md | 3 +-- docs/user-guide/model-migration.md | 4 ++-- .../features_manager/pipeline_parallel/multi_parameter.py | 7 ++++--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/features/multi_parameter_pipeline.md b/docs/features/multi_parameter_pipeline.md index d5c2d6f0..ca692160 100644 --- a/docs/features/multi_parameter_pipeline.md +++ b/docs/features/multi_parameter_pipeline.md @@ -23,8 +23,7 @@ ## 使用方法 **注意事项**: -- 用户需代码配置`args.pipeline_tensor_shapes`明确指定各阶段间传递的具体参数及其属性(如shape、dtype)。 -- args.pipeline_tensor_shapes配置参考`tests_extend/system_tests/multi_modal/multi_parameter_pipeline/pretrain_multi_parameter_pipeline_test.py` +用户需修改mindspeed/features_manager/pipeline_parallel/multi_parameter.py模块中validate_args函数里args.pipeline_tensor_shapes值与实际模型流水线阶段的张量传输一致,包括张量维度(Shape)和数据类型(Dtype)。 **设置训练脚本参数** diff --git a/docs/features/multi_parameter_pipeline_and_variable_seq_lengths.md b/docs/features/multi_parameter_pipeline_and_variable_seq_lengths.md index 840df65e..264c77c1 100644 --- a/docs/features/multi_parameter_pipeline_and_variable_seq_lengths.md +++ b/docs/features/multi_parameter_pipeline_and_variable_seq_lengths.md @@ -22,8 +22,7 @@ ## 使用方法 **注意事项**: -- 用户需代码配置`args.pipeline_tensor_shapes`明确指定各阶段间传递的具体参数及其属性(如shape、dtype)。 -- args.pipeline_tensor_shapes配置参考`tests_extend/system_tests/multi_modal/multi_parameter_pipeline/pretrain_multi_parameter_pipeline_test.py` +用户需修改mindspeed/features_manager/pipeline_parallel/multi_parameter.py模块中validate_args函数里args.pipeline_tensor_shapes值与实际模型流水线阶段的张量传输一致,包括张量维度(Shape)和数据类型(Dtype)。 **设置训练脚本参数** diff --git a/docs/user-guide/model-migration.md b/docs/user-guide/model-migration.md index f0d221dd..22eb6925 100644 --- a/docs/user-guide/model-migration.md +++ b/docs/user-guide/model-migration.md @@ -75,7 +75,7 @@ end ## 模型选取 -- 选择[Megatron-LM](https://github.com/NVIDIA/Megatron-LM)仓库core_r0.10.0分支, +- 选择[Megatron-LM](https://github.com/NVIDIA/Megatron-LM)仓库core_r0.12.1分支, 使用仓库根目录下的pretrain_gpt.py中内置的GPT模型作为迁移的模型。 - 迁移前要保证选定的模型能在三方平台(如GPU)上运行,并输出精度和性能基线。 @@ -84,7 +84,7 @@ end 仅仅一行代码就可以轻松使能`MindSpeed`的各项功能,完成对`Megatron-LM`的模型迁移。 -**步骤1** 参考安装指南完成基础环境的搭建。 +**步骤1** 参考[安装指南](./installation.md)完成基础环境的搭建。 **步骤2** 在`Megatron-LM`仓库根目录下修改`pretrain_gpt.py`文件, 在`import torch`下新增一行: diff --git a/mindspeed/features_manager/pipeline_parallel/multi_parameter.py b/mindspeed/features_manager/pipeline_parallel/multi_parameter.py index ed1ceb2d..6f123fa3 100644 --- a/mindspeed/features_manager/pipeline_parallel/multi_parameter.py +++ b/mindspeed/features_manager/pipeline_parallel/multi_parameter.py @@ -34,11 +34,12 @@ class MultiParameterFeature(MindSpeedFeature): def validate_args(self, args): self.incompatible_check(args, 'moe_fb_overlap') - if getattr(args, "schedules_method", False) == "dualpipev": - raise AssertionError( - "The dualpipev and use_multiparameter_pipeline_model_parallel are incompatible.") if getattr(args, "use_multiparameter_pipeline_model_parallel", False): + if getattr(args, "schedules_method", False) == "dualpipev": + raise AssertionError( + "The dualpipev and use_multiparameter_pipeline_model_parallel are incompatible." + ) tensor_shape = (int(args.seq_length / args.context_parallel_size), args.micro_batch_size, args.hidden_size) if getattr(args, "bf16", False): -- Gitee