-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce performance evaluation #288
Introduce performance evaluation #288
Conversation
… need those, makes the code even faster
I'm getting this message when the script finishes, not sure yet why.
|
self.sampling_loop: SamplingLoop = SamplingLoop(self.cfg, self.env_info) | ||
# don't pass self.param_servers here, learners are normally initialized later | ||
# TODO: fix above issue | ||
self.sampling_loop.init(self.buffer_mgr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally I intended to also pass self.param_servers
to self.sampling_loop.init(self.buffer_mgr)
. Unfortunately I've got some errors related to pilcking the ActorCritic
. I think my approach to loading the models from checkpoints could be improved and simplified, but I don't know how could I achieve that. I'd be grateful for any suggestions.
The error looks like this
File "/home/bartek/anaconda3/envs/sf_nethack/lib/python3.10/multiprocessing/reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
RuntimeError: Tried to serialize object __torch__.sample_factory.algo.utils.running_mean_std.RunningMeanStdInPlace which does not have a __getstate__ method defined!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd have to look into this.
Perhaps it's the issue with a PyTorch jitted module. A solution might be to just pass the parameters, not the actor-critic as a whole. Not sure what the best approach is
@alex-petrenko can I ask for the review, please? |
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #288 +/- ##
==========================================
- Coverage 79.52% 76.32% -3.20%
==========================================
Files 97 100 +3
Lines 7517 7845 +328
==========================================
+ Hits 5978 5988 +10
- Misses 1539 1857 +318 ☔ View full report in Codecov by Sentry. |
Yes, this started to happen after some PyTorch update. I've been meaning to investigate, but I also found that it's totally harmless and in practice can be ignored. |
Overview
This PR introduces a new script,
eval.py
, designed for faster evaluation using multiple environments and leveraging the efficiency of the Sample Factory sampler. Additionally, an example usage ofeval.py
is demonstrated in the addedeval_mujoco.py
script withinsf_examples
.Key Changes
New Script:
eval.py
enjoy.py
.Example Usage:
eval_mujoco.py
eval.py
script.Core Logic in
evaluation_sampling_api.py
simplified_sampling_api.py
.Additional features
checkpoint_override_defaults
. Has the same purpose asload_from_checkpoint(cfg)
, but keeps the option of overriding cfg with argv.EpisodeCounterWrapper
, which counts the episodes for each environment. Used duringeval
in order not to bias the results with shorter episodes.