-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[RLlib] Hot fix for PPOTorchRLModule._compute_values
with non-shared stateful encoder and batch slicing with non-empty info
s.
#44082
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -716,7 +716,9 @@ def _batch_slice(self, slice_: slice) -> "SampleBatch": | |
|
||
# Exclude INFOs from regular array slicing as the data under this column might | ||
# be a list (not good for `tree.map_structure` call). | ||
infos = self.get(SampleBatch.INFOS) | ||
# Furthermore, slicing does not work when the data in the column is | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You mean a SampleBatch with B=0, correct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
# singular (not a list or array). | ||
infos = self.pop(SampleBatch.INFOS, None) | ||
data = tree.map_structure(lambda value: value[start:stop], self) | ||
if infos is not None: | ||
data[SampleBatch.INFOS] = infos[start:stop] | ||
|
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.
Awesome! Ran into this issue yesterday as well (and continued testing then with a shared value function :) ).