diff --git a/docs/mindformers/docs/source_en/index.rst b/docs/mindformers/docs/source_en/index.rst index c5c4c180009aeb9c17eeaa1849d5ad4e3537163b..9b65b16b05427fd30eb0e2a987834ca002bb2094 100644 --- a/docs/mindformers/docs/source_en/index.rst +++ b/docs/mindformers/docs/source_en/index.rst @@ -3,6 +3,12 @@ MindSpore Transformers Documentation The goal of MindSpore Transformers (also known as MindFormers) suite is to build a full-process development suite for training, fine-tuning, evaluating, inference, and deploying large models, providing the industry mainstream Transformer class of pre-trained models and SOTA downstream task applications, and covering a rich range of parallel features, with the expectation of helping users to easily realize large model training and innovative research and development. +.. image:: ../source_zh_cn/usage/image/mindformers_operation.png + :alt: user operation flow diagram + :align: center + :width: 200px + :height: 400px + Users can refer to `Overall Architecture `_ and `Model Library `_ to get an initial understanding of MindFormers architecture and model support. Refer to the `Installation `_ and `Quick Start `_ to get started with MindFormers. If you have any suggestions for MindFormers, please contact us via `issue `_ and we will handle them promptly. diff --git a/docs/mindformers/docs/source_en/quick_start/install.md b/docs/mindformers/docs/source_en/quick_start/install.md index 83cfc52f8cda3eb6987c581273571d33bf62169f..7fefebc3d7f70dcf4fd84a70d7dc8f12d793fed2 100644 --- a/docs/mindformers/docs/source_en/quick_start/install.md +++ b/docs/mindformers/docs/source_en/quick_start/install.md @@ -50,4 +50,6 @@ A similar result as below proves that the installation was successful: ```text - INFO - All checks passed, used **** seconds, the environment is correctly set up! -``` \ No newline at end of file +``` + +After the installation of MindFormers is completed, you can view the [Quick Start](source_code_start.md) document to try to quickly start a simple task. \ No newline at end of file diff --git a/docs/mindformers/docs/source_en/quick_start/source_code_start.md b/docs/mindformers/docs/source_en/quick_start/source_code_start.md index d7a0929eeac01a9995ef095f6989b0156a783802..1ed2c425dab8d51c4c995220ef0d93bcb77f17b1 100644 --- a/docs/mindformers/docs/source_en/quick_start/source_code_start.md +++ b/docs/mindformers/docs/source_en/quick_start/source_code_start.md @@ -103,4 +103,6 @@ It indicates that the startup fine-tuning was successful. ## Notes -For more details on Llama2, and more startup approaches, please refer specifically to the `Llama2` [README](https://gitee.com/mindspore/mindformers/blob/dev/docs/model_cards/llama2.md#llama-2) documentation for more support. \ No newline at end of file +For more details on Llama2, and more startup approaches, please refer specifically to the `Llama2` [README](https://gitee.com/mindspore/mindformers/blob/dev/docs/model_cards/llama2.md#llama-2) documentation for more support. + +If you have successfully launched the LoRA low parameter fine-tuning task based on the Llama2-7B model, and want to further understand MindFormers, you can refer to the MindFormers tutorial for further learning in combination with your actual situation. \ No newline at end of file diff --git a/docs/mindformers/docs/source_en/usage/inference.md b/docs/mindformers/docs/source_en/usage/inference.md index 052eb711862492374ada5a8cecee5bcfda6b6f8a..166d27804e11b1d00dd2ec2a03bd482adc7a0193 100644 --- a/docs/mindformers/docs/source_en/usage/inference.md +++ b/docs/mindformers/docs/source_en/usage/inference.md @@ -176,3 +176,5 @@ The results of running the preceding single-device and multi-device inference co ## More Information For more inference examples of different models, see [the models supported by MindFormers](https://www.mindspore.cn/mindformers/docs/en/dev/start/models.html). + +After completing the reasoning task, you can refer to the [MindIE Service Deployment](mindie_deployment.md) document to deploy the large model in MindForms through MindIE Service. \ No newline at end of file diff --git a/docs/mindformers/docs/source_en/usage/parameter_efficient_fine_tune.md b/docs/mindformers/docs/source_en/usage/parameter_efficient_fine_tune.md index e95a85ea7c351724339b5f0f6ab26aa9c93668b7..426aff88fb570f6b9c3ea721de2c5852ea6aa828 100644 --- a/docs/mindformers/docs/source_en/usage/parameter_efficient_fine_tune.md +++ b/docs/mindformers/docs/source_en/usage/parameter_efficient_fine_tune.md @@ -96,3 +96,5 @@ bash scripts/msrun_launcher.sh "run_mindformer.py \ --use_parallel True \ --run_mode finetune" 8 ``` + +To evaluate the tuning effect of the model, you can view [evaluation](evaluation.md) document to understand how to evaluate the accuracy of the model to ensure that the performance of the model meets expectations. In addition, if you want to apply the tuned model to the actual scene, [inference](inference.md) document will guide you how to carry out model inference, helping you use the prediction ability of the model to solve specific problems and provide decision support. \ No newline at end of file diff --git a/docs/mindformers/docs/source_en/usage/pre_training.md b/docs/mindformers/docs/source_en/usage/pre_training.md index 84f609a4cf217ea783144730195db06bd704b7ba..b847bb14408a5f5295c3fdbe6b3f2554d629d02b 100644 --- a/docs/mindformers/docs/source_en/usage/pre_training.md +++ b/docs/mindformers/docs/source_en/usage/pre_training.md @@ -87,3 +87,5 @@ bash scripts/msrun_launcher.sh "run_mindformer.py \ ## More Information For more training examples of different models, see [the models supported by MindFormers](https://www.mindspore.cn/mindformers/docs/en/dev/start/models.html). + +After completing the pretraining, you can view our [SFT tuning](sft_tuning.md) document and [low parameter tuning](parameter_efficient_fine_tune.md) document. These will guide you how to fine tune the pretraining model according to your own data set and task requirements to obtain better performance and better adaptability. \ No newline at end of file diff --git a/docs/mindformers/docs/source_en/usage/sft_tuning.md b/docs/mindformers/docs/source_en/usage/sft_tuning.md index 4b16db7f75bb1610232bea081b18470e73bcaf6f..a3e2d24d5f58c3f7ba04e98dcf3c3d968cf80680 100644 --- a/docs/mindformers/docs/source_en/usage/sft_tuning.md +++ b/docs/mindformers/docs/source_en/usage/sft_tuning.md @@ -25,9 +25,11 @@ Based on actual operations, SFT may be decomposed into the following steps: For the selected pretrained model, download the pretrained weights from the HuggingFace model library. 3. **Converting model weights:** Convert the downloaded HuggingFace weight based on the required framework, for example, convert it to the CKPT weights supported by the MindSpore framework. -4. **Preparing a dataset:** +4. **Transforming and segmenting model weights:** + Combine the model you want to fine tune to segment the converted weight or enable automatic weight segmentation. Refer to [distributed weight segmentation and consolidation](../function/transform_weight.md) +5. **Preparing a dataset:** Select a dataset for fine-tuning tasks based on the fine-tuning objective. For LLMs, the fine-tuning dataset is data that contains text and labels, for example, the alpaca dataset. When using a dataset, you need to preprocess the corresponding data. For example, when using the MindSpore framework, you need to convert the dataset to the MindRecord format. -5. **Performing a fine-tuning task:** +6. **Performing a fine-tuning task:** Use the dataset of the fine-tuning task to train the pre-trained model and update the model parameters. If all parameters are fine-tuned, all parameters are updated. After the fine-tuning task is complete, a new model can be obtained. ## MindFormers-based Full-Parameter Fine-Tuning Practice @@ -159,3 +161,5 @@ The multi-node multi-device fine-tuning task is similar to the pretrained task. 3. Set `--run_mode finetune` in the startup script. **run_mode** indicates the running mode, whose value can be **train**, **finetune**, or **predict** (inference). After the task is executed, the **checkpoint** folder is generated in the **mindformers/output** directory, and the model file is saved in this folder. + +To evaluate the tuning effect of the model, you can view [evaluation](evaluation.md) document to understand how to evaluate the accuracy of the model to ensure that the performance of the model meets expectations. In addition, if you want to apply the tuned model to the actual scene, [inference](inference.md) document will guide you how to carry out model inference, helping you use the prediction ability of the model to solve specific problems and provide decision support. \ No newline at end of file diff --git a/docs/mindformers/docs/source_zh_cn/index.rst b/docs/mindformers/docs/source_zh_cn/index.rst index 35e875b588c8f7574f54b59930c75eef5d37ad97..59e4676e032f0b1cfd249332a42bbf1aa1075c3a 100644 --- a/docs/mindformers/docs/source_zh_cn/index.rst +++ b/docs/mindformers/docs/source_zh_cn/index.rst @@ -3,6 +3,12 @@ MindSpore Transformers 文档 MindSpore Transformers(也称MindFormers)套件的目标是构建一个大模型训练、微调、评估、推理、部署的全流程开发套件,提供业内主流的Transformer类预训练模型和SOTA下游任务应用,涵盖丰富的并行特性,期望帮助用户轻松地实现大模型训练和创新研发。 +.. image:: ../source_zh_cn/usage/image/mindformers_operation.png + :alt: user operation flow diagram + :align: center + :width: 200px + :height: 400px + 用户可以参阅 `整体架构 `_ 和 `模型库 `_ 来初步了解MindFormers的架构和模型支持度;参考 `安装 `_ 和 `快速启动 `_ 章节,迅速上手MindFormers。 如果您对MindFormers有任何建议,请通过 `issue `_ 与我们联系,我们将及时处理。 diff --git a/docs/mindformers/docs/source_zh_cn/quick_start/install.md b/docs/mindformers/docs/source_zh_cn/quick_start/install.md index 5db58e822d56461c127cbd906ea4653acc5af74d..f1dc44e5823bdba4ef3c463174666478011c8b9f 100644 --- a/docs/mindformers/docs/source_zh_cn/quick_start/install.md +++ b/docs/mindformers/docs/source_zh_cn/quick_start/install.md @@ -50,4 +50,6 @@ mf.run_check() ```text - INFO - All checks passed, used **** seconds, the environment is correctly set up! -``` \ No newline at end of file +``` + +完成MindFormers的安装后,接下来可以查看[快速启动](source_code_start.md)文档,尝试快速拉起一个简单的任务。 \ No newline at end of file diff --git a/docs/mindformers/docs/source_zh_cn/quick_start/source_code_start.md b/docs/mindformers/docs/source_zh_cn/quick_start/source_code_start.md index cdf8427256458156410f1abe4553ddfe6f6bc51f..effe7b1e2f88c27c340743ab0b8e000ae7606c2c 100644 --- a/docs/mindformers/docs/source_zh_cn/quick_start/source_code_start.md +++ b/docs/mindformers/docs/source_zh_cn/quick_start/source_code_start.md @@ -104,3 +104,5 @@ bash scripts/msrun_launcher.sh "run_mindformer.py \ ## 说明 关于Llama2更多细节,以及更多的启动方式,请具体参考`Llama2` 的 [README](https://gitee.com/mindspore/mindformers/blob/dev/docs/model_cards/llama2.md#llama-2)文档获取更多支持。 + +如果您已经成功启动了基于 Llama2-7B 模型的LoRA低参微调任务,并希望进一步了解MindFormers,可以参考MindFormers使用教程,结合您的实际情况进行接下来的学习。 \ No newline at end of file diff --git a/docs/mindformers/docs/source_zh_cn/usage/image/mindformers_operation.png b/docs/mindformers/docs/source_zh_cn/usage/image/mindformers_operation.png new file mode 100644 index 0000000000000000000000000000000000000000..c33ba8d1f49427c6d5d3cc810ef704fdcf602dfe Binary files /dev/null and b/docs/mindformers/docs/source_zh_cn/usage/image/mindformers_operation.png differ diff --git a/docs/mindformers/docs/source_zh_cn/usage/inference.md b/docs/mindformers/docs/source_zh_cn/usage/inference.md index 8aa7539d829930a7c3e35cfdd4cef045b40ad049..14c80a829073b4d8df0842fec9d70d9ad3dbc156 100644 --- a/docs/mindformers/docs/source_zh_cn/usage/inference.md +++ b/docs/mindformers/docs/source_zh_cn/usage/inference.md @@ -176,3 +176,5 @@ bash scripts/msrun_launcher.sh "python run_mindformer.py \ ## 更多信息 更多关于不同模型的推理示例,请访问[MindFormers 已支持模型库](https://www.mindspore.cn/mindformers/docs/zh-CN/dev/start/models.html) + +完成推理任务之后,可以参考[MindIE服务化部署](mindie_deployment.md)文档,通过MindIE Service部署MindFormers中的大模型。 diff --git a/docs/mindformers/docs/source_zh_cn/usage/parameter_efficient_fine_tune.md b/docs/mindformers/docs/source_zh_cn/usage/parameter_efficient_fine_tune.md index d9972262d9e4405e2a6e6239727ebd7f89daca6c..7b39b8efff9278d6e3ae6043c8ff8ce81ab0550b 100644 --- a/docs/mindformers/docs/source_zh_cn/usage/parameter_efficient_fine_tune.md +++ b/docs/mindformers/docs/source_zh_cn/usage/parameter_efficient_fine_tune.md @@ -96,3 +96,5 @@ bash scripts/msrun_launcher.sh "run_mindformer.py \ --use_parallel True \ --run_mode finetune" 8 ``` + +为了评估模型的微调效果,您可以查看我们的[评测](evaluation.md)文档,了解如何对模型进行准确度的评估,以确保模型的性能符合预期。此外,如果您希望将微调后的模型应用于实际场景,我们的[推理](inference.md)文档将指导您如何进行模型推理,帮助您将模型的预测能力用于解决具体问题和提供决策支持。 diff --git a/docs/mindformers/docs/source_zh_cn/usage/pre_training.md b/docs/mindformers/docs/source_zh_cn/usage/pre_training.md index a41a89d357bb75983f31a289225f731810d19678..b411ee0469066584cc405c9604e305eb7ce5a034 100644 --- a/docs/mindformers/docs/source_zh_cn/usage/pre_training.md +++ b/docs/mindformers/docs/source_zh_cn/usage/pre_training.md @@ -86,4 +86,6 @@ bash scripts/msrun_launcher.sh "run_mindformer.py \ ## 更多信息 -更多关于不同模型的训练示例,请访问[MindFormers已支持模型库](https://www.mindspore.cn/mindformers/docs/zh-CN/dev/start/models.html)。 \ No newline at end of file +更多关于不同模型的训练示例,请访问[MindFormers已支持模型库](https://www.mindspore.cn/mindformers/docs/zh-CN/dev/start/models.html)。 + +在完成预训练之后,可以查看我们的[SFT微调](sft_tuning.md)文档和[低参微调](parameter_efficient_fine_tune.md)文档。这些将指导您如何根据自己的数据集和任务需求,对预训练模型进行微调,以获得更优的性能和更好的适应性。 \ No newline at end of file diff --git a/docs/mindformers/docs/source_zh_cn/usage/sft_tuning.md b/docs/mindformers/docs/source_zh_cn/usage/sft_tuning.md index bc1172ef82f3c69dce510df6e255d36141cd9473..2c432570c568d496ddf97ff91868d4f30ecb4e75 100644 --- a/docs/mindformers/docs/source_zh_cn/usage/sft_tuning.md +++ b/docs/mindformers/docs/source_zh_cn/usage/sft_tuning.md @@ -25,9 +25,11 @@ SFT微调整体包含以下几个部分: 针对选择的预训练模型,可以从HuggingFace模型库中下载预训练的权重。 3. **模型权重转换:** 结合自己所要使用的框架,对已经下载的HuggingFace权重进行权重转换,比如转换为MindSpore框架所支持的ckpt权重。 -4. **数据集准备:** +4. **模型权重转换与切分:** + 结合自己所要微调的模型,对已经转换好的权重进行切分或者开启自动权重切分,参考[分布式权重切分与合并](../function/transform_weight.md) +5. **数据集准备:** 结合微调的目标,选择用于微调任务的数据集,针对大语言模型,微调数据集一般是包含文本和标签的数据,比如alpaca数据集。同时在使用数据集时,需要对数据做相应的预处理,比如使用MindSpore框架时,需要将数据集转换为MindRecord格式。 -5. **执行微调任务:** +6. **执行微调任务:** 使用微调任务的数据集对预训练模型进行训练,更新模型参数,如果是全参微调则会对所有参数进行更新,微调任务完成后,便可以得到新的模型。 ## 基于MindFormers的全参微调实践 @@ -160,3 +162,4 @@ run_mode: 运行模式,train:训练,finetune:微调,predict 任务执行完成后,在mindformers/output目录下,会生成checkpoint文件夹,同时模型文件会保存在该文件夹下。 +为了评估模型的微调效果,您可以查看我们的[评测](evaluation.md)文档,了解如何对模型进行准确度的评估,以确保模型的性能符合预期。此外,如果您希望将微调后的模型应用于实际场景,我们的[推理](inference.md)文档将指导您如何进行模型推理,帮助您将模型的预测能力用于解决具体问题和提供决策支持。 \ No newline at end of file