Configuration¶
RSL-RL is configured with a dictionary that is passed to RSL-RL’s runner during initialization. The dictionary is usually read from a YAML file or constructed from Python dataclasses, such as in Isaac Lab. It is nested to reflect the structure of the library, and follows this pattern:
The top level represents the runner configuration, which is composed of general settings and configuration dictionaries for the algorithm (e.g. PPO), as well as for the models used by the algorithm (e.g. actor and critic). The algorithm dictionary contains the parameters of the algorithm, and may contain one or more configuration dictionaries for extensions. The model dictionaries contain the parameters of the models, and may contain a configuration dictionary for a distribution.
In the following sections, we list the available settings for each configuration component, provide a minimal example configuration in YAML format, and explain how observations are configured.
Runner Configuration¶
RSL-RL’s OnPolicyRunner and
OffPolicyRunner share the same configuration keys, which are listed below.
OnPolicyRunner & OffPolicyRunner¶
Key |
Type |
Default |
Description |
|---|---|---|---|
|
dict[str, list[str]] |
required |
Mapping from observation sets to observation groups coming from the environment. See here for more details. |
|
int |
required |
Number of environment steps collected per iteration. |
|
int |
required |
Number of iterations between checkpoints. |
|
str |
missing |
Optional run label shown in the console output. |
|
bool |
|
Whether to check for NaN or Inf values coming from the environment. |
|
str | None |
|
Compile mode for the PyTorch models to accelerate training.
Valid values: |
|
str | dict |
|
Logging writer configuration. The plain strings |
|
str |
– |
Deprecated. Pass |
|
str |
– |
Deprecated. Pass |
|
dict |
required |
RL algorithm configuration. |
|
dict |
required |
Actor model configuration. |
|
dict |
required |
Critic model configuration. |
DistillationRunner¶
For the DistillationRunner, the actor and critic keys are simply
replaced by student and teacher keys, respectively:
Key |
Type |
Default |
Description |
|---|---|---|---|
… |
… |
… |
… |
|
dict |
required |
Student model configuration. |
|
dict |
required |
Teacher model configuration. |
Logger¶
The logger key of the runner configuration defines the logging writer used to log training metrics and other
information during training. RSL-RL supports TensorBoard, Weights & Biases, and Neptune out of the box. While
TensorBoard does not require any configuration and is set using the plain string "tensorboard", the other logging
backends are configured by passing a dictionary with the following keys:
Key |
Type |
Default |
Description |
|---|---|---|---|
|
str |
required |
Logger class name. Valid values: |
|
str |
required |
Name of the project. |
Algorithm Configuration¶
RSL-RL implements PPO, SAC,
Distillation, and SHAC. Each
algorithm has its own configuration listed below.
PPO¶
Key |
Type |
Default |
Description |
|---|---|---|---|
|
str |
required |
Algorithm class name. Valid values: |
|
str |
|
Optimizer used for policy/value updates. Valid values: see |
|
float |
|
Optimizer learning rate. |
|
int |
|
Number of optimization epochs per iteration. |
|
int |
|
Number of mini-batches per iteration. |
|
str |
|
Learning-rate schedule. Valid values: |
|
float |
|
Coefficient for the value-function loss. |
|
float |
|
PPO clipping parameter for surrogate/value clipping. |
|
bool |
|
Whether to clip the value loss. |
|
float |
|
Target KL divergence used by the adaptive learning-rate schedule. |
|
float |
|
Entropy regularization coefficient. |
|
float |
|
Discount factor. |
|
float |
|
GAE lambda parameter. |
|
float |
|
Maximum gradient norm for gradient clipping. |
|
bool |
|
Whether to normalize advantages for each mini-batch instead of across the entire rollout. |
|
bool |
|
Whether to run the forward pass and loss computation in bfloat16 autocast. Backward, gradient clipping, and the optimizer step always stay in fp32. |
|
bool |
|
Whether to share the CNN networks between actor and critic in case
the |
|
dict | None |
|
Optional RND extension configuration. |
|
dict | None |
|
Optional symmetry extension configuration. |
|
float |
|
Maximum size, in megabytes, of a single packed gradient buffer used when reducing gradients
across GPUs during multi-GPU training. Matches Torch’s
|
SAC¶
Note
SAC requires QMLPModel or QCNNModel critics and
an actor with a SquashedGaussianDistribution. We recommend using
ResidualMLP networks for the actor and critics, selected through the model’s
network_cfg as described in Model Configuration. Recurrent actors and critics are
not supported.
Key |
Type |
Default |
Description |
|---|---|---|---|
|
str |
required |
Algorithm class name. Valid values: |
|
int |
|
Number of state-action critics. |
|
int |
|
Number of transitions that can be stored in the replay buffer per GPU. |
|
float | None |
|
Maximum fraction of free GPU memory used for the replay buffer. |
|
int |
|
Number of optimization steps per iteration. |
|
int |
|
Number of transitions sampled per optimization step per GPU. |
|
int |
|
Maximum number of environment steps used to compute return targets. |
|
float |
|
Discount factor. |
|
float |
|
Interpolation factor for updating the target critics. |
|
int |
|
Number of critic updates per actor update. |
|
int |
|
Minimum number of transitions in the replay buffer per GPU before optimization starts. |
|
float |
|
Optimizer learning rate for the actor. |
|
float |
|
Optimizer learning rate for the critics. |
|
float |
|
Optimizer learning rate for the entropy temperature. |
|
float | None |
|
Maximum gradient norm for gradient clipping of the actor and critics. |
|
str |
|
Optimizer used for actor and critic updates. Valid values: see |
|
float |
|
Weight decay for the actor and critic optimizers. |
|
float |
|
Initial entropy temperature. |
|
float | None |
|
Target policy entropy. If |
|
float | None |
|
Gaussian standard deviation used to compute the target entropy. Only used if |
|
str |
|
Loss used for critic updates. Valid values: |
|
int |
|
Number of bins for categorical critics. Only used if |
|
tuple[float, float] |
|
Minimum and maximum values represented by categorical critics. Only used if |
|
bool |
|
Whether to normalize rewards using statistics of discounted returns. |
|
float |
|
Maximum absolute value of tracked discounted returns after reward normalization. Only used if
|
|
str |
|
Exploration noise. Valid values: |
|
float |
|
Exponent of the power-law distribution for noise repetition counts. Only used if |
|
int |
|
Maximum number of environment steps for which exploration noise is held. Only used if |
|
str |
|
Learning-rate schedule. Valid values: |
|
float |
|
Final learning rate as a fraction of the initial learning rate. Only used if |
|
int | None |
|
Number of optimization steps over which the cosine schedule runs. Required if |
|
bool |
|
Whether to run the forward pass and loss computation in bfloat16 autocast. Backward, gradient clipping, and the optimizer step always stay in fp32. |
|
bool |
|
Whether to capture optimization steps in CUDA graphs. |
|
dict | None |
|
Optional symmetry extension configuration. |
|
float |
|
Maximum size, in megabytes, of a single packed gradient buffer used when reducing gradients
across GPUs during multi-GPU training. Matches
|
Distillation¶
Key |
Type |
Default |
Description |
|---|---|---|---|
|
str |
required |
Algorithm class name. Valid values: |
|
str |
|
Optimizer used for student updates. Valid values: see |
|
float |
|
Optimizer learning rate. |
|
int |
|
Number of optimization epochs per iteration. |
|
int |
|
Gradient backpropagation length. |
|
float | None |
|
Maximum gradient norm for gradient clipping. |
|
str |
|
Loss type. Valid values: |
|
bool |
|
Whether to run the forward pass and loss computation in bfloat16 autocast. Backward, gradient clipping, and the optimizer step always stay in fp32. |
|
float |
|
Maximum size, in megabytes, of a single packed gradient buffer used when reducing gradients
across GPUs during multi-GPU training. Matches
|
SHAC¶
Key |
Type |
Default |
Description |
|---|---|---|---|
|
str |
required |
|
|
dict | None |
|
Learned dynamics settings. With |
|
dict |
required |
|
|
int |
|
Number of frames in imagined observation histories. Match the environment’s history length and reset padding. |
|
bool |
|
Train the actor to predict a correction that the environment adds to its reference action. |
|
bool |
|
Update the actor’s input normalization before choosing each collection action. Set to false to update afterwards. |
|
float |
|
Learner iterations accrued per collected environment step. |
|
int |
|
Actor updates and associated critic fits per learner iteration. |
|
int |
|
Number of steps in each imagined trajectory. |
|
int |
|
Number of rollout starting states per actor update. |
|
float |
|
Reward discount. |
|
float | None |
|
Upper bound on the per-step reward, used to cap value estimates at the maximum discounted return. |
|
float |
|
Standard deviation of additive collection noise. |
|
int | None |
|
Half-life of the actor weights averaged for inference and export, measured in actor optimizer steps. |
|
float |
|
TD(lambda) mixing coefficient for value targets. |
|
int |
|
Epochs per critic fit. |
|
int |
|
Minibatches per critic epoch. |
|
float |
|
Initial learning rate of the world model and critic, and of the actor unless overridden. |
|
float | None |
|
Initial actor learning rate. |
|
float |
|
Initial multiplier on the actor learning rate. It decays linearly to 1 once either decay threshold is reached. |
|
int |
|
Learner iterations over which the multiplier decays to 1. |
|
float | None |
|
Mean completed-episode return that starts the decay. Each return is divided by the maximum episode length. |
|
int | None |
|
Learner iteration at which the decay starts at the latest. |
|
tuple[str] |
|
Models whose hidden weight matrices use Muon. Accepts |
|
float |
|
Global gradient-norm limit for each model. |
|
int |
|
Duration of the cosine schedule, measured in |
|
float |
|
Final learning rate relative to its initial value. |
|
bool |
|
Use bfloat16 for matrix operations and float32 for physical state integration. |
|
bool |
|
Capture collection and learner updates in CUDA graphs. Task methods must support graph capture. |
|
str |
|
Count steps toward updates after warm-up ( |
|
str |
|
Measure cosine-schedule progress in learner updates or in collected environment steps
( |
|
bool |
|
Weight reachable value targets by imagined survival probabilities. When disabled, all reachable targets have equal weight. |
|
bool |
|
Cap values with |
|
bool |
|
Draw new critic minibatches every epoch instead of reusing one permutation. |
Model Configuration¶
Different algorithms use models for different purposes. For example, PPO uses an actor
and a critic, while Distillation uses a student and a teacher. Even though
their function may differ, algorithms can generally use the same underlying model classes. Available models include
MLPModel, RNNModel,
CNNModel, QMLPModel,
QCNNModel, EquivariantMLPModel,
and SuperMimicActor.
MLPModel¶
Key |
Type |
Default |
Description |
|---|---|---|---|
|
str |
required |
Model class name. Valid values: |
|
tuple[int] | list[int] |
|
Hidden dimensions of the MLP. |
|
str |
|
Activation function of the MLP. Valid values: see |
|
bool |
|
Whether to normalize the observations before passing them to the MLP. |
|
dict | None |
|
Optional network configuration. If provided, the default MLP is replaced by the configured network, and
|
|
dict | None |
|
Optional output distribution configuration. If provided, the model can output stochastic values sampled from the specified distribution. |
The network_cfg dictionary contains the network’s class_name and configuration parameters. For
RNNModel and CNNModel, it replaces the MLP after the
recurrent network or CNN encoders. To use the ResidualMLP, configure the following
parameters:
Key |
Type |
Default |
Description |
|---|---|---|---|
|
str |
required |
Network class name. Valid values: |
|
int |
|
Hidden dimension of the residual network. |
|
int |
|
Number of residual blocks. |
|
int |
|
Expansion factor for the hidden dimension within each residual block. |
|
float |
|
Momentum for the running statistics of batch normalization. |
The ResidualMLP requires normalize_parameters() to be
called after each optimizer step. Currently, only SAC performs this normalization.
RNNModel¶
The RNNModel inherits from the MLPModel and shares
the same configuration keys, with the addition of the following keys:
Key |
Type |
Default |
Description |
|---|---|---|---|
|
str |
required |
Model class name. Valid values: |
… |
… |
… |
… |
|
str |
|
Type of RNN network. Valid values: |
|
int |
|
Hidden dimension of the RNN. |
|
int |
|
Number of RNN layers. |
CNNModel¶
The CNNModel inherits from the MLPModel and shares
the same configuration keys, with the addition of the following keys:
Key |
Type |
Default |
Description |
|---|---|---|---|
|
str |
required |
Model class name. Valid values: |
… |
… |
… |
… |
|
dict[str, dict] | dict[str, Any] | None |
|
Configuration of the CNN encoder(s). |
Instead of directly passing the CNN parameters to the CNNModel (similar to how it is
done for the MLPModel and RNNModel), the parameters
are grouped in a dictionary cnn_cfg. This enables passing multiple CNN configurations for different observations
(e.g. different cameras). If only one CNN is needed or all CNNs have the same configuration, the dictionary may directly
contain the CNN parameters. If multiple CNNs with different configurations are needed, the dictionary must contain a
dictionary for each CNN configuration, with the key being the observation the configuration applies to. The
CNNModel will then create CNNs based on the provided configurations. A CNN
configuration includes the following parameters:
Key |
Type |
Default |
Description |
|---|---|---|---|
|
tuple[int] | list[int] |
required |
Output channels for each convolutional layer. |
|
int | tuple[int] | list[int] |
required |
Kernel size for each convolutional layer or a single kernel size for all layers. |
|
int | tuple[int] | list[int] |
|
Stride for each convolutional layer or a single stride for all layers. |
|
int | tuple[int] | list[int] |
|
Dilation for each convolutional layer or a single dilation for all layers. |
|
str |
|
Padding type to use. Valid values: |
|
str | tuple[str] | list[str] |
|
Normalization type for each convolutional layer or a single normalization type for all layers. Valid values:
|
|
str |
|
Activation function to use. Valid values: see |
|
bool | tuple[bool] | list[bool] |
|
Whether to apply max pooling after each convolutional layer or a single boolean for all layers. |
|
str |
|
Global pooling type to apply at the end. Valid values: |
|
bool |
|
Whether to flatten the output tensor. |
QMLPModel¶
The QMLPModel inherits from the MLPModel and shares
the same configuration keys, except that distribution_cfg must be None.
Key |
Type |
Default |
Description |
|---|---|---|---|
|
str |
required |
Model class name. Valid values: |
… |
… |
… |
… |
QCNNModel¶
The QCNNModel inherits from the CNNModel and shares
the same configuration keys, except that distribution_cfg must be None.
Key |
Type |
Default |
Description |
|---|---|---|---|
|
str |
required |
Model class name. Valid values: |
… |
… |
… |
… |
EquivariantMLPModel¶
The EquivariantMLPModel inherits from the
MLPModel and shares its configuration keys except for network_cfg,
with the addition of the following keys:
Key |
Type |
Default |
Description |
|---|---|---|---|
|
str |
required |
Model class name. Valid values: |
… |
… |
… |
… |
|
tuple[int] | list[int] |
|
Hidden dimensions of the MLP. Each must be even, since the hidden layers are split into two mirrored halves. |
|
dict |
required |
Representations of the reflection, given as signed permutations |
With obs_normalization enabled, the observations are normalized with symmetrized statistics so that normalization
preserves equivariance. To make the sampled actions equivariant and not only the action mean, the model should be used
with the EquivariantGaussianDistribution. Distributions whose MLP output is
structured, i.e. HeteroscedasticGaussianDistribution and
BetaDistribution, are not supported.
For example, for a robot with two mirrored joints whose observation consists of the base angular velocity and the two joint positions, the configuration of the actor and the critic is:
actor:
class_name: EquivariantMLPModel
hidden_dims: [256, 256, 256]
equivariance_cfg:
obs:
perm: [0, 1, 2, 4, 3]
sign: [-1, 1, -1, 1, 1]
output:
perm: [1, 0]
distribution_cfg:
class_name: EquivariantGaussianDistribution
perm: [1, 0]
critic:
class_name: EquivariantMLPModel
hidden_dims: [256, 256, 256]
equivariance_cfg:
obs:
perm: [0, 1, 2, 4, 3]
sign: [-1, 1, -1, 1, 1]
Distribution Configuration¶
RSL-RL provides the following distributions for stochastic model outputs:
GaussianDistribution,
HeteroscedasticGaussianDistribution with state-dependent standard deviation,
SquashedGaussianDistribution for tanh-bounded Gaussian actions,
BetaDistribution for naturally bounded action spaces, and
EquivariantGaussianDistribution for equivariant models.
GaussianDistribution¶
Key |
Type |
Default |
Description |
|---|---|---|---|
|
str |
required |
Distribution class name. Valid values: |
|
float |
|
Initial standard deviation for all dimensions. |
|
tuple[float, float] |
|
Minimum and maximum allowed values for the standard deviation for numerical stability. |
|
str |
|
Whether the standard deviation is stored directly or in log-space. Valid values: |
|
bool |
|
Whether the standard deviation is learnable or fixed. |
HeteroscedasticGaussianDistribution¶
Key |
Type |
Default |
Description |
|---|---|---|---|
|
str |
required |
Distribution class name. Valid values: |
|
float |
|
Initial standard deviation (used to initialize the std head bias). |
|
tuple[float, float] |
|
Minimum and maximum allowed values for the standard deviation for numerical stability. |
|
str |
|
Whether the standard deviation is stored directly or in log-space. Valid values: |
SquashedGaussianDistribution¶
Key |
Type |
Default |
Description |
|---|---|---|---|
|
str |
required |
Distribution class name. Valid values: |
|
float | None |
|
Initial standard deviation before squashing (used to initialize the standard deviation head). |
|
tuple[float, float] |
|
Minimum and maximum standard deviation of the Gaussian before applying the tanh function. |
|
tuple[float | list, float | list] |
|
Interval |
BetaDistribution¶
Key |
Type |
Default |
Description |
|---|---|---|---|
|
str |
required |
Distribution class name. Valid values: |
|
tuple[float, float] |
|
Interval |
EquivariantGaussianDistribution¶
The EquivariantGaussianDistribution inherits from the
GaussianDistribution and thus shares the same configuration keys as the
GaussianDistribution, with the addition of the following keys. It is intended
for the EquivariantMLPModel.
Key |
Type |
Default |
Description |
|---|---|---|---|
|
str |
required |
Distribution class name. Valid values: |
… |
… |
… |
… |
|
list[int] |
required |
Permutation pairing mirrored action dimensions, the same as |
Extension Configuration¶
RandomNetworkDistillation is compatible with PPO, and
Symmetry is compatible with PPO and
SAC. LearnedDynamics is compatible
with SHAC.
Random Network Distillation¶
Key |
Type |
Default |
Description |
|---|---|---|---|
|
int |
required |
Number of outputs of the RND networks. |
|
tuple[int] | list[int] |
required |
Hidden dimensions of the RND predictor network. |
|
tuple[int] | list[int] |
required |
Hidden dimensions of the RND target network. |
|
str |
|
Activation function for the RND networks. Valid values: see |
|
bool |
|
Whether to normalize the RND state. |
|
bool |
|
Whether to normalize the RND reward. |
|
float |
|
Initial weight of the RND reward. |
|
dict | None |
|
Weight schedule for the RND reward. Valid values: see |
|
float |
|
Learning rate for the RND optimizer. |
Symmetry Augmentation¶
Key |
Type |
Default |
Description |
|---|---|---|---|
|
bool |
required |
Whether to add symmetric trajectories to the batch. |
|
str | callable | None |
required |
Function to generate symmetric trajectories. Resolved using |
|
bool |
required |
Whether to add a symmetry loss term to the loss function. |
|
float |
required |
Coefficient for the symmetry loss. |
Learned Dynamics¶
Set algorithm.world_model_cfg to train a world model from replay. As for SAC, steps with a done supply the final
observations before resets, as described in step(). Environments that also capture
physical successors before interval edits on every step set final_obs_every_step; without it, edits such as pushes
enter the world model’s targets as dynamics.
Key |
Type |
Default |
Description |
|---|---|---|---|
|
dict |
required |
Predictor class and its constructor arguments. See |
|
int |
|
Maximum transitions per rank. Replay must hold at least |
|
float | None |
|
Fraction of free CUDA memory available to replay. |
|
int |
|
Stored steps per environment before learning. |
|
int |
|
Replay anchors per dynamics optimizer step. |
|
int |
|
Learner iterations fitting only dynamics. |
|
int |
|
Dynamics optimizer steps per learner iteration. |
|
str |
|
Sum the dynamics loss over each replay window, or average it over all valid positions
( |
|
bool |
|
Sample only complete windows within an uninterrupted episode. Requires more warm-up steps than |
|
float |
|
Fraction of each dynamics batch augmented with the task’s mirror functions. |
|
int |
|
Maximum number of consecutive transitions used to fit the world model. |
Example Configuration¶
While the previous sections cover many configuration options, only a few are needed to start training. The following
examples provide minimal configurations for PPO, SAC,
Distillation, and SHAC.
PPO¶
Use OnPolicyRunner with the following configuration:
runner:
num_steps_per_env: 24
obs_groups: {"actor": ["policy"], "critic": ["policy", "privileged"]}
save_interval: 100
algorithm:
class_name: PPO
actor:
class_name: MLPModel
distribution_cfg:
class_name: GaussianDistribution
critic:
class_name: MLPModel
SAC¶
Use OffPolicyRunner with a squashed Gaussian actor and state-action critics:
runner:
num_steps_per_env: 8
obs_groups: {"actor": ["policy"], "critic": ["policy", "privileged"]}
save_interval: 100
algorithm:
class_name: SAC
actor:
class_name: MLPModel
network_cfg:
class_name: ResidualMLP
distribution_cfg:
class_name: SquashedGaussianDistribution
critic:
class_name: QMLPModel
network_cfg:
class_name: ResidualMLP
Distillation¶
Use DistillationRunner. The teacher’s model configuration and input
observation groups must match the policy being distilled. This example matches the actor in the PPO example above:
runner:
num_steps_per_env: 60
obs_groups: {"student": ["policy"], "teacher": ["policy"]}
save_interval: 100
algorithm:
class_name: Distillation
student:
class_name: MLPModel
distribution_cfg:
class_name: GaussianDistribution
teacher:
class_name: MLPModel
distribution_cfg:
class_name: GaussianDistribution
SHAC¶
Use OnPolicyRunner with learned dynamics. Set task_cfg.class_name
to the environment’s DifferentiableTask implementation.
runner:
num_steps_per_env: 24
obs_groups: {"actor": ["policy"], "state": ["state"]}
save_interval: 100
algorithm:
class_name: SHAC
task_cfg:
class_name: my_package.my_task:MyTask
world_model_cfg:
model:
class_name: WorldModel
actor:
class_name: MLPModel
critic:
class_name: MLPModel
Observation Configuration¶
RSL-RL expects the step() method of the environment to return observations as a
TensorDict. This dictionary contains one or more tensors with observation data, referred
to as observation groups in RSL-RL and Isaac Lab.
The obs_groups dictionary of the runner configuration defines which observation groups
are used for which purpose. Each purpose defines its own observation set, which is simply a list of observation
groups. In other words, the obs_groups dictionary maps from observation sets to lists of observation groups.
As the above definition is quite abstract, let’s consider a simple example for a
PPO training. The step() method of our environment
might return the following observations:
obs = TensorDict(
{
"policy": torch.tensor([1.0, 2.0, 3.0]), # available during robot deployment
"privileged": torch.tensor([4.0, 5.0, 6.0]), # only available during training
}
)
Let’s assume the “policy” observation group is meant for both actor and critic. The “privileged” observation group is
only available during training and therefore cannot be used by the actor model, but may still improve learning
performance when passed to the critic. Thus, the obs_groups dictionary would be configured as follows:
obs_groups: {"actor": ["policy"], "critic": ["policy", "privileged"]}
With this configuration, the actor would receive the “policy” tensor as input, while the critic would receive both the “policy” and the “privileged” tensor as input.
Depending on the algorithm and extensions used, RSL-RL expects different observation sets to be present in the
obs_groups dictionary. Currently, the following observation sets may be required, depending on the configuration:
Key |
Description |
|---|---|
|
Observations used as input to the actor model. |
|
Observations used as input to the critic model. SHAC obtains these from the task’s
|
|
Observations used as input to the student model. |
|
Observations used as input to the teacher model. |
|
Observations used as input to the RND extension. |
|
Noise-free physical state used by SHAC. |
|
Optional task goal used by SHAC. |
|
Optional privileged observations available to the SHAC task and world model. |
|
Optional event labels for world-model training. |
|
Optional actions from the previous two steps used to initialize SHAC’s action history. |
Incomplete or incorrect configurations are handled in resolve_obs_groups(), which provides
detailed information on how errors are resolved.