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] Issue 41370: Tune update_config should use config.to_dict() if config is an _Config. #42116

Merged

Conversation

simonsays1980
Copy link
Collaborator

@simonsays1980 simonsays1980 commented Dec 28, 2023

Why are these changes needed?

When storing the params.json for RLlib experiments the config is of class AlgorithmConfig and not dict. Because of this the params.json contained only an object description, but not the content. This PR fixes this by calling the to_dict()-method of the AlgorithmConfig.
Other config classes can also implement a to_dict method such that this solution is well generalizable.

Everything that is dict remains dict.

Related issue number

Closes #41370

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 :(

…llback' and 'JsonLogger' classes. Due to the fact that the 'AlgorithmConfig' is not a dictionary the 'params.json' file contained simply a object reference and not the dict. This commit fixes this issue.

Signed-off-by: Simon Zehnder <simon.zehnder@gmail.com>
Signed-off-by: Simon Zehnder <simon.zehnder@gmail.com>
@simonsays1980 simonsays1980 marked this pull request as ready for review December 28, 2023 14:35
@sven1977 sven1977 changed the title Fix issue 41370 config to dict [RLlib] Issue 41370: Tune update_config should use config.to_dict() if config is an AlgorithmConfig. Jan 4, 2024
Signed-off-by: Simon Zehnder <simon.zehnder@gmail.com>
Signed-off-by: Simon Zehnder <simon.zehnder@gmail.com>
Signed-off-by: Simon Zehnder <simon.zehnder@gmail.com>
…rts i.

Signed-off-by: Simon Zehnder <simon.zehnder@gmail.com>
Signed-off-by: Simon Zehnder <simon.zehnder@gmail.com>
Signed-off-by: Simon Zehnder <simon.zehnder@gmail.com>
Signed-off-by: Sven Mika <sven@anyscale.io>
Copy link
Contributor

@sven1977 sven1977 left a comment

Choose a reason for hiding this comment

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

LGTM.

Signed-off-by: Sven Mika <sven@anyscale.io>
@sven1977 sven1977 changed the title [RLlib] Issue 41370: Tune update_config should use config.to_dict() if config is an AlgorithmConfig. [RLlib] Issue 41370: Tune update_config should use config.to_dict() if config is an _Config. Jan 24, 2024
@sven1977 sven1977 merged commit 1826060 into ray-project:master Jan 24, 2024
9 checks passed
khluu pushed a commit to khluu/ray that referenced this pull request Jan 24, 2024
… if config is an `_Config`. (ray-project#42116)

Signed-off-by: khluu <khluu000@gmail.com>
khluu pushed a commit to khluu/ray that referenced this pull request Jan 24, 2024
… if config is an `_Config`. (ray-project#42116)

Signed-off-by: khluu <khluu000@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RLlib] Restored experiments params.json incorrectly serialized
2 participants