Multiprocessing/multithreading for custom CPU-heavy environments #1393
Unanswered
eundersander
asked this question in
Q&A
Replies: 1 comment
-
Thanks for posting this. We're reviewing this with our engineering team and will post our best suggestion soon. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We're interested in using IsaacSim/Lab with environments that have lots of scalar CPU python code. For example, imagine a navigation task in a complex house scene where the reward calculation uses the ground-truth shortest path, which we compute using a CPU-based navmesh library. As another example, we might want to randomize the placement of clutter objects in a scene at episode start by doing a number of collision queries to find valid placements.
IsaacLab's current approach to parallel environments is basically SIMD and likely to run on GPU: in a single CPU process, you enable multiple instances of an environment by doing all environment logic as tensors. In our case, our scalar CPU code can't be converted to tensors (see above examples).
For best runtime perf, I'd like to have a python process per environment or otherwise utilize lots of CPU cores. This is the paradigm of traditional Gym environments, which were CPU-based and used multiprocessing to achieve parallel environment instances. There are variations here, e.g. a python thread per environment with a free-threading (nogil) python interpreter.
One way forward is to instantiate an IsaacSim/Lab instance (SimulationApp) in each environment process, but this has drawbacks:
Any advice here?
Beta Was this translation helpful? Give feedback.
All reactions