Skip to content

Commit 51bb3bb

Browse files
authored
Refine training section for Isaac Lab and RSL-RL
Enhanced clarity and detail in the training workflow for reinforcement learning policy using Isaac Lab and RSL-RL. Added specific stages of the RL training pipeline and improved explanations of training parameters and evaluation.
1 parent 71dc90d commit 51bb3bb

1 file changed

Lines changed: 36 additions & 25 deletions

File tree

  • content/learning-paths/laptops-and-desktops/dgx_spark_isaac_robotics

content/learning-paths/laptops-and-desktops/dgx_spark_isaac_robotics/4_isaac_rfl.md

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ layout: learningpathall
88

99
## Train a reinforcement learning policy using Isaac Lab and RSL-RL
1010

11-
In this section you will train a reinforcement learning (RL) policy for the [Unitree] (https://www.unitree.com/) H1 humanoid robot to walk over rough terrain. You will use Isaac Lab's RSL-RL integration, which implements the Proximal Policy Optimization (PPO) algorithm. By the end of this section you will understand the full training pipeline, including task configuration, PPO hyperparameters, and policy evaluation.
11+
In this section you will train a reinforcement learning (RL) policy for the [Unitree] (https://www.unitree.com/) H1 humanoid robot to walk over rough terrain. The training workflow uses Isaac Lab’s integration with the RSL-RL library, which implements the Proximal Policy Optimization (PPO) algorithm. This integration connects Isaac Sim’s physics simulation with an efficient RL training pipeline. By the end of this section you will understand the key stages of the RL training pipeline, including:
12+
* Task configuration and environment selection
13+
* PPO training parameters and rollout collection
14+
* Monitoring training progress
15+
* Evaluating the trained policy in simulation
1216

1317
## What is RSL-RL?
1418

@@ -19,11 +23,10 @@ RSL-RL (Robotic Systems Lab Reinforcement Learning) is a lightweight RL library
1923
- Asymmetric actor-critic support (the critic can observe more than the actor)
2024
- Minimal dependencies and tight integration with Isaac Lab
2125

22-
Isaac Lab provides ready-to-use training scripts for RSL-RL under `scripts/reinforcement_learning/rsl_rl/`.
26+
Isaac Lab includes ready-to-use training scripts for RSL-RL under `scripts/reinforcement_learning/rsl_rl/`.
2327

2428
## Step 1: Understand the training task
25-
26-
The task you will train is **Isaac-Velocity-Rough-H1-v0**. This is a locomotion task where the [Unitree H1](https://www.unitree.com/h1/) humanoid robot must track a velocity command while navigating rough terrain.
29+
In this section you will train the **Isaac-Velocity-Rough-H1-v0** environment. This is a locomotion task where the [Unitree H1](https://www.unitree.com/h1/) humanoid robot must track a velocity command while navigating rough terrain.
2730

2831
The task details are:
2932

@@ -44,7 +47,7 @@ This setup provides a high-dimensional control problem ideal for testing locomot
4447

4548
## Step 2: Launch the training
4649

47-
Navigate to the Isaac Lab directory and start training in headless mode for maximum performance:
50+
Navigate to the Isaac Lab directory and start the training job. Running in headless mode disables visualization so that more GPU resources can be used for physics simulation and neural network computation:
4851

4952
```bash
5053
cd ~/IsaacLab
@@ -54,9 +57,9 @@ export LD_PRELOAD="$LD_PRELOAD:/lib/aarch64-linux-gnu/libgomp.so.1"
5457
--headless
5558
```
5659

57-
Once the training starts, you will see log messages reporting iteration progress, rewards, and performance statistics.
58-
59-
```
60+
Once training begins, the terminal displays iteration progress, reward statistics, and performance metrics.
61+
Example output:
62+
```output
6063
Learning iteration 15/3000
6164
6265
Computation: 65955 steps/s (collection: 1.256s, learning 0.235s)
@@ -92,13 +95,17 @@ Metrics/base_velocity/error_vel_yaw: 0.4705
9295
ETA: 01:21:49
9396
```
9497

95-
96-
This command launches the training with default hyperparameters. The Blackwell GPU runs thousands of parallel H1 environments simultaneously while the Grace CPU handles logging and orchestration.
98+
During training:
99+
* The Blackwell GPU accelerates physics simulation, neural network inference, and PPO training updates.
100+
* The Grace CPU manages environment orchestration, logging, and experiment control.
101+
* Multiple simulation environments run in parallel, enabling efficient rollout collection for reinforcement learning.
102+
103+
Each PPO iteration collects experience from all parallel environments, then updates the policy network using the gathered trajectories.
97104

98105
{{% notice Warning %}}
99106
**Known issue: NVRTC GPU architecture error on DGX Spark**
100107

101-
When running RL training on the Blackwell GPU (GB10, compute capability 12.1), you may encounter:
108+
When running RL training on the Blackwell GPU (GB10, compute capability 12.1), you may encounter an error similar to:
102109

103110
```
104111
RuntimeError: nvrtc: error: invalid value for --gpu-architecture (-arch)
@@ -108,11 +115,12 @@ This error occurs because the NVRTC runtime compiler inside PyTorch does not yet
108115

109116
**Workaround**: Make sure you are using the Isaac Sim build from source (as described in the setup section) rather than a pip-installed version. The source build includes the correct CUDA 13 runtime for Blackwell. If the error persists, try running with `--headless` mode, which avoids some NVRTC code paths used by the renderer. Also ensure your NVIDIA driver is up to date (`nvidia-smi` should show driver 580.x or later).
110117

111-
This issue is expected to be resolved in future Isaac Sim and PyTorch releases with full Blackwell support.
118+
Support for Blackwell GPUs is expected to improve in upcoming PyTorch and Isaac Sim releases.
112119
{{% /notice %}}
113120

121+
### Adjusting training parameters
114122
You can also override default parameters from the command line:
115-
123+
For example:
116124
```bash
117125
./isaaclab.sh -p scripts/reinforcement_learning/rsl_rl/train.py \
118126
--task=Isaac-Velocity-Rough-H1-v0 \
@@ -121,7 +129,6 @@ You can also override default parameters from the command line:
121129
--max_iterations=1500 \
122130
--seed=42
123131
```
124-
125132
### Command-line arguments
126133

127134
The following table explains the key command-line arguments:
@@ -134,8 +141,10 @@ The following table explains the key command-line arguments:
134141
| `--max_iterations` | 1500 | Total number of PPO training iterations. Each iteration collects a batch of experience and updates the policy |
135142
| `--seed` | 0 | Random seed for reproducibility. Set this to get deterministic results across runs |
136143

144+
Each environment runs an independent simulation of the robot, allowing the RL algorithm to collect experience efficiently.
145+
137146
{{% notice Tip %}}
138-
On DGX Spark, 2048 to 4096 parallel environments work well for locomotion tasks. Higher values increase sample throughput but require more GPU memory. Start with 2048 if you want faster iteration cycles during development.
147+
On DGX Spark, 2048 - 4096 parallel environments typically work well for locomotion tasks. Higher values increase sample throughput but require more GPU memory. Start with 2048 if you want faster iteration cycles during development.
139148
{{% /notice %}}
140149

141150
## Step 3: Understand the PPO hyperparameters
@@ -177,14 +186,13 @@ PPO (Proximal Policy Optimization) is the RL algorithm used by RSL-RL. Understan
177186
| `save_interval` | `50` | Save a model checkpoint every N iterations. Useful for resuming training or evaluating intermediate policies |
178187

179188
### How the hyperparameters interact
180-
181-
The total amount of experience collected per training iteration is:
182-
189+
During training, each iteration collects experience from all parallel environments.
190+
The total batch size per iteration is:
183191
```
184192
batch_size = num_envs × num_steps_per_env
185193
```
186194

187-
For example, with `num_envs=4096` and `num_steps_per_env=24`:
195+
For example, with `num_envs=4096` and `num_steps_per_env=24`, the batch size per iteration is:
188196

189197
```
190198
batch_size = 4096 × 24 = 98,304 environment steps per iteration
@@ -194,7 +202,7 @@ This batch is then split into `num_mini_batches` (4) mini-batches of ~24,576 ste
194202

195203
## Step 4: Monitor the training
196204

197-
During training, RSL-RL prints statistics to the terminal at regular intervals. A typical output looks like:
205+
During training, RSL-RL periodically prints progress statistics to the terminal. A typical log output looks like:
198206

199207
```output
200208
Learning iteration 100/1500
@@ -207,7 +215,7 @@ Learning iteration 100/1500
207215
fps: 48523
208216
```
209217

210-
Interpreting these values helps track convergence and diagnose training instability, such as stagnating rewards or exploding losses.
218+
These metrics help you track learning progress and detect issues such as unstable gradients or stagnating policies.
211219

212220
The following table explains each metric:
213221

@@ -241,18 +249,21 @@ For evaluation, use the inference task name `Isaac-Velocity-Rough-H1-Play-v0` in
241249

242250
The play script loads the most recent checkpoint and runs the policy in real time. You will observe the Unitree H1 humanoid walking over procedurally generated rough terrain, responding to live velocity commands.
243251

244-
You can also specify a particular checkpoint manually, which is useful for comparing intermediate policy performance.
252+
You can also run inference with a specific checkpoint. This is useful for comparing policy performance at different stages of training.
245253

246254
```bash
247255
./isaaclab.sh -p scripts/reinforcement_learning/rsl_rl/play.py \
248256
--task=Isaac-Velocity-Rough-H1-Play-v0 \
249257
--num_envs=512 \
250258
--checkpoint=logs/rsl_rl/h1_rough/<timestamp>/model_1500.pt
251259
```
260+
This command loads the specified checkpoint and runs the policy using the same simulation environment.
252261

253262
### Understanding the evaluation
254263

255-
During evaluation, you can observe how the robot's behavior improves over the course of training:
264+
During evaluation, you can observe how the robot’s behavior evolves as training progresses.
265+
266+
Typical training behavior follows three stages:
256267

257268
- **Early training (iterations 0–200)**: The robot often collapses immediately or performs erratic, uncoordinated motions.
258269
- **Mid training (iterations 200–800)**: The robot begins to walk forward with some success, though it may still stumble or lose balance on rough terrain.
@@ -268,7 +279,7 @@ At iteration 50, the policy is still in its exploration phase. Most robots exhib
268279

269280
![img3 alt-text#center](isaaclab_h1_512_0050.gif "Figure 3: Early Stage")
270281

271-
*** Iteration 1250 (Late Stage, num_envs=512) ***
282+
*** Iteration 1350 (Late Stage, num_envs=512) ***
272283

273284
By iteration 1350, the policy has matured. Most robots demonstrate coordinated walking behavior, balance maintenance, and accurate velocity tracking, even on rough terrain. The improvement in foot placement and heading stability is clearly visible.
274285

@@ -283,4 +294,4 @@ In this module, you have:
283294
- Monitored training progress using reward curves, episode statistics, and performance metrics
284295
- Evaluated the trained policy through interactive visualization and behavior analysis
285296

286-
You have now completed the end-to-end workflow of training and validating a reinforcement learning policy for humanoid locomotion on DGX Spark.
297+
You have now completed the end-to-end workflow of training and validating a reinforcement learning policy for humanoid locomotion on DGX Spark.

0 commit comments

Comments
 (0)