Skip to content

Commit

Permalink
[Docs] Update docs/zh_cn outline (#556)
Browse files Browse the repository at this point in the history
update
  • Loading branch information
LZHgrla authored Apr 10, 2024
1 parent 3678629 commit 8b1e997
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 10 deletions.
3 changes: 2 additions & 1 deletion docs/zh_cn/accelerate/pack_to_max_length.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ XTuner 中提供的 config 文件中默认使用了“数据集拼接”这一
若不想使用数据拼接,在 config 中将 ``pack_to_max_length`` 设为 False 即可,
此时 config 中的 ``max_length`` 字段表示单条数据最长的 token 数,整个 batch 会被 pad 成当前 batch 内最长的一条数据的长度。
同时,XTuner 支持一种数据集采样策略 (``LengthGroupedSampler``),在不使用数据拼接策略时可以保证在一个 batch 中的数据长度尽可能接近,
以减少 Pad 对计算资源的浪费。详细用法请参考 `LengthGroupedSampler 文档 <https://github.com/InternLM/xtuner/blob/main/docs/zh_cn/training/length_grouped_sampler.md>`_
以减少 Pad 对计算资源的浪费。详细用法请参考
\ :ref:`LengthGroupedSampler 文档 <length_grouped_sampler>` \
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _training_extreme_long_sequence:
.. _train_extreme_long_sequence:

序列并行:训练极长序列大模型的系统优化
===============================
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _train_large_scale_dataset:

大规模数据集训练
================

Expand Down
7 changes: 4 additions & 3 deletions docs/zh_cn/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
training/multi_modal_dataset.rst
training/open_source_dataset.rst
training/visualization.rst

.. toctree::
:maxdepth: 2
:caption: 加速训练
Expand All @@ -66,9 +66,10 @@
accelerate/flash_attn.rst
accelerate/varlen_flash_attn.rst
accelerate/hyper_parameters.rst
accelerate/length_grouped_sampler.rst
accelerate/train_large_scale_dataset.rst
accelerate/train_extreme_long_sequence.rst
accelerate/benchmark.rst
training/train_on_large_scale_dataset.rst
training/training_extreme_long_sequence.rst

.. toctree::
:maxdepth: 2
Expand Down
4 changes: 2 additions & 2 deletions docs/zh_cn/internevo_migration/internevo_migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ xtuner internevo
=========== ==========

注:使用 XTuner 提供的序列并行算法可以进一步提升训练速度,使用方式请参考
\ :ref:`序列并行文档 <training_extreme_long_sequence>` \
\ :ref:`序列并行文档 <train_extreme_long_sequence>` \

在从 InternEvo (train_internlm) 向 XTuner
迁移的过程中,我们需要关注模型、数据以及训练策略这三个方面的适配问题。后续内容将详细阐述如何进行适配。
Expand Down Expand Up @@ -320,4 +320,4 @@ global_batch_size 与 InternEvo 一致,需要在配置文件中综合调整
...)
XTuner 序列并行的详细用法请参考
\ :ref:`序列并行文档 <training_extreme_long_sequence>` \
\ :ref:`序列并行文档 <train_extreme_long_sequence>` \
6 changes: 3 additions & 3 deletions docs/zh_cn/training/modify_settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ XTuner 使用 MMEngine 的「纯 Python 风格的配置文件」,直接利用
#######################################################################
# Model
pretrained_model_name_or_path = 'internlm/internlm2-chat-7b' # 设置 LLM 路径或 HuggingFace Hub ID
use_varlen_attn = False # 是否使用 varlen_attention,具体可参考 [TODO]
use_varlen_attn = False # 是否使用 varlen_attention
# Data
data_path = 'timdettmers/openassistant-guanaco' # 设置 dataset 路径或 HuggingFace Hub ID,以用于 datasets.load_dataset
prompt_template = PROMPT_TEMPLATE.internlm2_chat # 设置对话模版
max_length = 2048 # 设置训练数据截断长度
pack_to_max_length = True # 是否将多条样本打包为一条最长长度的样本,具体可参考 [TODO]
pack_to_max_length = True # 是否将多条样本打包为一条最长长度的样本
# Scheduler & Optimizer
batch_size = 1 # per_device # 每个设备的样本个数
Expand Down Expand Up @@ -329,7 +329,7 @@ XTuner 内置的配置文件以 QLoRA 微调为主,但并不意味着 XTuner
数据集
~~~~~~

请参考相关文档 [TODO]
请参考 `训练` 章节文档。

优化器
~~~~~~
Expand Down
1 change: 1 addition & 0 deletions examples/demo_data/multi_turn_2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ log_processor = dict(by_epoch=False)
cd ./examples/demo_data/multi_turn_2
xtuner train config.py
```

# Multi-turn Conversation Example 2

## Data
Expand Down
1 change: 1 addition & 0 deletions examples/demo_data/single_turn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ log_processor = dict(by_epoch=False)
cd ./examples/demo_data/single_turn
xtuner train config.py
```

# Single-turn Conversation Example

## Data
Expand Down

0 comments on commit 8b1e997

Please sign in to comment.