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

[docs] [rllib] Remove outdated RLlib examples from the docs 1/N #41472

Merged
merged 8 commits into from Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
54 changes: 0 additions & 54 deletions doc/source/ray-overview/examples.rst
Expand Up @@ -639,66 +639,12 @@ Ray Examples

Example of how to setup an RLlib algorithm against a locally running Unity3D editor

.. grid-item-card:: :bdg-secondary:`Code example`
:class-item: gallery-item rl
:link: https://github.com/ray-project/ray/blob/master/rllib/examples/env_rendering_and_recording.py

Rendering and recording of an environment

.. grid-item-card:: :bdg-secondary:`Code example`
:class-item: gallery-item rl
:link: https://github.com/ray-project/ray/blob/master/rllib/examples/coin_game_env.py

Coin game example with RLlib

.. grid-item-card:: :bdg-secondary:`Code example`
:class-item: gallery-item reinforcement-learning rllib
:link: https://github.com/ray-project/ray/blob/master/rllib/examples/dmlab_watermaze.py

Example for how to use a DMLab environment (Watermaze)

.. grid-item-card:: :bdg-secondary:`Code example`
:class-item: gallery-item rl
:link: https://github.com/ray-project/ray/blob/master/rllib/examples/recommender_system_with_recsim_and_slateq.py

RecSym environment example (for recommender systems) using the SlateQ algorithm

.. grid-item-card:: :bdg-secondary:`Code example`
:class-item: gallery-item reinforcement-learning rllib
:link: https://github.com/ray-project/ray/blob/master/rllib/examples/sumo_env_local.py

Example demonstrating how to use the SUMO simulator in connection with RLlib.

.. grid-item-card:: :bdg-secondary:`Code example`
:class-item: gallery-item rl
:link: https://github.com/ray-project/ray/blob/master/rllib/examples/vizdoom_with_attention_net.py

VizDoom example script using RLlib's auto-attention wrapper

.. grid-item-card:: :bdg-secondary:`Code example`
:class-item: gallery-item rl
:link: https://github.com/ray-project/ray/blob/master/rllib/env/tests/test_env_with_subprocess.py

Example of how to ensure subprocesses spawned by envs are killed when RLlib exits.

.. grid-item-card:: :bdg-secondary:`Code example`
:class-item: gallery-item rl
:link: https://github.com/ray-project/ray/blob/master/rllib/examples/attention_net.py

Attention Net (GTrXL) learning the "repeat-after-me" environment

.. grid-item-card:: :bdg-secondary:`Code example`
:class-item: gallery-item reinforcement-learning rllib
:link: https://github.com/ray-project/ray/blob/master/rllib/examples/lstm_auto_wrapping.py

Example showing how to use the auto-LSTM wrapper for your default- and custom models in RLlib.

.. grid-item-card:: :bdg-secondary:`Code example`
:class-item: gallery-item reinforcement-learning rllib pytorch tensorflow
:link: https://github.com/ray-project/ray/blob/master/rllib/examples/custom_rnn_model.py

Example of using a custom Keras- or PyTorch RNN model.

.. grid-item-card:: :bdg-secondary:`Code example`
:class-item: gallery-item reinforcement-learning rllib
:link: https://github.com/ray-project/ray/blob/master/rllib/examples/custom_model_loss_and_metrics.py
Expand Down
19 changes: 0 additions & 19 deletions doc/source/rllib/feature_overview.rst
Expand Up @@ -35,25 +35,6 @@
on 100s of CPUs/nodes thus parallelizing and speeding up learning.


.. container:: clear-both

.. container:: buttons-float-left

.. https://docs.google.com/drawings/d/1b8uaRo0KjPH-x-elBmyvDwAA4I2oy8cj3dxNnUT3HTE/edit

.. image:: images/sigils/rllib-sigil-vector-envs.svg
:width: 100
:target: https://github.com/ray-project/ray/blob/master/rllib/examples/env_rendering_and_recording.py

.. container::

**Vectorized (batched) and remote (parallel) environments**: RLlib auto-vectorizes
your ``gym.Envs`` via the ``num_envs_per_worker`` config. Environment workers can
then batch and thus significantly speedup the action computing forward pass.
On top of that, RLlib offers the ``remote_worker_envs`` config to create
`single environments (within a vectorized one) as ray Actors <https://github.com/ray-project/ray/blob/master/rllib/examples/remote_envs_with_inference_done_on_main_node.py>`_,
thus parallelizing even the env stepping process.

.. container:: clear-both

.. container:: buttons-float-left
Expand Down
18 changes: 0 additions & 18 deletions doc/source/rllib/rllib-examples.rst
Expand Up @@ -43,33 +43,15 @@ Environments and Adapters
Use this example to try things out and watch the game and the learning progress live in the editor.
Providing a compiled game, this example could also run in distributed fashion with `num_workers > 0`.
For a more heavy-weight, distributed, cloud-based example, see ``Unity3D client/server`` below.
- `Rendering and recording of an environment <https://github.com/ray-project/ray/blob/master/rllib/examples/env_rendering_and_recording.py>`__:
Example showing how to switch on rendering and recording of an env.
- `Coin Game Example <https://github.com/ray-project/ray/blob/master/rllib/examples/coin_game_env.py>`__:
Coin Game Env Example (provided by the "Center on Long Term Risk").
- `DMLab Watermaze example <https://github.com/ray-project/ray/blob/master/rllib/examples/dmlab_watermaze.py>`__:
Example for how to use a DMLab environment (Watermaze).
- `RecSym environment example (for recommender systems) using the SlateQ algorithm <https://github.com/ray-project/ray/blob/master/rllib/examples/recommender_system_with_recsim_and_slateq.py>`__:
Script showing how to train SlateQ on a RecSym environment.
- `SUMO (Simulation of Urban MObility) environment example <https://github.com/ray-project/ray/blob/master/rllib/examples/sumo_env_local.py>`__:
Example demonstrating how to use the SUMO simulator in connection with RLlib.
- `VizDoom example script using RLlib's auto-attention wrapper <https://github.com/ray-project/ray/blob/master/rllib/examples/vizdoom_with_attention_net.py>`__:
Script showing how to run PPO with an attention net against a VizDoom gym environment.
- `Subprocess environment <https://github.com/ray-project/ray/blob/master/rllib/env/tests/test_env_with_subprocess.py>`__:
Example of how to ensure subprocesses spawned by envs are killed when RLlib exits.


Custom- and Complex Models
--------------------------

- `Attention Net (GTrXL) learning the "repeat-after-me" environment <https://github.com/ray-project/ray/blob/master/rllib/examples/attention_net.py>`__:
Example showing how to use the auto-attention wrapper for your default- and custom models in RLlib.
- `LSTM model learning the "repeat-after-me" environment <https://github.com/ray-project/ray/blob/master/rllib/examples/lstm_auto_wrapping.py>`__:
Example showing how to use the auto-LSTM wrapper for your default- and custom models in RLlib.
- `Custom Keras model <https://github.com/ray-project/ray/blob/master/rllib/examples/custom_keras_model.py>`__:
Example of using a custom Keras model.
- `Custom Keras/PyTorch RNN model <https://github.com/ray-project/ray/blob/master/rllib/examples/custom_rnn_model.py>`__:
Example of using a custom Keras- or PyTorch RNN model.
- `Registering a custom model with supervised loss <https://github.com/ray-project/ray/blob/master/rllib/examples/custom_model_loss_and_metrics.py>`__:
Example of defining and registering a custom model with a supervised loss.
- `Batch normalization <https://github.com/ray-project/ray/blob/master/rllib/examples/batch_norm_model.py>`__:
Expand Down
17 changes: 1 addition & 16 deletions doc/source/rllib/rllib-models.rst
Expand Up @@ -300,20 +300,6 @@ More examples and explanations on how to implement custom Tuple/Dict processing
custom RNNs, custom model APIs (on top of default models) follow further below.


Wrapping a Custom Model (TF and PyTorch) with an LSTM- or Attention Net
```````````````````````````````````````````````````````````````````````

You can also use a custom (TF or PyTorch) model with our auto-wrappers for LSTMs (``use_lstm=True``) or Attention networks (``use_attention=True``).
For example, if you would like to wrap some non-default model logic with an LSTM, simply do:

.. literalinclude:: ../../../rllib/examples/lstm_auto_wrapping.py
:language: python
:start-after: __sphinx_doc_begin__
:end-before: __sphinx_doc_end__


.. _rnns:

Implementing custom Recurrent Networks
``````````````````````````````````````

Expand Down Expand Up @@ -351,8 +337,7 @@ Check out RLlib's `GTrXL (Attention Net) <https://arxiv.org/abs/1910.06764>`__ i
to get a better idea on how to write your own models of this type. These are the models we use
as wrappers when ``use_attention=True``.

You can run `this example script <https://github.com/ray-project/ray/blob/master/rllib/examples/attention_net.py>`__ to run these nets within some of our algorithms.
`There is also a test case <https://github.com/ray-project/ray/blob/master/rllib/models/tests/test_attention_nets.py>`__, which confirms their learning capabilities in PPO and IMPALA.
This `test case <https://github.com/ray-project/ray/blob/master/rllib/models/tests/test_attention_nets.py>`__ confirms their learning capabilities in PPO and IMPALA.

Batch Normalization
```````````````````
Expand Down
3 changes: 0 additions & 3 deletions release/rllib_tests/unit_gpu_tests/run.sh
Expand Up @@ -22,9 +22,6 @@ SUCCESS=1
# Run all test cases, but with a forced num_gpus=1.
export RLLIB_NUM_GPUS=1

if python rllib/examples/attention_net.py --as-test --stop-reward=20 --num-cpus=0; then SUCCESS=0; fi
if python rllib/examples/attention_net.py --framework=torch --as-test --stop-reward=20 --num-cpus=0; then SUCCESS=0; fi

popd || true

echo "{'passed': $SUCCESS}" > "${TEST_OUTPUT_JSON:-/tmp/release_test_out.json}"
Expand Down
25 changes: 0 additions & 25 deletions rllib/BUILD
Expand Up @@ -739,13 +739,6 @@ py_test(
# Tag: env
# --------------------------------------------------------------------

py_test(
name = "env/tests/test_env_with_subprocess",
tags = ["team:rllib", "env"],
size = "medium",
srcs = ["env/tests/test_env_with_subprocess.py"]
)

sh_test(
name = "env/tests/test_local_inference_cartpole",
tags = ["team:rllib", "env"],
Expand Down Expand Up @@ -1907,24 +1900,6 @@ py_test(
args = ["--stop-iter=2", "--framework=torch"]
)

py_test(
Copy link
Contributor

Choose a reason for hiding this comment

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

You have to also remove from this file: test_env_with_subprocess.

name = "examples/attention_net_tf",
main = "examples/attention_net.py",
tags = ["team:rllib", "exclusive", "examples"],
size = "medium",
srcs = ["examples/attention_net.py"],
args = ["--as-test", "--stop-reward=70", "--framework=tf"]
)

py_test(
name = "examples/attention_net_torch",
main = "examples/attention_net.py",
tags = ["team:rllib", "exclusive", "examples"],
size = "medium",
srcs = ["examples/attention_net.py"],
args = ["--as-test", "--stop-reward=70", "--framework torch"]
)

py_test(
name = "examples/autoregressive_action_dist_tf",
main = "examples/autoregressive_action_dist.py",
Expand Down
67 changes: 0 additions & 67 deletions rllib/env/tests/test_env_with_subprocess.py

This file was deleted.