You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scripts/performance/README.md
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,16 @@
2
2
3
3
## NOTE: This directory will change a lot over the coming weeks
4
4
5
-
- Scripts defined in `scripts/performance` are recipes optimized for performance. These scripts can launch pre-training experiments on Slurm based clusters.
5
+
New runs of exact exported flat recipes should use `scripts/training/train.sh --recipe <function_name>`. The launcher
6
+
discovers text pretraining, text SFT/PEFT, Qwen-VL pretraining, and Wan pretraining recipes automatically and selects
7
+
their forward step. This directory remains the compatibility path for selector-based invocation, dataset replacement,
8
+
topology resizing, and specialized benchmark controls. The training launcher preserves total GPU-count validation,
9
+
the recipe process environment, and mock-data defaults for text SFT/PEFT; it does not inject offline defaults. The
10
+
performance compatibility launcher continues to own its benchmark offline environment.
11
+
Cluster-specific CPU/NUMA binding, Slurm segment sizing, NCCL fabric settings, and `srun` arguments remain user
12
+
supplied.
13
+
14
+
- Scripts defined in `scripts/performance` launch performance-optimized experiments on Slurm-based clusters.
6
15
7
16
## Performance recipe configs
8
17
@@ -11,7 +20,7 @@ launcher resolves recipes from that package by model, task, GPU count, GPU type,
11
20
and config variant.
12
21
13
22
`setup_experiment.py` launches `bootstrap.py` on each rank. The bootstrap resolves and
14
-
applies recipe-owned process settings before importing Torch, then replaces itself with
23
+
applies recipe-owned process settings before importing the training loop, then replaces itself with
15
24
either `run_script.py` for flat performance recipes or `run_recipe.py` for model recipes.
16
25
Each training entrypoint therefore executes only once.
`train.sh` invokes `setup_experiment.py` on a Slurm login node. Library recipes run through `run_recipe.py`; an exact
10
-
flat performance recipe name is translated to the selector interface already supported by `run_script.py`. The setup
11
-
layer owns resources, the container, explicitly forwarded environment variables, and explicit mounts. Without an
12
-
active virtual environment, the shell entry point creates an isolated `nemo-run` environment rather than resolving
13
-
the full GPU training dependency set on the login node.
9
+
`train.sh` invokes `setup_experiment.py` on a Slurm login node and submits `run_recipe.py` directly through Slurm. The
10
+
setup layer only owns resources, the container, explicitly forwarded environment variables, and explicit mounts.
11
+
Recipe selection, dataset construction, and ConfigContainer overrides are resolved inside the training environment.
12
+
Without an active virtual environment, the shell entry point creates an isolated `nemo-run` environment rather than
13
+
resolving the full GPU training dependency set on the login node.
14
14
15
15
`launch_with_nemo_run.py` and `launch_with_sbatch.sh` remain available for their existing specialized workflows; `train.sh` is the compact recipe-oriented path.
16
16
17
17
## Selection rules
18
18
19
-
Choose exactly one of a complete recipe or a model selector. `--recipe` and `--model` are mutually exclusive. The mode
20
-
is inferred from a conventional complete recipe name; pass one of `--mode pretrain`, `--mode sft`, `--mode lora`, or
21
-
`--mode dora` when using `--model` or when the name does not encode it.
19
+
Choose exactly one of a complete recipe or a model selector. `--recipe` and `--model` are mutually exclusive. A complete
20
+
recipe is discovered automatically from its exported function name, whether it is a library or benchmark recipe;
21
+
there is no separate source flag. A model selector requires one of `--mode pretrain`, `--mode sft`, `--mode lora`, or
22
+
`--mode dora`; a conventional complete recipe name infers its mode when `--mode` is omitted.
22
23
23
-
### Complete recipe
24
+
### Library recipe
24
25
25
26
A complete recipe already identifies the model and default training configuration, so do not also pass `--model`:
26
27
@@ -48,38 +49,61 @@ requested adapter scheme.
48
49
--mode pretrain --dataset mock
49
50
```
50
51
51
-
The default forward step is `llm_step`. Pass `--step-func NAME` explicitly for a recipe that needs another registered
52
-
forward step. Common training, sequence-length, parallelism, optimization, and checkpoint fields also have convenience
53
-
flags such as `-ms`/`--max_steps`, `-sl`/`--seq_length`, `-tp`/`--tensor_model_parallel_size`, and `--save_dir`.
54
-
Use trailing `KEY=VALUE` overrides for every other `ConfigContainer` field.
52
+
### Benchmark recipe
55
53
56
-
### Performance recipe
54
+
The training launcher can run exact exported recipes from `src/megatron/bridge/perf_recipes`, including text
55
+
pretraining, text SFT/PEFT, Qwen-VL pretraining, and Wan pretraining. The total allocation must match the GPU count
56
+
encoded by the recipe name; the user selects the node shape, and the Slurm partition must provide the requested
57
+
hardware:
57
58
58
-
Pass the complete exported performance recipe name through the same `--recipe` option; recipe type is inferred:
59
+
`benchmark` is the unified runner's user-facing term. The existing `perf_recipes` package and `scripts/performance/`
0 commit comments