Skip to content
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

[rllib] More efficient tuple flattening. #4416

Merged
merged 6 commits into from
Mar 25, 2019

Conversation

vladfi1
Copy link
Contributor

@vladfi1 vladfi1 commented Mar 19, 2019

What do these changes do?

I found tuple flattening to take up quite a lot of time (30% of total sampling), mainly due to creating lots of numpy arrays. This change creates only one array and then writes into it.

Related issue number

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@@ -41,10 +42,14 @@ def transform(self, observation):
"""Returns the preprocessed observation."""
raise NotImplementedError

def write(self, observation, array, offset):
"""Alternative to transform for more efficient flattening."""
raise NotImplementedError
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have a default implementation that calls transform() and then puts it in the array? Otherwise I can see this exception coming up if you hit a preprocessor that doesn't support it (though it seems most preprocessors have write() implemented).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion, I'll add that.

@ericl ericl changed the title More efficient tuple flattening. [rllib] More efficient tuple flattening. Mar 19, 2019
Copy link
Contributor

@ericl ericl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ericl ericl self-assigned this Mar 19, 2019
@robertnishihara
Copy link
Collaborator

@justinwyang any idea why Travis ran the Java tests and also the regular Python and Tune tests? This should PR should only have run

  • RLlib tests
  • Linting
  • MacOS wheels
  • Linux wheels

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/13074/
Test FAILed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/13104/
Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/13136/
Test PASSed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/13198/
Test FAILed.

@ericl ericl merged commit c68eea6 into ray-project:master Mar 25, 2019
justinwyang pushed a commit to justinwyang/ray that referenced this pull request Apr 3, 2019
* More efficient tuple flattening.

* Preprocessor.write uses transform by default.

* lint

* to array

* Update test_catalog.py

* Update test_catalog.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants