Replies: 4 comments
-
The resetting problem has been solved. |
Beta Was this translation helpful? Give feedback.
-
You could probably use cache. https://docs.jax.dev/en/latest/persistent_compilation_cache.html |
Beta Was this translation helpful? Give feedback.
-
It seems that complied was trigger every single time the reset() is called, even I have used this cache method. |
Beta Was this translation helpful? Give feedback.
-
@STAN-32 this discussion should be relevant as to why the reset jax debug prints once. #175. This is WAI. As for the JAX compilation cache, I've had similar issues in the past. Please let us know if you get that working. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Issue: Clarification on Environment Reset Behavior and Optimization for Debugging
Hello,
I'm working with the
mujoco_playground
and have a question regarding how the environment'sreset
function is called within theOnPolicyRunner
, especially when an environment finishes an episode (i.e., whendone
becomes 1).Environment Reset Behavior
I've observed that in the provided examples, the
reset
function within the environment is used by theOnPolicyRunner
. I'm trying to understand at what specific point thisreset
is invoked by the runner.My current understanding is that when an environment's
step
function outputsdone = 1
, the environment should then be reset for the next episode. Could you please clarify if this is indeed how it works withinOnPolicyRunner
?To debug and confirm environment resets, I added a
jax.debug.print
statement within my custom environment'sreset
method, like so:However, the
--- RESET FINISHED ---
message only appears once at the very beginning of the terminal output. It stops appearing after the initial log information starts to show. How can I reliably confirm thatmujoco_playground
is successfully resetting the environment according to my code's logic, especially whendone
is triggered during an episode?Reducing Initialization Time for Development
Additionally, I've noticed that the time from running the script to actually seeing the first log information in the terminal is quite long. I suspect this is due to JAX's JIT (Just-In-Time) compilation process.
This long initialization time makes it difficult to quickly test minor adjustments to the environment and verify if the overall pipeline works as expected. Are there any effective methods or best practices to significantly reduce this initial setup time, especially for rapid prototyping and debugging when making small changes to the environment?
Any insights or guidance on these two points would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions