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

updated optuna_search to allow users to configure optuna storage #48547

Merged
merged 55 commits into from
Dec 10, 2024

Conversation

ravi-dalal
Copy link
Contributor

Why are these changes needed?

The OptunaSearch currently uses in-memory storage and does not provide a way to configure any other storages (e.g. database). This update add a configurable parameter to OptunaSearch that can be set to a valid Optuna Storage.

Related issue number

Closes #48500

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

@ravi-dalal
Copy link
Contributor Author

@hongpeng-guo @justinvyu @matthewdeng @raulchen @woshiyyya could you please take a look at this PR?

Copy link
Contributor

@hongpeng-guo hongpeng-guo left a comment

Choose a reason for hiding this comment

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

@ravi-dalal Thanks for contributing to the ray project! Left a few comments. One question that I have is on the study_name argument, please elaborate more why this arg is necessary to be here with the storage.

@ravi-dalal
Copy link
Contributor Author

@hongpeng-guo Thank you for taking time to review this PR. I updated the PR following your comments. PTAL when you get time.

Copy link
Contributor

@hongpeng-guo hongpeng-guo left a comment

Choose a reason for hiding this comment

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

@ravi-dalal Thanks for your contribution! PR LGTM.
cc @matthewdeng for one more pass before merge this PR.

@hongpeng-guo hongpeng-guo added the go add ONLY when ready to merge, run all tests label Dec 6, 2024
@@ -1519,7 +1516,7 @@ py-cpuinfo==9.0.0
# via deepspeed
py-partiql-parser==0.5.0
# via moto
py-spy==0.4.0 ; python_version < "3.12"
py-spy==0.3.14
Copy link
Contributor

Choose a reason for hiding this comment

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

@hongpeng-guo I think we need to rebase/pull in the latest compiled dependencies here. This was modified in 73a4c42

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch!

@hongpeng-guo hongpeng-guo added go add ONLY when ready to merge, run all tests and removed go add ONLY when ready to merge, run all tests labels Dec 6, 2024
@hongpeng-guo hongpeng-guo removed the go add ONLY when ready to merge, run all tests label Dec 6, 2024
@hongpeng-guo hongpeng-guo added the go add ONLY when ready to merge, run all tests label Dec 9, 2024
Comment on lines 381 to 382
else:
self._storage = ot.storages.InMemoryStorage()
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch! Let me quickly fix it.

Copy link
Contributor

@justinvyu justinvyu left a comment

Choose a reason for hiding this comment

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

Thanks, just some nits.

python/ray/tune/search/optuna/optuna_search.py Outdated Show resolved Hide resolved
python/ray/tune/search/optuna/optuna_search.py Outdated Show resolved Hide resolved
Copy link
Contributor

@hongpeng-guo hongpeng-guo left a comment

Choose a reason for hiding this comment

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

cc @justinvyu @matthewdeng, merge this one?

@matthewdeng matthewdeng merged commit 912d8cb into ray-project:master Dec 10, 2024
5 checks passed
simonsays1980 pushed a commit to simonsays1980/ray that referenced this pull request Dec 12, 2024
ray-project#48547)

The OptunaSearch currently uses in-memory storage and does not provide a
way to configure any other storages (e.g. database). This update add a
configurable parameter to OptunaSearch that can be set to a valid Optuna
Storage.

Signed-off-by: Ravi Dalal <[email protected]>
Signed-off-by: Ravi Dalal <[email protected]>
Signed-off-by: Hongpeng Guo <[email protected]>
Co-authored-by: Hongpeng Guo <[email protected]>
Co-authored-by: matthewdeng <[email protected]>
Co-authored-by: Hongpeng Guo <[email protected]>
Co-authored-by: Justin Yu <[email protected]>
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Dec 17, 2024
ray-project#48547)

The OptunaSearch currently uses in-memory storage and does not provide a
way to configure any other storages (e.g. database). This update add a
configurable parameter to OptunaSearch that can be set to a valid Optuna
Storage.

Signed-off-by: Ravi Dalal <[email protected]>
Signed-off-by: Ravi Dalal <[email protected]>
Signed-off-by: Hongpeng Guo <[email protected]>
Co-authored-by: Hongpeng Guo <[email protected]>
Co-authored-by: matthewdeng <[email protected]>
Co-authored-by: Hongpeng Guo <[email protected]>
Co-authored-by: Justin Yu <[email protected]>
Signed-off-by: ujjawal-khare <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Tune] Allow Storage to be configurable for OptunaSearch
4 participants