Skip to content

Conversation

@sven1977
Copy link
Contributor

@sven1977 sven1977 commented Nov 12, 2024

Add missing get_ctor_args_and_kwargs methods to all ConnectorV2 built-in classes.

This is needed if ConnectorV2 pieces and pipelines should be restorable from a checkpoint.

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 <[email protected]>
Signed-off-by: sven1977 <[email protected]>
@sven1977 sven1977 added rllib RLlib related issues rllib-connectorv2 Connector related issues rllib-newstack labels Nov 12, 2024
Copy link
Contributor

@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. Maybe a docs change is needed to point this out to users writing their custom connectors.

return (
(), # args,
{
"multi_agent": self._multi_agent,
Copy link
Contributor

Choose a reason for hiding this comment

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

Okay so each connector must provide its arguments in this method to be correctly checkpointed. We might need to add this to the docs, as this might give users a bad experience, if they forget to add this in their own custom connectors and then run into problems loading their connector checkpoints.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, great point. Let me try to provide some default implementation, which tries to gather all local variables from the call-frame below super() (the user's custom c'tor that calls super()) ...

Signed-off-by: sven1977 <[email protected]>
@sven1977 sven1977 enabled auto-merge (squash) November 12, 2024 11:31
@github-actions github-actions bot added the go add ONLY when ready to merge, run all tests label Nov 12, 2024
@sven1977 sven1977 merged commit 37709da into ray-project:master Nov 12, 2024
3 checks passed
@sven1977 sven1977 deleted the add_ctor_args_and_kwargs_to_all_connector_pieces branch November 12, 2024 16:58
JP-sDEV pushed a commit to JP-sDEV/ray that referenced this pull request Nov 14, 2024
mohitjain2504 pushed a commit to mohitjain2504/ray that referenced this pull request Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-backlog go add ONLY when ready to merge, run all tests rllib RLlib related issues rllib-connectorv2 Connector related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants