Skip to content

Conversation

@ervteng
Copy link
Contributor

@ervteng ervteng commented Oct 11, 2019

We don't clear the update buffer if we don't update the policy. This fixes that.

Wanted to get some thoughts on this. Also, how do we test it?

@ervteng ervteng requested a review from vincentpierre October 11, 2019 21:02
@chriselion
Copy link
Contributor

Also, how do we test it?

Make a test that runs in inference mode, and assert that the buffer is empty after stepping a few times?

@ervteng
Copy link
Contributor Author

ervteng commented Oct 11, 2019

Tests added @chriselion

trainer.training_buffer = construct_fake_buffer()
trainer.training_buffer.append_update_buffer(2, batch_size=None, training_length=2)
trainer.clear_update_buffer()
for _, arr in trainer.training_buffer.update_buffer.items():
Copy link
Contributor

Choose a reason for hiding this comment

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

No is_empty() method on the buffer? :(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No... maybe we should add it. Also I use this in the buffer: len(next(iter(self.update_buffer.values()))) to get its length - there probably should be a length method as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Your call - I'm OK with this as it is, but I think that would be a little nicer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll make a separate PR, unless we decide to refactor the buffer anyways

@ervteng ervteng merged commit affd875 into develop Oct 11, 2019
@ervteng ervteng deleted the develop-inferencememoryleak branch October 11, 2019 22:21
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants