Skip to content

Commit 40bb080

Browse files
kellyguo11StafaHAntoineRichard
authored
[Backport release/3.0.0] Consolidate multi-GPU documentation (#7458)
## Description Backports #7182 to `release/3.0.0` by cherry-picking merged commit `c1b0cbd25c488d3c30d070636f8b402e9cbcdc17`. This consolidates the multi-GPU guide, standardizes benchmark workflows on `startup_multigpu`, `runtime_multigpu`, and `training_multigpu`, and retains the hyphenated forms as deprecated compatibility aliases. No new dependencies. ## Type of change - Documentation update - Non-breaking benchmark CLI change with deprecated compatibility aliases ## Release backport Not applicable; this PR targets the active release branch. ## Validation - [x] Focused benchmark tests: 22 passed - [x] `uv run isaaclab -f` equivalent with `ISAACLAB_CHANGELOG_BASE_REF=release/3.0.0`: passed - [x] Warning-as-error docs build: passed - [x] Backport patch ID matches merged #7182 The host was macOS, while the project lock and `ovstage` wheel support Linux/Windows. Validation therefore used a temporary uv-managed Python 3.12 environment; Sphinx autodoc mocked only the unavailable Linux `ovstage` module. ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove the canonical and compatibility command dispatch - [x] I have included the original changelog fragment for the touched package - [x] The original author already exists in `CONTRIBUTORS.md` Signed-off-by: Mustafa H <34825877+StafaH@users.noreply.github.com> Co-authored-by: Mustafa H <34825877+StafaH@users.noreply.github.com> Co-authored-by: Antoine RICHARD <antoiner@nvidia.com>
1 parent a4b93d6 commit 40bb080

13 files changed

Lines changed: 376 additions & 532 deletions

File tree

docs/source/features/include/cluster_details.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ conversion is needed and there is no code copy step -- the image is the unit of
204204
205205
The workflow definition lives in ``docker/cluster/osmo_multi_gpu_workflow.yaml``. It requests a
206206
single node and scales training across the GPUs on that node through the
207-
:ref:`train_multigpu <train-multigpu-command>` command. The following parameters can be overridden
207+
:ref:`train_multigpu <train_multigpu-command>` command. The following parameters can be overridden
208208
at submission time:
209209
210210
.. list-table::

docs/source/features/multi_gpu.rst

Lines changed: 302 additions & 430 deletions
Large diffs are not rendered by default.

docs/source/setup/quickstart.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,12 @@ Benchmark a task
299299
* - ``play``
300300
- Trained-policy rollout throughput. Requires ``--rl_library`` and
301301
``--checkpoint``.
302-
* - ``-multigpu``
303-
- Run ``startup``, ``runtime``, or ``training`` across multiple GPUs by adding the suffix ``-multigpu``. For example, ``runtime-multigpu``.
302+
* - ``_multigpu``
303+
- Run ``startup``, ``runtime``, or ``training`` across multiple GPUs by
304+
adding the suffix ``_multigpu``. For example, ``runtime_multigpu``.
304305

305-
See :ref:`testing_benchmarks` for warm-up, formatters, multi-GPU details, and
306-
how to read results.
306+
See :ref:`testing_benchmarks` for benchmark fundamentals and
307+
:ref:`train_multigpu-command` for multi-GPU training and benchmarks.
307308

308309
Next steps
309310
----------

docs/source/testing/benchmarks.rst

Lines changed: 5 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Choose A Workflow
3232
* - Launch, import, configuration, scene creation, or first-step latency
3333
- ``startup``
3434
* - Any of the above across several GPUs
35-
- ``<workflow>-multigpu``
35+
- ``<workflow>_multigpu``
3636
* - One asset or sensor operation
3737
- :ref:`testing_micro_benchmarks`
3838

@@ -343,90 +343,10 @@ they established final policy quality.
343343
Multi-GPU
344344
---------
345345

346-
Use It When
347-
~~~~~~~~~~~
348-
349-
Append ``-multigpu`` to ``startup``, ``runtime``, or ``training`` to run the same
350-
workflow with one rank per GPU. Use it to measure synchronized multi-GPU training
351-
throughput, or to measure how much a workflow slows down when every GPU on the
352-
node is busy.
353-
354-
Command
355-
~~~~~~~
356-
357-
.. code-block:: bash
358-
359-
./isaaclab.sh benchmark training-multigpu \
360-
--rl_library rsl_rl \
361-
--num_gpus 2 \
362-
--task Isaac-Cartpole-Direct \
363-
--num_envs 4096 \
364-
--max_iterations 100 \
365-
--seed 42 \
366-
--visualizer none \
367-
--output_path ./benchmark_results/multigpu \
368-
physics=isaacsim_physx
369-
370-
The launcher accepts ``--num_gpus``, ``--nnodes``, ``--node_rank``, and the
371-
``torchrun`` rendezvous options, exactly like :ref:`train-multigpu-command`. Every
372-
other argument is forwarded to the single-GPU workflow unchanged. Add ``--dry_run``
373-
to print the ``torchrun`` command without running it, and ``--log_all_ranks`` to
374-
show console output from every rank instead of local rank 0 only.
375-
376-
For a multi-node run, issue the same command on every node with a distinct
377-
``--node_rank``:
378-
379-
.. code-block:: bash
380-
381-
./isaaclab.sh benchmark training-multigpu \
382-
--rl_library rsl_rl --nnodes 2 --node_rank 0 --num_gpus 8 \
383-
--rdzv_backend c10d --rdzv_endpoint host0:29400 --rdzv_id bench \
384-
--task Isaac-Cartpole-Direct
385-
386-
``training-multigpu`` supports ``rsl_rl``, ``rl_games``, and ``skrl`` with Torch. It
387-
does not support skrl JAX or SB3, and it rejects ``--video``,
388-
``--capture_env_sensors``, and ``--check_success``, none of which are meaningful
389-
across ranks. Use :ref:`train-multigpu-command` for general distributed training.
390-
391-
Read The Result
392-
~~~~~~~~~~~~~~~
393-
394-
``--num_envs`` is the number of environments **per rank**, and each rank creates its
395-
own Isaac Lab instance on its own GPU. Only global rank 0 writes a bundle. What that
396-
bundle covers depends on the workflow, and ``extra`` records it:
397-
398-
.. list-table::
399-
:header-rows: 1
400-
:widths: 30 70
401-
402-
* - ``extra`` field
403-
- Meaning
404-
* - ``world_size``, ``local_world_size``, ``num_nodes``
405-
- Rank layout of the job.
406-
* - ``num_envs_per_rank``
407-
- Environments hosted by each rank.
408-
* - ``workload_scope``
409-
- ``global`` for ``training-multigpu``: ranks train in lockstep, so ``run.num_envs``,
410-
``runtime.steps_per_iteration``, and every FPS field cover all ranks.
411-
``rank0`` for ``startup-multigpu`` and ``runtime-multigpu``: those ranks run
412-
independent workloads, so the reported values are rank 0's own, measured while
413-
the other ranks contend for the same host.
414-
* - ``measurement_scope``
415-
- ``rank0_process`` — timings, learning curves, CPU, and RAM come from rank 0 alone.
416-
* - ``gpu_measurement_scope``
417-
- ``rank0_node`` — ``resources.devices`` reports every GPU visible to rank 0, so a
418-
single-node run shows all ranks. ``resources.gpu_util_pct`` and
419-
``resources.gpu_mem_gb`` remain scoped to rank 0's own device.
420-
421-
Do Not Infer
422-
~~~~~~~~~~~~
423-
424-
Do not compare a multi-GPU result against a single-GPU result at the same
425-
``--num_envs``: the multi-GPU run has ``world_size`` times as many environments. To
426-
measure scaling, compare the global throughput of an ``N``-GPU run against ``N``
427-
times the throughput of a single-GPU run at the same per-rank environment count. Do
428-
not read ``startup-multigpu`` or ``runtime-multigpu`` throughput as a global rate;
429-
their ``workload_scope`` is ``rank0``, and the other ranks were not measured.
346+
Append ``_multigpu`` to ``startup``, ``runtime``, or ``training`` to run one
347+
benchmark rank per GPU. The :ref:`train_multigpu-command` guide is the canonical
348+
reference for the three workflows, launcher options, multi-node setup, supported
349+
RL libraries, and result interpretation.
430350

431351
Startup Profiling
432352
-----------------
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Changed
2+
^^^^^^^
3+
4+
* Standardized multi-GPU benchmark commands on the underscore suffix. Replace
5+
``startup-multigpu``, ``runtime-multigpu``, and ``training-multigpu`` with
6+
``startup_multigpu``, ``runtime_multigpu``, and ``training_multigpu``. The hyphenated forms
7+
remain available as deprecated aliases.

source/isaaclab/isaaclab/benchmark/dispatch.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def run_benchmark_request(request: BenchmarkRequest) -> BenchmarkResult:
7070
def run_benchmark_cli(argv: list[str] | None = None) -> int:
7171
"""Run a runtime, startup, training, or play benchmark from CLI arguments.
7272
73-
Appending ``-multigpu`` to a workflow name runs it across several GPUs; see
73+
Appending ``_multigpu`` to a workflow name runs it across several GPUs; see
7474
:mod:`isaaclab.benchmark.entrypoints.multigpu`.
7575
"""
7676
from .entrypoints import multigpu
@@ -79,14 +79,27 @@ def run_benchmark_cli(argv: list[str] | None = None) -> int:
7979
argv = sys.argv[1:]
8080
argv = _fuse_kit_args(argv)
8181
multigpu_workflows = tuple(f"{name}{multigpu.MULTIGPU_SUFFIX}" for name in multigpu.MULTIGPU_WORKFLOWS)
82+
legacy_multigpu_workflows = tuple(
83+
f"{name}{multigpu.LEGACY_MULTIGPU_SUFFIX}" for name in multigpu.MULTIGPU_WORKFLOWS
84+
)
8285
parser = argparse.ArgumentParser(description="Run an Isaac Lab benchmark.")
83-
parser.add_argument("workflow", choices=(*WORKFLOW_MODULES, *_RL_WORKFLOW_MODULES, *multigpu_workflows))
86+
parser.add_argument(
87+
"workflow",
88+
choices=(*WORKFLOW_MODULES, *_RL_WORKFLOW_MODULES, *multigpu_workflows, *legacy_multigpu_workflows),
89+
)
8490
if not argv or argv[0] in ("-h", "--help"):
8591
parser.parse_args(argv)
8692
selected = parser.parse_args(argv[:1])
8793
if selected.workflow in multigpu_workflows:
8894
workflow = selected.workflow[: -len(multigpu.MULTIGPU_SUFFIX)]
8995
return multigpu.run_multigpu_benchmark_cli(workflow, argv[1:])
96+
if selected.workflow in legacy_multigpu_workflows:
97+
workflow = selected.workflow[: -len(multigpu.LEGACY_MULTIGPU_SUFFIX)]
98+
print(
99+
f"'{selected.workflow}' is deprecated. Use '{workflow}{multigpu.MULTIGPU_SUFFIX}' instead.",
100+
file=sys.stderr,
101+
)
102+
return multigpu.run_multigpu_benchmark_cli(workflow, argv[1:])
90103
if selected.workflow in _RL_WORKFLOW_MODULES:
91104
return _run_rl_cli(selected.workflow, argv[1:])
92105
module = importlib.import_module(WORKFLOW_MODULES[selected.workflow])

source/isaaclab/isaaclab/benchmark/distributed.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def from_env(cls, enabled: bool, *, workflow: str = "training") -> DistributedCo
5959
if "RANK" not in os.environ or "WORLD_SIZE" not in os.environ:
6060
raise ValueError(
6161
"--distributed was requested but no distributed launcher exported RANK and WORLD_SIZE."
62-
f" Launch the benchmark with `isaaclab benchmark {workflow}-multigpu`."
62+
f" Launch the benchmark with `isaaclab benchmark {workflow}_multigpu`."
6363
)
6464
return cls(
6565
enabled=True,
@@ -164,7 +164,7 @@ def add_distributed_arg(parser: argparse.ArgumentParser) -> None:
164164
action="store_true",
165165
default=False,
166166
help=(
167-
"Run as one rank of a distributed launch. Set automatically by `isaaclab benchmark <workflow>-multigpu`."
167+
"Run as one rank of a distributed launch. Set automatically by `isaaclab benchmark <workflow>_multigpu`."
168168
),
169169
)
170170

source/isaaclab/isaaclab/benchmark/entrypoints/multigpu.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
1616
Usage example::
1717
18-
uv run isaaclab benchmark startup-multigpu \\
18+
uv run isaaclab benchmark startup_multigpu \\
1919
--task Isaac-Cartpole-Direct \\
2020
--num_gpus 2 \\
2121
presets=newton_mjwarp
2222
23-
uv run isaaclab benchmark training-multigpu \\
23+
uv run isaaclab benchmark training_multigpu \\
2424
--rl_library rsl_rl \\
2525
--num_gpus 2 \\
2626
--task Isaac-Cartpole-Direct \\
@@ -36,9 +36,12 @@
3636

3737
WORKER_SCRIPT = str(Path(__file__).resolve())
3838

39-
MULTIGPU_SUFFIX = "-multigpu"
39+
MULTIGPU_SUFFIX = "_multigpu"
4040
"""Suffix that turns a benchmark workflow name into its multi-GPU variant."""
4141

42+
LEGACY_MULTIGPU_SUFFIX = "-multigpu"
43+
"""Deprecated suffix retained for command-line compatibility."""
44+
4245
MULTIGPU_WORKFLOWS = ("startup", "runtime", "training")
4346
"""Benchmark workflows that offer a multi-GPU variant."""
4447

source/isaaclab/isaaclab/benchmark/entrypoints/runtime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
--num_envs 16 --num_steps 1000 --warmup_steps 50 \\
1919
presets=newton_mjwarp --visualizer none
2020
21-
Use ``isaaclab benchmark runtime-multigpu`` to measure rank 0 while every GPU steps an
21+
Use ``isaaclab benchmark runtime_multigpu`` to measure rank 0 while every GPU steps an
2222
independent workload; see :mod:`isaaclab.benchmark.entrypoints.multigpu`.
2323
"""
2424

source/isaaclab/isaaclab/benchmark/entrypoints/startup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
--num_envs 16 \\
2626
presets=newton_mjwarp
2727
28-
Use ``isaaclab benchmark startup-multigpu`` to profile rank 0 while every GPU launches
28+
Use ``isaaclab benchmark startup_multigpu`` to profile rank 0 while every GPU launches
2929
concurrently; see :mod:`isaaclab.benchmark.entrypoints.multigpu`.
3030
"""
3131

0 commit comments

Comments
 (0)