Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/sphinx_doc/source/tutorial/develop_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ Here, `<config_file_path>` is the path to a YAML configuration file, which shoul
Once started, the model will keep running and wait for debug instructions; it will not exit automatically. You can then run the following command in another terminal to debug your workflow:

```bash
trinity debug --config <config_file_path> --module workflow --output_file <output_file_path> --plugin_dir <plugin_dir>
trinity debug --config <config_file_path> --module workflow --output-file <output_file_path> --plugin-dir <plugin_dir>
```

- `<config_file_path>`: Path to the YAML configuration file, usually the same as used for starting the inference model.
Expand Down
4 changes: 2 additions & 2 deletions docs/sphinx_doc/source/tutorial/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ ray start --head

**A:** The following parameters may be helpful:

- For trainer, adjust `actor_rollout_ref.actor.ppo_micro_batch_size_per_gpu` when `actor_rollout_ref.actor.use_dynamic_bsz=false`; adjust `actor_rollout_ref.actor.ppo_max_token_len_per_gpu` and `actor_rollout_ref.actor.ulysses_sequence_parallel_size` when `actor_rollout_ref.actor.use_dynamic_bsz=true`. Setting `actor_rollout_ref.actor.entropy_from_logits_with_chunking=true` may also help.
- For trainer, adjust `trainer.max_token_len_per_gpu` when `trainer.use_dynamic_bsz=false`; adjust `trainer.ppo_max_token_len_per_gpu` and `trainer.ulysses_sequence_parallel_size` when `trainer.use_dynamic_bsz=true`. Setting `trainer.trainer_config.actor_rollout_ref.actor.entropy_from_logits_with_chunking=true` may also help.
- For explorer, adjust `explorer.rollout_model.tensor_parallel_size`.


Expand All @@ -113,7 +113,7 @@ To debug a new workflow, use Trinity-RFT's debug mode with the following steps:

1. Launch the inference model via `trinity debug --config <config_file_path> --module inference_model`

2. Debug the workflow in another terminal via `trinity debug --config <config_file_path> --module workflow --output_file <output_file_path> --plugin_dir <plugin_dir>`
2. Debug the workflow in another terminal via `trinity debug --config <config_file_path> --module workflow --output-file <output_file_path> --plugin-dir <plugin_dir>`

Please refer to {ref}`Workflow Development Guide <Workflows>` section for details.

Expand Down
16 changes: 16 additions & 0 deletions docs/sphinx_doc/source/tutorial/trinity_configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,12 @@ explorer:
tensor_parallel_size: 1
eval_interval: 100
eval_on_startup: True
over_rollout:
ratio: 0.0
wait_after_min: 30.0
dynamic_timeout:
enable: false
ratio: 3.0
```

- `name`: Name of the explorer. This name will be used as the Ray actor's name, so it must be unique.
Expand All @@ -381,6 +387,12 @@ explorer:
- `auxiliary_models`: Additional models used for custom workflows.
- `eval_interval`: Interval (in steps) for evaluating the model.
- `eval_on_startup`: Whether to evaluate the model on startup. More precisely, at step 0 with the original model, so it will not be triggered when restarting.
- `over_rollout`: [Experimental] Configurations for over-rollout mechanism, which allows the explorer to proceed with fewer tasks than the full batch size. It effectively increases throughput in scenarios where some tasks take significantly longer to complete than others. Only applicable when dynamic synchronization (`synchronizer.sync_style` is not `fixed`) is used.
- `ratio`: Explorer will only wait for `(1 - ratio) * batch_size` of tasks at each step. Default is `0.0`, meaning waiting for all tasks.
- `wait_after_min`: After reaching the minimum task threshold, wait for this many seconds before proceeding. Default is `30.0` seconds.
- `dynamic_timeout`: [Experimental] Configurations for dynamic timeout mechanism, which adjusts the timeout for each task based on the average time taken for successful tasks.
- `enable`: Whether to enable dynamic timeout. Default is `false`.
- `ratio`: The timeout for each task is dynamically set to `average_time_per_success_task * ratio`. Default is `3.0`.

---

Expand All @@ -394,6 +406,7 @@ synchronizer:
sync_interval: 10
sync_offset: 0
sync_timeout: 1200
sync_style: 'fixed'
```

- `sync_method`: Method of synchronization. Options:
Expand All @@ -402,6 +415,9 @@ synchronizer:
- `sync_interval`: Interval (in steps) of model weight synchronization between trainer and explorer.
- `sync_offset`: Offset (in steps) of model weight synchronization between trainer and explorer. The explorer can run `sync_offset` steps before the trainer starts training.
- `sync_timeout`: Timeout duration for synchronization.
- `sync_style`: Style of synchronization. Options:
- `fixed`: The explorer and trainer synchronize weights every `sync_interval` steps.
- `dynamic_by_explorer`: The explorer notifies the trainer to synchronize weights after completing `sync_interval` steps, regardless of how many steps the trainer has completed at this point.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx_doc/source_zh/tutorial/develop_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ trinity debug --config <config_file_path> --module inference_model
模型启动后会持续运行并等待调试指令,不会自动退出。此时,你可在另一个终端执行如下命令进行 Workflow 调试:

```bash
trinity debug --config <config_file_path> --module workflow --output_file <output_file_path> --plugin_dir <plugin_dir>
trinity debug --config <config_file_path> --module workflow --output-file <output_file_path> --plugin-dir <plugin_dir>
```

- `config_file_path`:YAML 配置文件路径,通常与启动推理模型时使用的配置文件相同。
Expand Down
4 changes: 2 additions & 2 deletions docs/sphinx_doc/source_zh/tutorial/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ ray start --head

**A:** 以下参数可能有所帮助:

- 对于 trainer:当 `actor_rollout_ref.actor.use_dynamic_bsz=false` 时,调整 `actor_rollout_ref.actor.ppo_micro_batch_size_per_gpu`;当 `actor_rollout_ref.actor.use_dynamic_bsz=true` 时,调整 `actor_rollout_ref.actor.ppo_max_token_len_per_gpu` 和 `actor_rollout_ref.actor.ulysses_sequence_parallel_size`。设置 `actor_rollout_ref.actor.entropy_from_logits_with_chunking=true` 也可能有帮助。
- 对于 trainer:当 `trainer.use_dynamic_bsz=false` 时,调整 `trainer.max_token_len_per_gpu`;当 `trainer.use_dynamic_bsz=true` 时,调整 `trainer.ppo_max_token_len_per_gpu` 和 `trainer.ulysses_sequence_parallel_size`。设置 `trainer.trainer_config.actor_rollout_ref.actor.entropy_from_logits_with_chunking=true` 也可能有帮助。
- 对于 explorer:调整 `explorer.rollout_model.tensor_parallel_size`。

## 第三部分:调试方法
Expand All @@ -113,7 +113,7 @@ trinity run --config grpo_gsm8k/gsm8k.yaml 2>&1 | tee debug.log

1. 启动推理模型: `trinity debug --config <config_file_path> --module inference_model`

2. 在另一个终端中进行工作流的调试:`trinity debug --config <config_file_path> --module workflow --output_file <output_file_path> --plugin_dir <plugin_dir>`
2. 在另一个终端中进行工作流的调试:`trinity debug --config <config_file_path> --module workflow --output-file <output_file_path> --plugin-dir <plugin_dir>`

更多详细信息,请参阅{ref}`工作流开发指南 <Workflows>`章节。

Expand Down
10 changes: 10 additions & 0 deletions docs/sphinx_doc/source_zh/tutorial/trinity_configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,12 @@ explorer:
- `auxiliary_models`: 用于自定义工作流的额外模型。
- `eval_interval`: 模型评估的间隔(以步为单位)。
- `eval_on_startup`: 是否在启动时评估模型。更准确地说,是在第 0 步使用原始模型评估,因此重启时不会触发。
- `over_rollout`: [实验性] 超量 rollout 机制的配置,允许 explorer 在每个步骤中使用少于完整批次大小的任务继续进行。这在某些任务显著耗时较长的场景中能有效地提高吞吐量。仅当使用动态同步(`synchronizer.sync_style` 不是 `fixed`)时适用。
- `ratio`: explorer 在每个步骤中仅等待 `(1 - ratio) * batch_size` 的任务。默认为 `0.0`,表示等待所有任务。
- `wait_after_min`: 达到最小任务阈值后,等待此秒数后再继续。
- `dynamic_timeout`: [实验性] 动态超时机制的配置,根据成功任务的平均耗时调整每个任务的超时时间。
- `enable`: 是否启用动态超时。默认为 `false`。
- `ratio`: 每个任务的超时时间动态设置为 `average_time_per_success_task * ratio`。默认为 `3.0`。

---

Expand All @@ -391,6 +397,7 @@ synchronizer:
sync_interval: 10
sync_offset: 0
sync_timeout: 1200
sync_style: 'fixed'
```

- `sync_method`: 同步方法。选项:
Expand All @@ -399,6 +406,9 @@ synchronizer:
- `sync_interval`: trainer 和 explorer 之间模型权重同步的间隔(步)。
- `sync_offset`: trainer 和 explorer 之间模型权重同步的偏移量(步)。explorer 可在 trainer 开始训练前运行 `sync_offset` 步。
- `sync_timeout`: 同步超时时间。
- `sync_style`: 同步风格。选项:
- `fixed`: explorer 和 trainer 每隔 `sync_interval` 步同步一次权重。
- `dynamic_by_explorer`: explorer 在完成 `sync_interval` 步后通知 trainer 同步权重,而不管此时 trainer 已完成多少步。

---

Expand Down
Loading