-
Notifications
You must be signed in to change notification settings - Fork 443
Adds native vector implementation #599
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
Adds native vector implementation #599
Conversation
Reviewing it soon, thanks for the work on this! |
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.
Admittedly, a lot of it flew over my head and I never ran the code. But thus doesn't seem to break any existing functionality so I thibk it's good to go. Any downstream bugs can be fixed as they come a la open source.
@jjshoots Thanks for the review, it was complex code and took me a long time to implement so don't worry if you don't fully understand |
c800316
into
Farama-Foundation:master
Projects like
SampleFactory
andEnvPool
have provided C++ based vectorisators for ALE, significantly increasing the number of frames per second that can be sampled.However,
EnvPool
is no longer maintained and to make it easier and compatible with Gymnasium's vector API, this PR adds aEnvPool
based (though highly highly simplified) vector environment.The implementation has four main parts
preprocessed_env.hpp
- Runs the standard preprocessing computation for Atari (frame stack, frame skip, maxpooling, resizing, etc)async_vectorizers.hpp
- Takes a list of preprocessed environments that are run asynchronously that we push actions to then return a collection of results once computed.ale_vector_python_interface.cpp/hpp
- PyBind11 bindings to convert the vectorizer's list of environment data into a batched version that is easier to use by usersvector_env.py
- This is a python class for easily using the vectorizer.Known Problems
Features not included in the PR (todo later)
jit
accelerating the environment, however, the jax foreign function interface has changed significantly since the EnvPool therefore will need to be implemented from scratch.