Skip to content

Commit

Permalink
Revert "Revert "Revert "Revert "[RLlib] Upgrade to gymnasium 1.0.0 (a…
Browse files Browse the repository at this point in the history
…le_py 0.10.1, mujoco 3.2.4, pettingzoo 1.24.3 supersuit 3.9.3)."""" (ray-project#48443)

Signed-off-by: mohitjain2504 <mohit.jain@dream11.com>
  • Loading branch information
sven1977 authored and mohitjain2504 committed Nov 15, 2024
1 parent 041f0b6 commit 9b9b3f1
Show file tree
Hide file tree
Showing 82 changed files with 1,032 additions and 1,978 deletions.
2 changes: 1 addition & 1 deletion doc/source/ray-core/examples/plot_pong_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
"@ray.remote\n",
"class RolloutWorker(object):\n",
" def __init__(self):\n",
" self.env = gym.make(\"ALE/Pong-v5\")\n",
" self.env = gym.make(\"ale_py:ALE/Pong-v5\")\n",
"\n",
" def compute_gradient(self, model):\n",
" # Compute a simulation episode.\n",
Expand Down
2 changes: 1 addition & 1 deletion doc/source/rllib/doc_code/dreamerv3_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

env_name = "CartPole-v1"
# Use the vector env API.
env = gym.vector.make(env_name, num_envs=1, asynchronous=False)
env = gym.make_vec(env_name, num_envs=1, vectorization_mode="sync")

terminated = truncated = False
# Reset the env.
Expand Down
2 changes: 1 addition & 1 deletion doc/source/rllib/doc_code/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
try:
import gymnasium as gym

env = gym.make("ALE/Pong-v5")
env = gym.make("ale_py:ALE/Pong-v5")
obs, infos = env.reset()
except Exception:
import gym
Expand Down
2 changes: 1 addition & 1 deletion doc/source/rllib/rllib-examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ in roughly 5min. It can be run like this on a single g5.24xlarge (or g6.24xlarge
.. code-block:: bash
$ cd ray/rllib/tuned_examples/ppo
$ python atari_ppo.py --env ALE/Pong-v5 --num-gpus=4 --num-env-runners=95
$ python atari_ppo.py --env=ale_py:ALE/Pong-v5 --num-gpus=4 --num-env-runners=95
Note that some of the files in this folder are used for RLlib's daily or weekly
release tests as well.
Expand Down
2 changes: 1 addition & 1 deletion python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ colorful
rich
opentelemetry-sdk
fastapi
gymnasium==0.28.1
gymnasium==1.0.0
virtualenv!=20.21.1,>=20.0.24
opentelemetry-api
opencensus
Expand Down
39 changes: 14 additions & 25 deletions python/requirements/ml/rllib-test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,32 @@
# Environment adapters.
# ---------------------
# Atari
gymnasium==0.28.1; python_version < "3.12"
imageio; python_version < "3.12"
ale_py==0.8.1; python_version < "3.12"
ale_py==0.10.1
imageio==2.34.2
opencv-python==4.8.1.78

# For testing MuJoCo envs with gymnasium.
mujoco==2.3.6; python_version < "3.12"
mujoco==3.2.4
dm_control==1.0.12; python_version < "3.12"

# For tests on PettingZoo's multi-agent envs.
pettingzoo==1.23.1
# When installing pettingzoo, chess is missing, even though its a dependancy
# TODO: remove if a future pettingzoo and/or ray version fixes this dependancy issue.
chess==1.7.0
pettingzoo==1.24.3
pymunk==6.2.1
supersuit==3.8.0; python_version < "3.12"
tinyscaler==1.2.6; python_version < "3.12"
shimmy

# Kaggle envs.
kaggle_environments==1.7.11
# Unity3D testing
# TODO(sven): Add this back to rllib-requirements.txt once mlagents no longer pins torch<1.9.0 version.
#mlagents==0.28.0
mlagents_envs==0.28.0
tinyscaler==1.2.8
shimmy==2.0.0
supersuit==3.9.3

# For tests on minigrid.
minigrid
# For tests on RecSim and Kaggle envs.
# Explicitly depends on `tensorflow` and doesn't accept `tensorflow-macos`
recsim==0.2.4; (sys_platform != 'darwin' or platform_machine != 'arm64') and python_version < "3.12"
# recsim depends on dopamine-rl, but dopamine-rl pins gym <= 0.25.2, which break some envs
dopamine-rl==4.0.5; (sys_platform != 'darwin' or platform_machine != 'arm64') and python_version < "3.12"
minigrid==2.3.1
tensorflow_estimator

# DeepMind's OpenSpiel
open-spiel==1.4

# Unity3D testing
mlagents_envs==0.28.0

# Requires libtorrent which is unavailable for arm64
autorom[accept-rom-license]; platform_machine != "arm64"
h5py==3.10.0

# Requirements for rendering.
Expand Down
31 changes: 8 additions & 23 deletions python/requirements_compiled.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ aiosqlite==0.19.0
# via ypy-websocket
alabaster==0.7.13
# via sphinx
ale-py==0.8.1 ; python_version < "3.12"
ale-py==0.10.1
# via
# -r /ray/ci/../python/requirements/ml/rllib-test-requirements.txt
# gym
# gymnasium
alembic==1.12.1
# via
# aim
Expand Down Expand Up @@ -272,8 +272,6 @@ charset-normalizer==3.3.2
# via
# requests
# snowflake-connector-python
chess==1.7.0
# via -r /ray/ci/../python/requirements/ml/rllib-test-requirements.txt
chex==0.1.7
# via optax
clang-format==12.0.1
Expand Down Expand Up @@ -306,7 +304,6 @@ cloudpickle==2.2.0
# -r /ray/ci/../python/requirements/test-requirements.txt
# dask
# distributed
# gym
# gymnasium
# hyperopt
# mlagents-envs
Expand Down Expand Up @@ -704,13 +701,7 @@ gsutil==5.27
# via -r /ray/ci/../python/requirements/docker/ray-docker-requirements.txt
gunicorn==20.1.0
# via mlflow
gym==0.26.2
# via
# dopamine-rl
# recsim
gym-notices==0.0.8
# via gym
gymnasium==0.28.1 ; python_version < "3.12"
gymnasium==1.0.0
# via
# -r /ray/ci/../python/requirements.txt
# -r /ray/ci/../python/requirements/ml/rllib-test-requirements.txt
Expand Down Expand Up @@ -1126,7 +1117,7 @@ msrestazure==0.6.4
# via
# -r /ray/ci/../python/requirements/test-requirements.txt
# azure-cli-core
mujoco==2.3.6 ; python_version < "3.12"
mujoco==3.2.4
# via
# -r /ray/ci/../python/requirements/ml/rllib-test-requirements.txt
# dm-control
Expand Down Expand Up @@ -1246,7 +1237,6 @@ numpy==1.26.4
# flax
# gpy
# gradio
# gym
# gymnasium
# h5py
# hpbandster
Expand Down Expand Up @@ -1290,7 +1280,6 @@ numpy==1.26.4
# pyro-ppl
# pytorch-lightning
# raydp
# recsim
# scikit-image
# scikit-learn
# scipy
Expand Down Expand Up @@ -1489,7 +1478,7 @@ pbr==6.0.0
# sarif-om
peewee==3.17.0
# via semgrep
pettingzoo==1.23.1
pettingzoo==1.24.3
# via -r /ray/ci/../python/requirements/ml/rllib-test-requirements.txt
pexpect==4.8.0
# via
Expand Down Expand Up @@ -1862,8 +1851,6 @@ querystring-parser==1.2.4
# via raydp
raydp==1.7.0b20231020.dev0
# via -r /ray/ci/../python/requirements/ml/data-test-requirements.txt
recsim==0.2.4 ; (sys_platform != "darwin" or platform_machine != "arm64") and python_version < "3.12"
# via -r /ray/ci/../python/requirements/ml/rllib-test-requirements.txt
redis==4.4.2
# via -r /ray/ci/../python/requirements/test-requirements.txt
regex==2024.5.15
Expand Down Expand Up @@ -2049,7 +2036,7 @@ shellcheck-py==0.7.1.1
# via -r /ray/ci/../python/requirements/lint-requirements.txt
shellingham==1.5.4
# via typer
shimmy==1.3.0
shimmy==2.0.0
# via -r /ray/ci/../python/requirements/ml/rllib-test-requirements.txt
shortuuid==1.0.1
# via -r /ray/ci/../python/requirements/ml/tune-test-requirements.txt
Expand Down Expand Up @@ -2167,9 +2154,7 @@ statsmodels==0.14.0
# via
# hpbandster
# statsforecast
strictyaml==1.7.3
# via pyiceberg
supersuit==3.8.0 ; python_version < "3.12"
supersuit==3.9.3
# via -r /ray/ci/../python/requirements/ml/rllib-test-requirements.txt
sympy==1.13.1
# via
Expand Down Expand Up @@ -2256,7 +2241,7 @@ timm==0.9.2
# via -r /ray/ci/../python/requirements/ml/tune-test-requirements.txt
tinycss2==1.3.0
# via nbconvert
tinyscaler==1.2.6 ; python_version < "3.12"
tinyscaler==1.2.8
# via
# -r /ray/ci/../python/requirements/ml/rllib-test-requirements.txt
# supersuit
Expand Down
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def get_packages(self):

setup_spec.extras["rllib"] = setup_spec.extras["tune"] + [
"dm_tree",
"gymnasium==0.28.1",
"gymnasium==1.0.0",
"lz4",
"scikit-image",
"pyyaml",
Expand Down
2 changes: 1 addition & 1 deletion release/long_running_tests/workloads/apex.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
{
"apex": {
"run": "APEX",
"env": "ALE/Pong-v5",
"env": "ale_py:ALE/Pong-v5",
"config": {
"num_workers": 3,
"num_gpus": 0,
Expand Down
2 changes: 1 addition & 1 deletion release/ml_user_tests/tune_rllib/run_connect_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def run(smoke_test=False, storage_path: str = None):

config = (
APPOConfig()
.environment("ALE/Pong-v5", clip_rewards=True)
.environment("ale_py:ALE/Pong-v5", clip_rewards=True)
.framework(tune.grid_search(["tf", "torch"]))
.rollouts(
rollout_fragment_length=50,
Expand Down
4 changes: 2 additions & 2 deletions release/ray_release/byod/requirements_byod_3.9.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ dask[complete]
fastapi
gcsfs==2023.5.0
gsutil
gym
gym[atari]
gymnasium
gymnasium[atari]
importlib-metadata
jsonschema==4.17.3
lightgbm
Expand Down
Loading

0 comments on commit 9b9b3f1

Please sign in to comment.