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

[Tune] Do not warn in BayesOpt w/ Uniform sampler #30350

Merged
merged 4 commits into from
Nov 19, 2022

Conversation

Yard1
Copy link
Member

@Yard1 Yard1 commented Nov 16, 2022

Signed-off-by: Antoni Baum [email protected]

Why are these changes needed?

BayesOpt supports only uniform sampling, but we erroneously warn when the Uniform sampler is used (as opposed to no sampler at all). This PR fixes that issue.

Related issue number

Closes #30338

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

@justinvyu
Copy link
Contributor

Do we clarify in the docs what can be passed into the search space when using BayesOptSearch?

@Yard1
Copy link
Member Author

Yard1 commented Nov 17, 2022

@justinvyu We indirectly mention that by stating the space has to be continuous - we don't really call this out specifically in any searcher, really. We should improve that in a future PR!

@justinvyu
Copy link
Contributor

Does the check need to also include other continuous spaces (LogUniform)? Maybe I am missing something here though.

@Yard1
Copy link
Member Author

Yard1 commented Nov 17, 2022

No, this searcher only supports basic uniform sampling:

            if isinstance(domain, Float):
                if domain.sampler is not None and not isinstance(
                    domain.sampler, Uniform
                ):
                    logger.warning(
                        "BayesOpt does not support specific sampling methods. "
                        "The {} sampler will be dropped.".format(sampler)
                    )
                return (domain.lower, domain.upper) # <- BayesOpt domain definition allowing only for uniform sampling

@xwjiang2010
Copy link
Contributor

Just curious, why is that BayesOpt only supports uniform sampler?

btw, will this page be updated? https://docs.ray.io/en/latest/tune/examples/bayesopt_example.html

It has the wrong warning..

@Yard1
Copy link
Member Author

Yard1 commented Nov 18, 2022

It only supports the uniform sampler as that's what's the underlying library supports.

Removed the warning from example!

Signed-off-by: Antoni Baum <[email protected]>
Copy link
Contributor

@krfricke krfricke left a comment

Choose a reason for hiding this comment

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

Thanks!

@krfricke krfricke merged commit 24621d6 into ray-project:master Nov 19, 2022
@Yard1 Yard1 deleted the bayesopt_warning branch November 19, 2022 09:54
WeichenXu123 pushed a commit to WeichenXu123/ray that referenced this pull request Dec 19, 2022
BayesOpt supports only uniform sampling, but we erroneously warn when the Uniform sampler is used (as opposed to no sampler at all). This PR fixes that issue.

Signed-off-by: Antoni Baum <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
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.

[Tune] Issue on page /tune/key-concepts.html
4 participants