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] Make torch PPO regression test longer #31892

Merged
merged 2 commits into from
Jan 28, 2023

Conversation

ArturNiederfahrenhorst
Copy link
Contributor

Signed-off-by: Artur Niederfahrenhorst artur@anyscale.com

Why are these changes needed?

Because of a throughput difference between torch and tf (tf being 2x faster), we should give torch more time in this test.
I've run a couple of experiments and observed that torch has the same sample efficiency and that the only difference appears to be throughput. Until @smorad has resolved this mystery, we should make this test longer and simply make it shorter when we are able to resolve this so that this test can properly fail/succeed for the time being.

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Artur Niederfahrenhorst <artur@anyscale.com>
@smorad
Copy link
Contributor

smorad commented Jan 24, 2023

I've "resolved" the mystery -- it just seems that tf and torch are better at different tasks. Varying the batch and minibatch size I was able to make torch models faster than tf eager models. After talking with Sven I think the main issue is that the hyperparameters for the tuned examples were optimized for tf. Messing w/ batch size, minibatch size, num SGD iters to find suitable torch hyperparameters could likely make it as fast as tf.

Signed-off-by: Artur Niederfahrenhorst <artur@anyscale.com>
@ArturNiederfahrenhorst
Copy link
Contributor Author

@smorad This PR separates the tests from each other. Can you re-tune torch's train_batch_size etc so that it comes closer to TF's performance?

@ArturNiederfahrenhorst
Copy link
Contributor Author

If you state your intuition in terms of what these paramters should be in this test, I can also do it.

@gjoliver gjoliver merged commit 20bfcdd into ray-project:master Jan 28, 2023
edoakes pushed a commit to edoakes/ray that referenced this pull request Mar 22, 2023
…roject#31892)

Signed-off-by: Artur Niederfahrenhorst <artur@anyscale.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
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