V3 new backend: PyTorch? and the future of Stable Baselines · Issue #733 · hill-a/stable-baselines (original) (raw)

Version3 is now online: https://github.com/DLR-RM/stable-baselines3

This issue summarizes the discussion between the maintainers (@hill-a , @erniejunior , @AdamGleave , @Miffyli and I) about the next backend and the future of stable baselines.

First, we recommend anyone to read the summary of design choices in #576

Backend Choice

This is the biggest design choice for next major version. In any case, we will drop tensorflow 1 for something else, among the candidate we have: pytorch, tensorflow 2, jax.

Maintainers opinion

The majority of the maintainers would favor PyTorch as they already work with it and the rest don't have strong feelings as they will have to switch to a new framework anyway.

As a transition, here is the final results from the poll I created some weeks ago on twitter:
Number of views: 4500
Votes: 319 (quite a lot!)
Results:

Disclaimer: doing a poll on Twitter restricts the audience but it's a good start

Tensorflow 2

Pros:

Cons:

Jax

Pros:

Cons:

PyTorch

Pros:

Cons:

Side note: although the twitter poll is biased, the gap between first and second choice is striking.

Summary

As a summary, the first choice for the backend would be PyTorch for mainly two reasons:

A second choice would be Jax because:

It seems that tensorflow 2 does not convince much people because it is a completely new framework (compared to tf1, even if it shares the name) but is fairly new and compared to PyTorch. It seems to have the same features but with less maturity.

Future of Stable-Baselines

PyTorch version

I currently have an internal PyTorch version of Stable Baselines, codename "Torchy Baselines" (and its zoo), that I use for my research (RL for robotics). It already has a working version of A2C, PPO, SAC and TD3.

I dropped python 3.5 support in order to use f-strings, more typing and have no issues with dicts. Python 3.5 end of life is coming soon anyway.

We agree with the other maintainers that this will be a good starting point but with some conditions:

Release date

The plan is to release an early version (and its zoo) as soon as possible (in the next two months, so before the end of April).

New name

Because of the big changes and also because it will be released under the DLR-RM team, we will update the name of the library:
Stable-Baselines3 will be its new name (so we keep the Stable Baselines name while having a different package to show the huge internal change)

V2 support

The plan (as soon as the V3 is released) would be to do only bug fixes for v2 for 6 months. We will give more details on that later.