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] Introduce new OldAPIStack decorator; Do-over of all API decorators #43657

Merged
merged 7 commits into from
Mar 4, 2024

Conversation

sven1977
Copy link
Contributor

@sven1977 sven1977 commented Mar 3, 2024

Introduce new OldAPIStack decorator; Do-over of all API decorators

Why are these changes needed?

Related issue number

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 added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • 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: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
@sven1977 sven1977 added rllib-newstack rllib-oldstack-cleanup Issues related to cleaning up classes, utilities on the old API stack rllib RLlib related issues labels Mar 3, 2024
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Copy link
Collaborator

@simonsays1980 simonsays1980 left a comment

Choose a reason for hiding this comment

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

LGTM. More cleanup and finally I can feel the last breath of the old stack :D

@@ -11,7 +11,7 @@
tf1, _, _ = try_import_tf()


@ExperimentalAPI
@OldAPIStack
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why old stack? Isnt't this the class SingleAgentEnvRunner and MultiAgentEnvRunner inherit from?

@@ -19,7 +19,7 @@
logger = logging.getLogger(__name__)


@PublicAPI
@OldAPIStack
Copy link
Collaborator

Choose a reason for hiding this comment

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

Imo we should keep this until we have a better solution to vectorize multi-agent environments as pettingzoo doe snot provide vectorization, yet.

from ray.rllib.utils.torch_utils import sequence_mask
from ray.rllib.utils.framework import TensorType

torch, nn = try_import_torch()


@OldAPIStack
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's actually the state on attention? WIll the new stack get encoders and heads with attention? Also, I see more often in papers an MLP encoder followed by an LSTM head - maybe we should provide an LSTM head in the same breath, too.

@@ -60,7 +59,7 @@
logger = logging.getLogger(__name__)


@DeveloperAPI
@OldAPIStack
Copy link
Collaborator

Choose a reason for hiding this comment

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

Bye bye policy :) I like it.

@@ -12,7 +13,7 @@ def _linear_interpolation(left, right, alpha):
return left + alpha * (right - left)


@PublicAPI
@DeveloperAPI
Copy link
Collaborator

Choose a reason for hiding this comment

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

We might think about a sinusoidal schedule - I see this more often in the papers now.

@sven1977 sven1977 merged commit 7b407c6 into ray-project:master Mar 4, 2024
8 of 9 checks passed
@sven1977 sven1977 deleted the old_api_stack_decorator branch March 4, 2024 14:36
ryanaoleary pushed a commit to ryanaoleary/ray that referenced this pull request Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rllib RLlib related issues rllib-newstack rllib-oldstack-cleanup Issues related to cleaning up classes, utilities on the old API stack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants