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

[Bug] [RLLIB] SampleBatch.concat_samples has incorrect max_seq_len logic #20703

Closed
2 tasks done
mvindiola1 opened this issue Nov 24, 2021 · 0 comments · Fixed by #20704
Closed
2 tasks done

[Bug] [RLLIB] SampleBatch.concat_samples has incorrect max_seq_len logic #20703

mvindiola1 opened this issue Nov 24, 2021 · 0 comments · Fixed by #20704
Labels
bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component)

Comments

@mvindiola1
Copy link
Contributor

Search before asking

  • I searched the issues and found no similar issues.

Ray Component

RLlib

What happened + What you expected to happen

SampleBatch.concat_samples uses the first sample batch in the list of samples to determine the max_seq_len. This value is not updated after initialization which makes it possible that it does not reflect the actual max_seq_len in the list of samples.

Versions / Dependencies

ray - master branch

Reproduction script

def test_concat_max_seq_len(self):
    """Tests, SampleBatches.concat() and ...concat_samples()."""
    s1 = SampleBatch({
        "a": np.array([1, 2, 3]),
        "b": {
            "c": np.array([4, 5, 6])
        },
        SampleBatch.SEQ_LENS: [1, 2]
    })
    s2 = SampleBatch({
        "a": np.array([2, 3, 4]),
        "b": {
            "c": np.array([5, 6, 7])
        },
        SampleBatch.SEQ_LENS: [3]
    })
    concatd = SampleBatch.concat_samples([s1, s2])
    check(concatd.max_seq_len, 3)

Anything else

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!
@mvindiola1 mvindiola1 added bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant