Skip to content

Conversation

@dahlem
Copy link

@dahlem dahlem commented Mar 31, 2025

Upgrade hydra_optuna_sweeper to Optuna 4.2.1

Summary

This PR upgrades the hydra_optuna_sweeper plugin to use Optuna 4.2.1 (from 3.0.0) and updates the code to comply with the latest
Optuna APIs, replacing deprecated distribution classes and methods.

Changes

  • Replace deprecated distribution classes with modern equivalents:
    • DiscreteUniformDistributionFloatDistribution with step parameter
    • IntUniformDistribution, IntLogUniformDistributionIntDistribution
    • UniformDistribution, LogUniformDistributionFloatDistribution
  • Update Trial API usage to public methods instead of internal ones
  • Update sampler configurations to remove deprecated parameters
  • Update tests to reflect the new distribution classes
  • Add news entry (enable python3.10 CI for Windows #2444)

Test Plan

  • Unit tests for distribution classes and API pass
  • Example applications run successfully
  • Manual testing with different samplers and storage options

Backward Compatibility

This change maintains backward compatibility with existing configurations.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 31, 2025
@charleswilmot
Copy link

I need this!

@filyp
Copy link

filyp commented Dec 20, 2025

Awesome! I see merging this could resolve a bunch of other issues:
#2562
#2995
#2162
#2360
and maybe more.

The old sweeper is currently unusable for me, so for now I'm installing directly from this PR with:

hydra-optuna-sweeper @ git+https://github.com/dahlem/hydra.git@feature/upgrade-optuna-4.2.1#subdirectory=plugins/hydra_optuna_sweeper

and for me it's working without issues (I'm using TPESampler and various FloatDistributions, both log and uniform).

@amadeuszsz
Copy link

@rsokl
Sorry for direct ping recently active maintainer 🙏🏻

Is there any chance to merge this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants