Skip to content

Commit

Permalink
[RLlib][RLlib contrib] add soft deprecation notices to maml and a3c (r…
Browse files Browse the repository at this point in the history
…ay-project#35345)

Signed-off-by: Avnish <[email protected]>
  • Loading branch information
avnishn authored May 18, 2023
1 parent 006bb51 commit 658c8e3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
12 changes: 12 additions & 0 deletions rllib/algorithms/a3c/a3c.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from ray.rllib.evaluation.rollout_worker import RolloutWorker
from ray.rllib.policy.policy import Policy
from ray.rllib.utils.annotations import override
from ray.rllib.utils.deprecation import deprecation_warning
from ray.rllib.utils.metrics import (
APPLY_GRADS_TIMER,
GRAD_WAIT_TIMER,
Expand Down Expand Up @@ -58,6 +59,17 @@ class A3CConfig(AlgorithmConfig):

def __init__(self, algo_class=None):
"""Initializes a A3CConfig instance."""
deprecation_warning(
old="rllib/algorithms/a3c/a3c.py",
new="rllib_contrib/a3c/",
help=(
"This algorithm will be "
"deprecated from RLlib in future releases. It is being moved to the "
"ray/rllib_contrib directory. See "
"https://github.com/ray-project/enhancements/blob/main/reps/2023-04-28-remove-algorithms-from-rllib.md" # noqa: E501
"for more details."
),
)
super().__init__(algo_class=algo_class or A3C)

# fmt: off
Expand Down
13 changes: 12 additions & 1 deletion rllib/algorithms/maml/maml.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from ray.rllib.execution.metric_ops import CollectMetrics
from ray.rllib.evaluation.metrics import collect_metrics
from ray.rllib.utils.annotations import override
from ray.rllib.utils.deprecation import DEPRECATED_VALUE
from ray.rllib.utils.deprecation import DEPRECATED_VALUE, deprecation_warning
from ray.rllib.utils.metrics.learner_info import LEARNER_INFO
from ray.rllib.utils.sgd import standardized
from ray.util.iter import from_actors, LocalIterator
Expand Down Expand Up @@ -294,6 +294,17 @@ class MAML(Algorithm):
@classmethod
@override(Algorithm)
def get_default_config(cls) -> AlgorithmConfig:
deprecation_warning(
old="rllib/algorithms/maml/maml.py",
new="rllib_contrib/maml/",
help=(
"This algorithm will be "
"deprecated from RLlib in future releases. It is being moved to the "
"ray/rllib_contrib directory. See "
"https://github.com/ray-project/enhancements/blob/main/reps/2023-04-28-remove-algorithms-from-rllib.md" # noqa: E501
"for more details."
),
)
return MAMLConfig()

@classmethod
Expand Down

0 comments on commit 658c8e3

Please sign in to comment.