diff --git a/docs/mindformers/docs/source_en/feature/start_tasks.md b/docs/mindformers/docs/source_en/feature/start_tasks.md index 36a23f4aa9a12d7aa2fe0e4b122580b85a9168d5..8fab63f370239908d5656dd11a428b866f6824ce 100644 --- a/docs/mindformers/docs/source_en/feature/start_tasks.md +++ b/docs/mindformers/docs/source_en/feature/start_tasks.md @@ -15,46 +15,56 @@ In the root directory of the MindSpore Transformers code, execute the `run_mindf ### Basic Parameters -| Parameters | Parameter Descriptions | Value Description | Applicable Scenarios | -|:-------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|-----------------------------| -| `--config` | YAML config files. | str, required | pre-train/finetune/predict | -| `--mode` | Set the backend execution mode. | int, optional, `0` is GRAPH_MODE and `1` is PYNATIVE_MODE. Currently, only GRAPH_MODE is supported. | pre-train/finetune/predict | -| `--device_id` | Set the execution device ID. The value must be within the range of available devices. | int, optional | pre-train/finetune/predict | -| `--device_target` | Set the backend execution device. MindSpore Transformers is only supported on `Ascend` devices. | str, optional | pre-train/finetune/predict | -| `--run_mode` | Set the running mode of the model: `train`, `finetune` or `predict`. | str, optional | pre-train/finetune/predict | -| `--load_checkpoint` | File or folder paths for loading weights. For detailed usage, please refer to [Weight Conversion Function](https://www.mindspore.cn/mindformers/docs/en/dev/feature/ckpt.html) | str, optional | pre-train/finetune/predict | -| `--use_parallel` | Whether use parallel mode. | bool, optional | pre-train/finetune/predict | -| `--output_dir` | Set the path where log, checkpoint, strategy, etc. files are saved. | str, optional | pre-train/finetune/predict | -| `--register_path` | The absolute path of the directory where the external code is located. For example, the model directory under the research directory. | str, optional | pre-train/finetune/predict | -| `--seed` | Set the global seed. For details, refer to [mindspore.set_seed](https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.set_seed.html). | int, optional | pre-train/finetune/predict | +| Parameters | Parameter Descriptions | Value Description | Applicable Scenarios | +|:---------------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|----------------------------| +| `--config` | YAML config files. | str, required | pre-train/finetune/predict | +| `--mode` | Set the backend execution mode. | int, optional, `0` is GRAPH_MODE and `1` is PYNATIVE_MODE. Currently, only GRAPH_MODE is supported. | pre-train/finetune/predict | +| `--device_id` | Set the execution device ID. The value must be within the range of available devices. | int, optional | pre-train/finetune/predict | +| `--device_target` | Set the backend execution device. MindSpore Transformers is only supported on `Ascend` devices. | str, optional | pre-train/finetune/predict | +| `--run_mode` | Set the running mode of the model: `train`, `finetune` or `predict`. | str, optional | pre-train/finetune/predict | +| `--load_checkpoint` | File or folder paths for loading weights. For detailed usage, please refer to [Weight Conversion Function](https://www.mindspore.cn/mindformers/docs/en/dev/feature/ckpt.html) | str, optional | pre-train/finetune/predict | +| `--use_parallel` | Whether use parallel mode. | bool, optional | pre-train/finetune/predict | +| `--options` | Override some settings in the used config, the key-value pair in xxx=yyy format will be merged into config file. This parameter has been deprecated and will be removed in the next version. | str, optional | pre-train/finetune/predict | +| `--output_dir` | Set the paths for saving logs, weights, sharding strategies, and other files. | str, optional | pre-train/finetune/predict | +| `--register_path` | The absolute path of the directory where the external code is located. For example, the model directory under the research directory. | str, optional | pre-train/finetune/predict | +| `--remote_save_url` | Remote save url, where all the output files will transferred and stored in here. This parameter has been deprecated and will be removed in the next version. | str, optional | pre-train/finetune/predict | +| `--seed` | Set the global seed. For details, refer to [mindspore.set_seed](https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.set_seed.html). | int, optional | pre-train/finetune/predict | +| `--trust_remote_code` | Whether Hugging Face AutoTokenizer trusts remote code. | bool, optional | pre-train/finetune/predict | ### Weight Slicing -| Parameters | Parameter Descriptions | Value Description | Applicable Scenarios | -|:----------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|-----------------------------| -| `--src_strategy_path_or_dir` | The strategy of load_checkpoint. | str, optional | pre-train/finetune/predict | +| Parameters | Parameter Descriptions | Value Description | Applicable Scenarios | +|:----------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|-----------------------------| +| `--src_strategy_path_or_dir` | The strategy of load_checkpoint. | str, optional | pre-train/finetune/predict | | `--auto_trans_ckpt` | Enable online weight automatic conversion. Refer to [Weight Conversion Function](https://www.mindspore.cn/mindformers/docs/en/dev/feature/ckpt.html). | bool, optional | pre-train/finetune/predict | -| `--transform_process_num` | The number of processes responsible for checkpoint transform. | int, optional | pre-train/finetune/predict | -| `--only_save_strategy` | Whether to only save the strategy files. | bool, optional, when it is `true`, the task exits directly after saving the strategy file. | pre-train/finetune/predict | +| `--transform_process_num` | The number of processes responsible for checkpoint transform. | int, optional | pre-train/finetune/predict | +| `--only_save_strategy` | Whether to only save the strategy files. | bool, optional, when it is `true`, the task exits directly after saving the strategy file. | pre-train/finetune/predict | +| `--strategy_load_checkpoint` | The path to the distributed strategy file to be loaded. This parameter has been deprecated and will be removed in the next version. | str, optional | pre-train/finetune/predict | ### Training -| Parameters | Parameter Descriptions | Value Description | Applicable Scenarios | -|:--------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|----------------------| -| `--train_dataset_dir` | Dataset directory of data loader to pre-train/finetune. | str, optional | pre-train/finetune | -| `--resume_training` | Enable resumable training after breakpoint. For details, refer to [Resumable Training After Breakpoint](https://www.mindspore.cn/mindformers/docs/en/dev/feature/resume_training.html#resumable-training). | bool, optional | pre-train/finetune | -| `--epochs` | Train epochs. | int, optional | pre-train/finetune | -| `--batch_size` | The sample size of the batch data. | int, optional | pre-train/finetune | -| `--gradient_accumulation_steps` | The number of gradient accumulation steps. | int, optional | pre-train/finetune | -| `--num_samples` | Number of datasets samples used. | int, optional | pre-train/finetune | +| Parameters | Parameter Descriptions | Value Description | Applicable Scenarios | +|:-------------------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|----------------------| +| `--do_eval` | Whether to evaluate in training process. This parameter has been deprecated and will be removed in the next version. | bool, optional | pre-train/finetune | +| `--eval_dataset_dir` | Dataset directory of data loader to eval. This parameter has been deprecated and will be removed in the next version. | str, optional | pre-train/finetune | +| `--train_dataset_dir` | Dataset directory of data loader to pre-train/finetune. | str, optional | pre-train/finetune | +| `--resume_training` | Enable resumable training after breakpoint. For details, refer to [Resumable Training After Breakpoint](https://www.mindspore.cn/mindformers/docs/en/dev/feature/resume_training.html#resumable-training). | bool, optional | pre-train/finetune | +| `--profile` | Whether to use profile analysis. This parameter has been deprecated and will be removed in the next version. | bool, optional | pre-train/finetune | +| `--epochs` | Train epochs. | int, optional | pre-train/finetune | +| `--batch_size` | The sample size of the batch data. | int, optional | pre-train/finetune | +| `--gradient_accumulation_steps` | The number of gradient accumulation steps. | int, optional | pre-train/finetune | +| `--sink_mode` | Whether to use sink mode. This parameter has been deprecated and will be removed in the next version. | bool, optional | pre-train/finetune | +| `--num_samples` | Number of datasets samples used. | int, optional | pre-train/finetune | ### Inference -| Parameters | Parameter Descriptions | Value Description | Applicable Scenarios | -|:----------------------:|:-----------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------| -| `--predict_data` | Input data for predict. | str, optional, It can be the input for predict (single-batch predict) or the file path of a txt file containing multiple lines of text (multi-batch predict). | predict | -| `--predict_batch_size` | Batch size for predict data, set to perform batch predict. | int, optional | predict | -| `--do_sample` | Whether to use random sampling when selecting tokens when predicting. | int, optional, ``True`` means using sampling encoding, ``False`` means using greedy decoding. | predict | +| Parameters | Parameter Descriptions | Value Description | Applicable Scenarios | +|:----------------------:|:------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------| +| `--predict_data` | Input data for inference. | str, optional, It can be the input for predict (single-batch predict) or the file path of a txt file containing multiple lines of text (multi-batch predict). | predict | +| `--modal_type` | Modal type of input data for predict. This parameter has been deprecated and will be removed in the next version. | str, optional | predict | +| `--adapter_id` | LoRA ID for predict. This parameter has been deprecated and will be removed in the next version. | str, optional | predict | +| `--predict_batch_size` | The batch size for multi-batch inference. | int, optional | predict | +| `--do_sample` | Whether to use random sampling when selecting tokens for inference. | int, optional, ``True`` means using sampling encoding, ``False`` means using greedy decoding. | predict | ## Distributed Task Pull-up Script diff --git a/docs/mindformers/docs/source_zh_cn/feature/start_tasks.md b/docs/mindformers/docs/source_zh_cn/feature/start_tasks.md index 2c5b8f1d579c9f5989ce4974721bf5a6d5d5c6b5..66eb96cf9ff25012457af6c13fb59ca961fbfe7d 100644 --- a/docs/mindformers/docs/source_zh_cn/feature/start_tasks.md +++ b/docs/mindformers/docs/source_zh_cn/feature/start_tasks.md @@ -15,46 +15,56 @@ MindSpore Transformers提供了一键启动脚本`run_mindformer.py`和分布式 ### 基础参数 -| 参数 | 参数说明 | 取值说明 | 适用场景 | -|:-------------------:|:---------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|-----------| -| `--config` | 任务yaml配置文件的路径。 | str,必选 | 预训练/微调/推理 | -| `--mode` | 设置后端执行模式。 | int,可选,`0`为GRAPH_MODE,`1`为PYNATIVE_MODE,当前仅支持GRAPH_MODE | 预训练/微调/推理 | -| `--device_id` | 设置执行设备ID,其值必须在可用设备范围内。 | int,可选 | 预训练/微调/推理 | -| `--device_target` | 设置后端执行设备,MindSpore Transformers仅支持在`Ascend`设备上运行。 | str,可选 | 预训练/微调/推理 | -| `--run_mode` | 设置模型的运行模式,可选`train`、`finetune`或`predict`。 | str,可选 | 预训练/微调/推理 | -| `--load_checkpoint` | 加载的权重文件或文件夹路径,详细使用方式参考[权重转换功能](https://www.mindspore.cn/mindformers/docs/zh-CN/dev/feature/ckpt.html)。 | str,可选 | 预训练/微调/推理 | -| `--use_parallel` | 是否开启并行模式。 | bool,可选 | 预训练/微调/推理 | -| `--output_dir` | 设置保存日志、权重、切分策略等文件的路径。 | str,可选 | 预训练/微调/推理 | -| `--register_path` | 外挂代码所在目录的绝对路径。比如research目录下的模型目录。 | str,可选 | 预训练/微调/推理 | -| `--seed` | 设置全局种子,详情可参考[mindspore.set_seed](https://www.mindspore.cn/docs/zh-CN/master/api_python/mindspore/mindspore.set_seed.html)。 | int,可选 | 预训练/微调/推理 | +| 参数 | 参数说明 | 取值说明 | 适用场景 | +|:---------------------:|:---------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|-----------| +| `--config` | 任务yaml配置文件的路径。 | str,必选 | 预训练/微调/推理 | +| `--mode` | 设置后端执行模式。 | int,可选,`0`为GRAPH_MODE,`1`为PYNATIVE_MODE,当前仅支持GRAPH_MODE | 预训练/微调/推理 | +| `--device_id` | 设置执行设备ID,其值必须在可用设备范围内。 | int,可选 | 预训练/微调/推理 | +| `--device_target` | 设置后端执行设备,MindSpore Transformers仅支持在`Ascend`设备上运行。 | str,可选 | 预训练/微调/推理 | +| `--run_mode` | 设置模型的运行模式,可选`train`、`finetune`或`predict`。 | str,可选 | 预训练/微调/推理 | +| `--load_checkpoint` | 加载的权重文件或文件夹路径,详细使用方式参考[权重转换功能](https://www.mindspore.cn/mindformers/docs/zh-CN/dev/feature/ckpt.html)。 | str,可选 | 预训练/微调/推理 | +| `--use_parallel` | 是否开启并行模式。 | bool,可选 | 预训练/微调/推理 | +| `--options` | 覆盖已使用的配置中的部分设置,xxx=yyy格式的键值对将被合并到配置文件中。该参数已废弃,下个版本删除。 | str,可选 | 预训练/微调/推理 | +| `--output_dir` | 设置保存日志、权重、切分策略等文件的路径。 | str,可选 | 预训练/微调/推理 | +| `--register_path` | 外挂代码所在目录的绝对路径。比如research目录下的模型目录。 | str,可选 | 预训练/微调/推理 | +| `--remote_save_url` | 远程保存url,所有输出文件都将传输并存储在此处。该参数已废弃,下个版本删除。 | str,可选 | 预训练/微调/推理 | +| `--seed` | 设置全局种子,详情可参考[mindspore.set_seed](https://www.mindspore.cn/docs/zh-CN/master/api_python/mindspore/mindspore.set_seed.html)。 | int,可选 | 预训练/微调/推理 | +| `--trust_remote_code` | Hugging Face AutoTokenizer是否信任远程代码。 | bool,可选 | 预训练/微调/推理 | ### 权重切分 -| 参数 | 参数说明 | 取值说明 | 适用场景 | -|:----------------------------:|:-------------------------------------------------------------------------------------------------------------------|--------------------------------|-----------| -| `--src_strategy_path_or_dir` | 权重的策略文件路径。 | str,可选 | 预训练/微调/推理 | +| 参数 | 参数说明 | 取值说明 | 适用场景 | +|:----------------------------:|:-----------------------------------------------------------------------------------------------------|--------------------------------|-----------| +| `--src_strategy_path_or_dir` | 权重的策略文件路径。 | str,可选 | 预训练/微调/推理 | | `--auto_trans_ckpt` | 是否开启在线权重自动转换功能,详情可参考[权重转换功能](https://www.mindspore.cn/mindformers/docs/zh-CN/dev/feature/ckpt.html)。 | bool,可选 | 预训练/微调/推理 | -| `--transform_process_num` | 负责权重转换的进程数。 | int,可选 | 预训练/微调/推理 | -| `--only_save_strategy` | 是否仅保存切分策略文件。 | bool,可选,为`true`时任务在保存策略文件后直接退出 | 预训练/微调/推理 | +| `--transform_process_num` | 负责权重转换的进程数。 | int,可选 | 预训练/微调/推理 | +| `--only_save_strategy` | 是否仅保存切分策略文件。 | bool,可选,为`true`时任务在保存策略文件后直接退出 | 预训练/微调/推理 | +| `--strategy_load_checkpoint` | 要加载的分布式策略文件的路径。该参数已废弃,下个版本删除。 | str,可选 | 预训练/微调/推理 | ### 训练 -| 参数 | 参数说明 | 取值说明 | 适用场景 | -|:-------------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------| -| `--train_dataset_dir` | 预训练/微调的数据集目录。 | str,可选 | 预训练/微调 | +| 参数 | 参数说明 | 取值说明 | 适用场景 | +|:-------------------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------| +| `--do_eval` | 是否开启边训练边评估功能。该参数已废弃,下个版本删除。 | bool,可选 | 预训练/微调 | +| `--eval_dataset_dir` | 评估的数据集目录。该参数已废弃,下个版本删除。 | bool,可选 | 预训练/微调 | +| `--train_dataset_dir` | 预训练/微调的数据集目录。 | str,可选 | 预训练/微调 | | `--resume_training` | 是否开启断点续训功能,详情可参考[断点续训功能](https://www.mindspore.cn/mindformers/docs/zh-CN/dev/feature/resume_training.html#%E6%96%AD%E7%82%B9%E7%BB%AD%E8%AE%AD)。 | bool,可选 | 预训练/微调 | -| `--epochs` | 训练轮次。 | int,可选 | 预训练/微调 | -| `--gradient_accumulation_steps` | 梯度累积步数。 | int,可选 | 预训练/微调 | -| `--batch_size` | 批处理数据的样本数。 | int,可选 | 预训练/微调 | -| `--num_samples` | 使用的数据集样本数量。 | int,可选 | 预训练/微调 | +| `--profile` | 是否使用profile分析。该参数已废弃,下个版本删除。 | bool,可选 | 预训练/微调 | +| `--epochs` | 训练轮次。 | int,可选 | 预训练/微调 | +| `--batch_size` | 批处理数据的样本数。 | int,可选 | 预训练/微调 | +| `--gradient_accumulation_steps` | 梯度累积步数。 | int,可选 | 预训练/微调 | +| `--sink_mode` | 是否使用下沉模式。该参数已废弃,下个版本删除。 | bool,可选 | 预训练/微调 | +| `--num_samples` | 使用的数据集样本数量。 | int,可选 | 预训练/微调 | ### 推理 -| 参数 | 参数说明 | 取值说明 | 适用场景 | -|:----------------------:|:-----------------------|-----------------------------------------------------|------| -| `--predict_data` | 推理的输入数据。 | str,可选,可以是推理的输入(单batch推理)或包含多行文本的txt文件路径(多batch推理)。 | 推理 | -| `--predict_batch_size` | 多batch推理的batch_size大小。 | int,可选 | 推理 | -| `--do_sample` | 推理选择token时是否使用随机采样。 | int,可选,``True`` 表示使用随机采样,``False`` 代表使用贪心搜索。 | 推理 | +| 参数 | 参数说明 | 取值说明 | 适用场景 | +|:----------------------:|:--------------------------|-----------------------------------------------------|------| +| `--predict_data` | 推理的输入数据。 | str,可选,可以是推理的输入(单batch推理)或包含多行文本的txt文件路径(多batch推理)。 | 推理 | +| `--modal_type` | 模型推理输入对应模态。该参数已废弃,下个版本删除。 | str,可选 | 推理 | +| `--adapter_id` | 推理的LoRA ID。该参数已废弃,下个版本删除。 | str,可选 | 推理 | +| `--predict_batch_size` | 多batch推理的batch_size大小。 | int,可选 | 推理 | +| `--do_sample` | 推理选择token时是否使用随机采样。 | int,可选,``True`` 表示使用随机采样,``False`` 代表使用贪心搜索。 | 推理 | ## 分布式任务拉起脚本