- Notifications
You must be signed in to change notification settings - Fork 2.1k
add pretrain dataset #2803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Jonathans575 merged 11 commits into PaddlePaddle:develop from Jonathans575:dev_pretrain Oct 30, 2025
Merged
add pretrain dataset #2803
Changes from all commits
Commits
Show all changes
11 commits Select commit Hold shift + click to select a range
6ae04ac add pretrain dataset
Jonathans575 9b838c5 add pretrain dataset
Jonathans575 09e4d5a add pretrain dataset
Jonathans575 e1b3bbd add pretrain dataset
Jonathans575 bfe382a add pretrain dataset
Jonathans575 c45c8ea add pretrain dataset
Jonathans575 ee24ae8 add pretrain dataset
Jonathans575 87519c0 add pretrain dataset
Jonathans575 3e6a363 add pretrain dataset
Jonathans575 0e76932 add pretrain dataset
Jonathans575 60af300 add pretrain dataset
Jonathans575 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| # 命令行界面 | ||
| | ||
| ## 概述 | ||
| | ||
| CLI(Command Line Interface)提供基于终端的程序交互,通过参数化配置,高效灵活地执行模型训练、推理和评估任务。 | ||
| | ||
| ## 快速入门 | ||
| | ||
| **安装** | ||
| | ||
| 在PaddleFormers根目录下运行: | ||
| ```bash | ||
| python -m pip install -e . | ||
| ``` | ||
| | ||
| 验证安装: | ||
| ```bash | ||
| paddleformers-cli help | ||
| ``` | ||
| | ||
| 预期输出: | ||
| ``` | ||
| ------------------------------------------------------------ | ||
| | Usage: | | ||
| | paddleformers-cli train : model finetuning | | ||
| | paddleformers-cli export : model export | | ||
| | paddleformers-cli help: show helping info | | ||
| ------------------------------------------------------------ | ||
| ``` | ||
| | ||
| **GPU配置** | ||
| | ||
| 默认情况下,CLI 中使用所有可用的 GPU。 | ||
| 如果您想指定某些 GPU,请在运行 CLI 之前设置 CUDA_VISIBLE_DEVICES: | ||
| | ||
| ```bash | ||
| # Single GPU | ||
| export CUDA_VISIBLE_DEVICES=0 | ||
| # Multi GPUs | ||
| export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 | ||
| | ||
| # Single XPU | ||
| export XPU_VISIBLE_DEVICES=0 | ||
| # Multi XPUs | ||
| export XPU_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 | ||
| | ||
| # Single NPU | ||
| export ASCEND_RT_VISIBLE_DEVICES=0 | ||
| # Multi NPUs | ||
| export ASCEND_RT_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 | ||
| ``` | ||
| | ||
| * 注:在`Chat`模块,CUDA_VISIBLE_DEVICES配置的GPU数量应该等于`tensor_parallel_degree`在配置中。 | ||
| 或者,您也可以取消设置 CUDA_VISIBLE_DEVICES。 | ||
| | ||
| # 1. CLI 用法 | ||
| | ||
| 使用 **Qwen/Qwen3-0.6B-Base** 模型的示例: | ||
| | ||
| ## 1.1.聊天 | ||
| 待补充 | ||
| | ||
| ## 1.2.模型预训练 | ||
| | ||
| ```bash | ||
| # Example 1: SFT-Full using online dataset | ||
| paddleformers-cli train examples/config/pt/full.yaml | ||
| # Example 2: SFT-Full using offline dataset | ||
| paddleformers-cli train examples/config/pt/full_offline_data.yaml | ||
| ``` | ||
| | ||
| ## 1.3.模型微调 | ||
| | ||
| ### 1.3.1. SFT 和 LoRA 微调 | ||
| ```bash | ||
| # Example 1: SFT | ||
| paddleformers-cli train examples/config/sft/lora.yaml | ||
| # Example 2: SFT-Full | ||
| paddleformers-cli train examples/config/sft/full.yaml | ||
| ``` | ||
| | ||
| ### 1.3.2. DPO 和 LoRA 微调 | ||
| ```bash | ||
| # Example 1: 8K seq length, DPO | ||
| paddleformers-cli train examples/config/dpo/full.yaml | ||
| # Example 2: 8K seq length, DPO-LoRA | ||
| paddleformers-cli train examples/config/dpo/lora.yaml | ||
| ``` | ||
| | ||
| ## 1.4.模型评估 | ||
| 待补充 | ||
| | ||
| ## 1.5.模型导出 | ||
| ```bash | ||
| paddleformers-cli export examples/config/run_export.yaml | ||
| ``` | ||
| | ||
| ## 1.6.多节点训练 | ||
| ```bash | ||
| NNODES={num_nodes} MASTER_ADDR={your_master_addr} MASTER_PORT={your_master_port} CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 paddleformers-cli train examples/config/sft_full.yaml | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.