Optimize Stage Creation
Isaac Lab supports two experimental features to speed-up stage creation: fabric cloning and stage in memory. These features are particularly effective for large-scale RL setups with thousands of environments.
What These Features Do
Fabric Cloning
- Clones environments using Fabric library (see USD Fabric USDRT Documentation)
- Partially supported and enabled by default on some environments (see
Limitations_ section for a list)
Stage in Memory
- Constructs the stage in memory, rather than with a USD file, avoiding overhead from disk I/O
- After stage creation, if rendering is required, the stage is attached to the USD context, returning to the default stage configuration
- Not enabled by default
Usage Examples
Fabric cloning can be toggled by setting the clone_in_fabric flag in the InteractiveSceneCfg configuration.
Using Fabric Cloning with a RL environment
Stage in memory can be toggled by setting the create_stage_in_memory in the SimulationCfg configuration.
Using Stage in Memory with a RL environment
Note, if stage in memory is enabled without using an existing RL environment class, a few more steps are need.
The stage creation steps should be wrapped in a with statement to set the stage context.
If the stage needs to be attached, the attach_stage_to_usd_context function should be called after the stage is created.
Using Stage in Memory with a manual scene setup
Limitations
Fabric Cloning
- Fabric-cloned environments must be accessed using USDRT functions, rather than USD functions.
- Fabric cloning is partially supported and enabled by default on some environments, listed here.
Stage in Memory
-
Cannot be currently enabled at the same time as Fabric Cloning.
-
Attaching stage in memory to the USD context can be slow, offsetting some or all of the performance benefits.
- Note, attaching is only necessary when rendering is enabled. For example, in headless mode, attachment is not required.
-
Certain low-level Kit APIs do not yet support stage in memory.
- In most cases, when these APIs are hit, existing scripts will automatically early attach the stage and print a warning message.
- In one particular case, for some environments, the API call to color the ground plane is skipped, when stage in memory is enabled.
Benchmark Results
Performance comparison cloning 4000 ShadowHand robots with rendering enabled