Skip to content

Releases

v5.1.0

Choose a tag to compare

@c-bata c-bata released this 16 Nov 05:08
aee308a

Summary

This release adds Python 3.15 support, drops Python 3.9, speeds up plot_contour and plot_pareto_front, and includes many bug fixes.

What's Changed

Breaking Changes

Enhancements

  • Use incremental indexing for GA generation tracking by @yen-0 in #6819
  • Allow Python list for reference_points in NSGAIIISampler by @yen-0 in #6878
  • Add Python 3.15 support by @gen740 in #6897
  • Remove lru_cache from _FanovaTree by @not522 in #6900
  • Speed up plot_contour by replacing O(N^2) list.index lookups with dict lookups by @deep1blue in #6925
  • Speed up GridSampler search-space comparison by @deep1blue in #6931
  • Restore infeasible trial markers in plot_contour matrices by @vicmcorrea in #6934
  • Speed up plot_pareto_front by replacing O(N * |P|) list lookup in _get_non_pareto_front_trials by @deep1blue in #6938
  • Prevent download_artifact from overwriting late-created destinations by @HuaTNA in #6904

Bug Fixes

  • Fix gRPC trial datetime serialization by @gen740 in #6832
  • Propagate exceptions from final parallel trials in Study.optimize by @EmanueleCornaggia in #6842
  • Avoid zero-sum normalization in GP initial-point selection by @tandede in #6817
  • Fix repeated artifact removal in Backoff by @EmanueleCornaggia in #6843
  • Filter feasible trials when selecting best_trial in get_all_study_summaries by @taran-dev4u in #6879
  • Compare integer parameters exactly in enqueue_trial by @aalquwayfili in #6889
  • Avoid All-NaN RuntimeWarning in percentile pruner best-value lookup by @825pranav in #6873
  • Align constraint observations by name in GPSampler by @aswanth-07 in #6887
  • Avoid phantom metadata in upload_artifact for missing sources by @INo-xious in #6880
  • Avoid all-NaN warnings when computing percentile reference by @Ganesh1729-ui in #6893
  • Fix GridSampler crashing on enqueued trials with one grid remaining by @EmanueleCornaggia in #6844
  • Normalize GCS download NotFound to ArtifactNotFound by @CLCK0622 in #6917
  • fix(visualization): skip NaN targets in plot_rank instead of raising ZeroDivisionError by @inchang-ing in #6913
  • Keep infeasible categorical trials in plot_slice by @kokyouu in #6932
  • fix(study): honor an explicitly empty destination name in copy_study by @feiiiiii5 in #6951

Documentation

  • Fix outdated failure and NaN reporting examples in FAQ by @bodapatisaikrishna in #6850
  • Remove obsolete ChainerMNStudy note and fix Sphinx roles in FAQ by @bodapatisaikrishna in #6858
  • Pin sphinx-gallery to fix docs CI error by @y0z in #6863
  • docs: combine visualization backend examples by @gen740 in #6833
  • Updated documentation related to arguments of PatientPruner and WilcoxonPruner by @bidyut18 in #6944
  • Fix imports in the artifact tutorial Boto3ArtifactStore example by @ZainnQureshii in #6953
  • docs: fix duplicated word in hyperopt docstring by @ddlw in #6955

Tests

  • Simplify Study.enqueue_trial skip_if_exists tests by @gen740 in #6822
  • Remove the kaleido dependency for unit tests by @c-bata in #6830
  • Fix EDF figure type narrowing for mypy by @yen-0 in #6906

Code Fixes

  • Fix/ Add TypeVar generic typing to NamedTemporaryFilePool and remove unnecessary cast by @yen-0 in #6838
  • Fix native float output from parameter untransform by @yen-0 in #6869
  • Skip studies without finite observations in plot_edf by @aswanth-07 in #6882
  • Clarify why TPE excludes running trials from the gamma calculation by @kAIto47802 in #6888
  • Remove dead codes in GP by @nabenabe0928 in #6916
  • Refactor acqf selection routine by @nabenabe0928 in #6918

Continuous Integration

  • Fix unused mypy ignore in GP QMC sampling by @c-bata in #6848
  • Fix for mypy error by @y0z in #6851
  • Pinned every GitHub actions to commit SHA by @c-bata in #6852
  • Remove obsolete NumPy 1.x constraint from Windows CI by @taran-dev4u in #6862
  • Annotate RDB model columns with Mapped to fix mypy errors with SQLAlchemy 2.1 by @not522 in #6877
  • Exempt certifi from the dependency cooldown by @gen740 in #6928
  • Add timeout argument for gRPC server by @not522 in #6930
  • Bump reviewdog/action-suggester from 1.24.3 to 1.25.0 by @dependabot[bot] in #6857
  • Bump reviewdog/action-suggester from 1.25.0 to 1.26.1 by @dependabot[bot] in #6866
  • Bump astral-sh/setup-uv from 10.1.0 to 10.2.0 by @dependabot[bot] in #6875
  • Bump astral-sh/setup-uv from 10.2.0 to 10.3.0 by @dependabot[bot] in #6910
  • Bump actions/upload-artifact from 7.0.1 to 7.0.2 by @dependabot[bot] in #6909
  • Bump reviewdog/action-suggester from 1.26.1 to 1.26.2 by @dependabot[bot] in #6908
  • Bump reviewdog/action-suggester from 1.26.2 to 1.26.3 by @dependabot[bot] in #6927
  • Bump pypa/gh-action-pypi-publish from 1.14.2 to 1.14.3 by @dependabot[bot] in #6935
  • Bump astral-sh/setup-uv from 10.3.0 to 10.3.2 by @dependabot[bot] in #6936
  • Bump astral-sh/setup-uv from 10.3.2 to 10.3.3 by @dependabot[bot] in #6947
  • Bump reviewdog/action-suggester from 1.26.3 to 1.27.0 by @dependabot[bot] in #6962

Other

New Contributors

Full Changelog: v5.0.0...v5.1.0

v5.0.0

Choose a tag to compare

@c-bata c-bata released this 07 Sep 05:15
01ddd17

This is the release note for v5.0.0.

Highlights

Major Enhancements to the Default Sampler

Optuna v5.0 introduces the first major update to its default sampler configuration since v1.5. For single-objective optimization, TPESampler now enables multivariate TPE (#6746) and the constant liar strategy by default (#6738), together with enhanced bandwidth computation (Watanabe 2023). For multi-objective optimization, TPESampler replaces NSGAIISampler as the default sampler (#6766). These settings were selected through comprehensive benchmarking to improve optimization performance.

image4

New Core APIs for Constrained Optimization

Constrained optimization is now represented directly in Optuna’s core Trial API. Constraint values can be set inside the objective function using trial.set_constraint() and retrieved through trial.constraints, providing a consistent interface across supported samplers. Accordingly, the sampler-specific constraints_func arguments are now deprecated. (#6736, #6754, #6773)

PED-ANOVA Becomes the Default Parameter Importance Evaluator

Optuna v5.0 makes PedAnovaImportanceEvaluator the default evaluator used by optuna.importance.get_param_importances(), replacing f-ANOVA. PED-ANOVA computes parameter importances substantially faster, works with Optuna’s standard dependencies, and now supports conditional search spaces and multi-objective studies. The conditional extension, Conditional PED-ANOVA: Hyperparameter Importance in Hierarchical & Dynamic Search Spaces, was accepted at KDD 2026. (#6682, #6728, #6748)

Improved Parallel Optimization with GPSampler

GPSampler, now a stable API in Optuna v5.0, introduces Monte Carlo-based q-batch acquisition functions that account for trials currently under evaluation. Rather than assigning each running trial a single heuristic pseudo-value, these acquisition functions integrate over possible outcomes sampled from the Gaussian process posterior, allowing predictive uncertainty to inform subsequent suggestions.

The new acquisition functions cover all four major problem settings: qLogEI for unconstrained single-objective optimization, qLogCEI for constrained single-objective optimization, qLogEHVI for unconstrained multi-objective optimization, and qLogCEHVI for constrained multi-objective optimization. This provides a more principled approach to parallel Bayesian optimization across the problem settings supported by GPSampler. (#6715, #6640, #6744, #6792, #6804)

image2

Breaking Changes

Changes to trial timestamps in Optuna v5.0

Starting with Optuna v5.0, trial timestamps in RDBStorage and JournalStorage are recorded in UTC instead of local time. (#6776). This ensures consistent timestamps across workers running in different timezones.
When loading studies from storage created with Optuna versions earlier than v5.0, trial timestamps may be shifted due to changes in timezone handling. This is because earlier versions stored timestamps in local time without timezone information, and existing timestamps are not automatically converted to UTC when upgrading.
Before upgrading, back up your database and convert existing timestamps from their original local timezone to UTC if necessary. Note that optuna storage upgrade does not perform this conversion.

Other changes

  • Remove optuna.multi_objective module (#6686)
  • Remove deprecated integration wrappers for AllenNLP, Chainer, and MXNet (#6693)
  • Stabilize GPSampler (#6715)
  • Enable constant_liar by default (#6738)
  • Support categorical parameters in QMCSampler (#6742, thanks @saivedant169!)
  • Enable multivariate by default in TPESampler (#6746)
  • Remove deprecated positional-arg compatibility from study and trial APIs (#6747, thanks @yen-0!)
  • Make PedAnovaImportanceEvaluator the default importance evaluator (#6748)
  • Make TPESampler the default sampler for multi-objective optimization (#6766)
  • Deprecate constraints_func (#6773)
  • Change to treat cases without constraints as feasible (#6774)
  • Normalize trial timestamps to UTC in RDBStorage and JournalStorage (#6776)
  • Remove axis_order argument from plot_pareto_front (#6781)
  • Remove system_attrs from StudySummary (#6782)
  • Remove categorical_distance_func from TPESampler (#6783)
  • Remove deprecated modules (optuna/optuna-integration#293)
  • Remove MXNetPruningCallback (optuna/optuna-integration#294)
  • Use constraints property in BoTorchSampler (optuna/optuna-integration#306)
  • Remove set_system_attr and system_attrs from TorchDistributedTrial (optuna/optuna-integration#309)
  • Remove set_system_attr and system_attrs from Study and Trial (#6834)

New Features

  • Implement qLogEI acquisition function (#6640, thanks @sawa3030!)
  • Add support for conditional search spaces in PED-ANOVA (#6682)
  • Add conditional gp regressor (#6721)
  • Add mutation to ga (#6724, thanks @hrntsm!)
  • Use MOTPE-like split in PED-ANOVA for multi-objective studies when target is None (#6728)
  • Add constraints property to Trial (#6736)
  • Add set_constraint method to Trial (#6754)
  • Implement constraints and set_constraint in TorchDistributedTrial (optuna/optuna-integration#308)
  • Add qConstrainedLogEI (#6744, thanks @sawa3030!)
  • Extend parallel coordinate plots to conditional, multi-objective, and constrained studies (#6763)
  • Add qLogEHVI (#6792, thanks @sawa3030!)
  • Add qConstrainedLogEHVI in GPSampler (#6804, thanks @sawa3030!)
  • Add constraints argument in create_trial (#6816)

Enhancements

  • Fix QMCSampler fallback to independent sampling in distributed setups (#6638, thanks @Rishabh-git10!)
  • Speed up BruteForceSampler by avoiding full tree build based on tree size check (#6646)
  • Add search space fingerprint for quicker consistency check in BruteForceSampler (#6649)
  • Speed up BruteForceSampler by candidates caching (#6650)
  • Split BruteForceSampler refactoring [3/3] (#6657)
  • Refactor PED-ANOVA (#6681)
  • Add lazy tree node to BruteForceSampler for speedup (#6705)
  • Raise ValueError in PedAnovaImportanceEvaluator for multi-objective studies without target (#6716)
  • Fix for the GPSampler OMP issue (#6753)
  • Bind loop var in _get_constraint_funcs to avoid closure bug (optuna/optuna-integration#278, thanks @GopalGB!)
  • Fix GitHub Actions workflow to use Optuna master (optuna/optuna-integration#307)
  • Allow JournalStorage to read Rustuna journal files (#6790)
  • Warn against using CmaEsSampler in constrained optimization (#6802)
  • Preserve empty study names across storage backends (#6818, thanks @uczltw6!)

Bug Fixes

  • Handle insufficient trials without raising ValueError in importances (#6720)
  • Fix a concurrency issue when setting study attributes (#6751)
  • Use qLog variants in qehvi_candidates_func and qnehvi_candidates_func (optuna/optuna-integration#302, thanks @adrianhtt!)
  • Fix IntDistribution midpoint bias in _SearchSpaceTransform and add tests (#6771, thanks @yen-0!)
  • Preserve metric_names order in trials_dataframe columns (#6786, thanks @rkfshakti!)
  • Add log cache offset tests and fixed logic (#6794, thanks @yen-0!)
  • Add QMCSampler to TestRelativeSampler coverage and clamp log-float untransform at low bound (#6799, thanks @yen-0!)
  • Fix NaN comparison when skipping enqueued trials (#6803, thanks @ishitta-iyer!)

Documentation

  • Add ablation study tutorial using BruteForceSampler (#6652)
  • Simplify the document for deprecated CmaEsSampler options (#6694)
  • Move deprecated TPESampler options to the end (#6696)
  • Fix typos in docstrings and duplicated author names in SPXCrossover citation (#6698, thanks @Divyansh-ag14!)
  • Fix wording in specify params tutorial (#6711, thanks @Ryo2611!)
  • Add a documentation about constrained TPESampler (#6712)
  • Enhance AutoSampler citation path (#6714)
  • Update sampler table (#6717)
  • Clarify n_warmup_steps boundary in MedianPruner and PercentilePruner (#6733, thanks @vin0san!)
  • Fix trial report doc (#6735)
  • Consolidate instruction for external dependency (#6749)
  • Update sampler table for constrained optimization (#6775)
  • Fix undefined variable in GCSArtifactStore docstring example (#6815, thanks @maupatel!)

Examples

Tests

Code Fixes

  • Refactor batched distribution classes to reduce branch duplication (#6689)
  • Reduce redundancy in test_brute_force.py (#6706)
  • Replace SciPy with Torch in gp.py (#6710)
  • Fix and refactor params validation in PED-ANOVA (#6729)
  • Show all study names upon load/create study failure (#6750)
  • Debug and refactor q-logEI (#6760)
  • Changed type of study'...
Read more

v5.0.0-rc1

v5.0.0-rc1 Pre-release
Pre-release

Choose a tag to compare

@c-bata c-bata released this 03 Aug 05:30
44e745f

This is the release note of v5.0.0-rc1.

Installation

Since this is a pre-release, do not forget to specify the version number to upgrade Optuna.

pip install optuna==5.0.0rc1

Highlights

Massive default sampler algorithm enhancement

Screenshot 2026-08-03 14 18 27

Multivariate TPE with a constant liar strategy and an enhanced bandwidth computation (Watanabe 2023) has become the default algorithm for single-objective optimization. Multi-Objective TPE has been adopted as the new default sampler for multi-objective optimization, replacing NSGA-II. We conducted comprehensive benchmarking, carefully selected default options, and modified implementation details to maximize optimization performance.

Conditional PED-ANOVA (KDD 2026)

Our paper, Conditional PED-ANOVA: Hyperparameter Importance in Hierarchical & Dynamic Search Spaces, has been accepted to the 32nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD 2026)!

Optuna v5.0 now supports this feature and adopts it as the default algorithm for hyperparameter importance.

import optuna

# Starting in Optuna v5.0, the default hyperparameter importance algorithm
# supports conditional search spaces like the one below:
def objective(trial):
    classifier_name = trial.suggest_categorical("classifier", ["SVC", "RandomForest"])
    if classifier_name == "SVC":
        svc_c = trial.suggest_float("svc_c", 1e-10, 1e10, log=True)
        classifier_obj = sklearn.svm.SVC(C=svc_c, gamma="auto")
    else:
        rf_max_depth = trial.suggest_int("rf_max_depth", 2, 32, log=True)
        classifier_obj = sklearn.ensemble.RandomForestClassifier(
            max_depth=rf_max_depth, n_estimators=10
        )
    return …

study = optuna.create_study()
study.optimize(objective)

optuna.importance.get_param_importances(study)

New APIs for Constrained Optimization

Starting in Optuna v5.0, the interface for constrained optimization has changed:

  • trial.set_constraint() is added to set constraint values.
  • trial.constraints is added to get constraints.

Along with these new apis, constraints_func argument on samplers is now deprecated.

import optuna

def objective(trial):
    trial.set_constraint(β€œc0”, c0)
    trial.set_constraint(β€œc1”, c1)
    …

# The constraints_func argument is now deprecated.
sampler = optuna.samplers.TPESampler()
study = optuna.create_study(sampler=samplera)
study.optimize(objective)
print(study.best_trial.constraints)

Breaking Changes

  • Remove optuna.multi_objective module (#6686)
  • Remove deprecated integration wrappers for AllenNLP, Chainer, and MXNet (#6693)
  • Stabilize GPSampler (#6715)
  • Enable constant_liar by default (#6738)
  • Support categorical parameters in QMCSampler (#6742, thanks @saivedant169!)
  • Enable multivariate by default in TPESampler (#6746)
  • Fix: remove deprecated positional-arg compatibility from study and trial APIs (#6747, thanks @yen-0!)
  • Make PedAnovaImportanceEvaluator the default importance evaluator (#6748)
  • Deprecate constraints_func (#6773)
  • Change to treat cases without constraints as feasible (#6774)
  • Normalize trial timestamps to UTC in RDBStorage and JournalStorage (#6776)
  • Remove axis_order argument from plot_pareto_front (#6781)
  • Remove system_attrs from StudySummary (#6782)
  • Remove categorical_distance_func from TPESampler (#6783)

New Features

  • Implement qLogEI acquisition function (#6640)
  • Add support for conditional search spaces in PED-ANOVA (#6682)
  • Add conditional gp regressor (#6721)
  • Add mutation to ga (#6724, thanks @hrntsm!)
  • Use MOTPE-like split in PED-ANOVA for multi-objective studies when target is None (#6728)
  • Add constraints property to Trial (#6736)
  • Add set_constraint method to Trial (#6754)

Enhancements

  • Fix QMCSampler fallback to independent sampling in distributed setups (#6638, thanks @Rishabh-git10!)
  • Speed up BruteForceSampler by avoiding full tree build based on tree size check (#6646)
  • Speed up BruteForceSampler by candidates caching (#6650)
  • Split BruteForceSampler refactoring [3/3] (#6657)
  • Refactor PED-ANOVA (#6681)
  • Add lazy tree node to BruteForceSampler for speedup (#6705)
  • Raise ValueError in PedAnovaImportanceEvaluator for multi-objective studies without target (#6716)
  • Fix for the GPSampler OMP issue (#6753)
  • Make TPESampler the default sampler for multi-objective optimization (#6766)

Bug Fixes

  • Handle insufficient trials without raising ValueError in importances (#6720)
  • Fix a concurrency issue when setting study attributes (#6751)

Documentation

  • Add ablation study tutorial using BruteForceSampler (#6652)
  • Simplify the document for deprecated CmaEsSampler options (#6694)
  • Move deprecated TPESampler options to the end (#6696)
  • Fix typos in docstrings and duplicated author names in SPXCrossover citation (#6698, thanks @Divyansh-ag14!)
  • Fix wording in specify params tutorial (#6711, thanks @Ryo2611!)
  • Add a documentation about constrained TPESampler (#6712)
  • Enhance AutoSampler citation path (#6714)
  • Update sampler table (#6717)
  • docs: clarify n_warmup_steps boundary in MedianPruner and PercentilePruner (#6733, thanks @vin0san!)
  • Fix trial report doc (#6735)
  • chore: consolidate instruction for external dependency (#6749)
  • Update sampler table for constrained optimization (#6775)

Tests

  • Refactoring importance tests (#6725)
  • Add importance evaluator test cases to optuna.testing (#6765)

Code Fixes

  • Refactor batched distribution classes to reduce branch duplication (#6689)
  • Reduce redundancy in test_brute_force.py (#6706)
  • Replace SciPy with Torch in gp.py (#6710)
  • Fix and refactor params validation in PED-ANOVA (#6729)
  • Show all study names upon load/create study failure (#6750)
  • Changed type of study's direction into Literal | StudyDirection (#6762, thanks @yen-0!)
  • Fix unused mypy ignores in optuna/visualization/matplotlib/_rank.py (#6767)
  • Avoid unnecessary trial values in storage tests (#6769)
  • Follow-up #6762: Fix mypy errors (#6778)

Continuous Integration

  • Specify workflow permissions explicitly (#6687)
  • Capture Windows stdout (#6699)
  • Fix logging tests broken by pytest 9.1.0 caplog behavior change (#6719)
  • Hotfix for Sphinx CI (#6726)
  • Fix mypy errors with latest NumPy stubs (#6730)
  • Skip flaky gRPC journal storage tests (#6770)

Other

  • Bump up to version number v5.0.0.dev (#6685)
  • Add attestations: false to fix release workflow (#6690)
  • Update README with Optuna 4.9.0 release news (#6701)
  • Add CODEOWNERS file (#6718)
  • Bump the version up to 5.0.0rc1 (#6784)

Thanks to All the Contributors!

This release was made possible by the authors and the people who participated in the reviews and discussions.

@Alnusjaponica, @Divyansh-ag14, @Rishabh-git10, @Ryo2611, @c-bata, @gen740, @himkt, @hrntsm, @kAIto47802, @nabenabe0928, @not522, @porink0424, @saivedant169, @sawa3030, @vin0san, @y0z, @yen-0

v4.9.0

Choose a tag to compare

@c-bata c-bata released this 01 Jun 06:22
4db42e3

This is the release note of v4.9.0.

Highlights

Enhance Multi-Objective Constrained Parallel Optimization in GPSampler

@sawa3030 introduces parallelization enhancements to GPSampler, leveraging the Kriging Believer approach for constrained and multi-objective optimization (#6481). This improvement allows for more efficient exploration when multiple trials are running concurrently.

1_0k7Hd3Ipp1IKAI_o-l8DOQ

The GP surrogate is updated by assigning temporary objective function values ​​to the running trials.

For more technical details and benchmarks, please check out our blog post: Improving Optuna’s GPSampler Parallelization by Considering Running Trials.

Deprecate Several Features

The following features are deprecated in v4.9.0 and scheduled for removal in v6.0.0.

optuna

  • Several arguments in TPESampler (#6635)
    • prior_weight, consider_magic_clip, consider_endpoints, gamma, weights, hyperopt_parameters: These internal parameters are being deprecated to simplify the interface, as the default settings are optimal for most use cases.
    • warn_independent_sampling: Deprecated because TPESampler now robustly supports both independent and joint sampling, making this warning obsolete.
    • categorical_distance_func: This advanced feature will be migrated to OptunaHub in the future.
  • x0 and sigma0 options in CmaEsSampler (#6624)
    • These options have been deprecated because they require a deep understanding of CmaEsSampler's internals to be configured effectively.
  • optuna.terminator module (#6668)
    • This feature will be migrated to OptunaHub in the future.
  • RetryFailedTrialCallback (#6670)
    • This class has been renamed to RetryHeartbeatStaleTrialCallback to better reflect its behavior and avoid confusion with general trial retries (#6085).
  • optuna.integration module
    • The optuna.integration module currently acts as a shortcut to the external optuna_integration package for backward compatibility. Please import directly from the optuna_integration package going forward.

optuna-integration

  • PyCmaSampler: Please use Optuna's native CmaEsSampler instead.
  • CometCallback: This feature will be migrated to OptunaHub in the future.
  • MLflowCallback: This feature will be migrated to OptunaHub in the future.
  • TensorBoardCallback: This feature will be migrated to OptunaHub in the future.
  • TrackioCallback: This feature will be migrated to OptunaHub in the future.
  • WeightsAndBiasesCallback: This class has already been migrated to OptunaHub.

Breaking Changes

Enhancements

  • Enhance Multi-Objective Constrained Parallel Optimization in GPSampler (#6481)
  • Remove prior_mu from compute_sigmas (#6574)
  • Fix sampling bias in BruteForceSampler (#6627, thanks @Rishabh-git10!)
  • Refactor BruteForceSampler (#6645)
  • Speed up BruteForceSampler by using any instead of count (#6647)
  • Fix the return type of BruteForceSampler (#6648)
  • Split BruteForceSampler refactoring [2/3] (#6656)
  • fix: collect all infeasible values in error message instead of early return (#6661, thanks @AshutoshDevpura!)

Bug Fixes

  • Fix categorical None handling in slice plots (#6621)
  • fix: handle JSONDecodeError in TPESampler._get_params to avoid race condition (#6628, thanks @AshutoshDevpura!)
  • Split BruteForceSampler refactoring [2/3] (#6656)

Documentation

  • Update LightGBM links (#6511, thanks @jameslamb!)
  • Improve doc for best_trial/best_trials in constrained optimization (#6522)
  • Update CmaEsSampler docstring regarding categorical support (#6625)
  • Fix RST note directive typo in QMCSampler docstring (#6631, thanks @RudrenduPaul!)
  • Enhance Generative Engine Optimization (GEO) of many objective and constraint handling (#6639)
  • Add NSGA-III to FAQ about constraint (#6641)
  • Update BruteForceSampler and GridSampler information in docs (#6651)
  • Enhance FAQ about killing trials (#6653)

Examples

Code Fixes

  • Use broadcast_object_list instead of a custom method (optuna/optuna-integration#274)
  • Correct return type annotations for Axes in visualization functions (#6504, thanks @kvr06-ai!)
  • Fix type checking in trial folder (#6510, thanks @sateeshkumarb!)
  • Use TYPE_CHECKING in importance/_mean_decrease_impurity.py (#6514, thanks @saivedant169!)
  • Use TYPE_CHECKING in importance/_ped_anova/evaluator.py (#6515, thanks @saivedant169!)
  • Use TYPE_CHECKING in samplers/_cmaes.py (#6516, thanks @saivedant169!)
  • Use TYPE_CHECKING in samplers/_base.py (#6517, thanks @saivedant169!)
  • Use TYPE_CHECKING in pruners/_wilcoxon.py (#6518, thanks @saivedant169!)
  • Use TYPE_CHECKING in pruners/_percentile.py (#6520, thanks @saivedant169!)
  • Use TYPE_CHECKING in nsgaii/_constraints_evaluation.py (#6521, thanks @saivedant169!)
  • Use TYPE_CHECKING in nsgaii/_elite_population_selection_strategy.py (#6523, thanks @saivedant169!)
  • Use TYPE_CHECKING in nsgaii/_after_trial_strategy.py (#6524, thanks @saivedant169!)
  • Use TYPE_CHECKING in nsgaii/_child_generation_strategy.py (#6526, thanks @saivedant169!)
  • Move type-only imports in optuna.samplers._partial_fixed to TYPE_CHECKING (#6527, thanks @t7r0n!)
  • Fix TC006 cast annotation in optuna._gp.acqf (#6528, thanks @t7r0n!)
  • Fix TC006 cast annotation in optuna.trial._frozen (#6529, thanks @t7r0n!)
  • Fix TC006 cast annotation in tests.test_distributions (#6530, thanks @t7r0n!)
  • Fix TC006 cast annotation in optuna.study._multi_objective (#6531, thanks @t7r0n!)
  • Fix TC006 cast annotation in optuna.terminator.improvement.emmr (#6532, thanks @t7r0n!)
  • Fix TC006 cast annotation in optuna.terminator.erroreval (#6533, thanks @t7r0n!)
  • Fix TC006 cast annotation in optuna.study.study (#6534, thanks @t7r0n!)
  • Move type-only Callable import in optuna.testing.threading behind TYPE_CHECKING (#6535, thanks @t7r0n!)
  • Move type-only TracebackType import in optuna.testing.tempfile_pool behind TYPE_CHECKING (#6536, thanks @t7r0n!)
  • Move type-only stdlib imports in optuna.testing.storages behind TYPE_CHECKING (#6537, thanks @t7r0n!)
  • test: move type-only imports in optuna.testing.trials behind TYPE_CHECKING (#6538, thanks @t7r0n!)
  • test: move type-only imports in optuna.testing.pytest_samplers behind TYPE_CHECKING (#6539, thanks @t7r0n!)
  • test: move type-only imports in optuna.testing.pytest_storages behind TYPE_CHECKING (#6540, thanks @t7r0n!)
  • test: move type-only imports in optuna.testing.samplers behind TYPE_CHECKING (#6541, thanks @t7r0n!)
  • Quote cast type expression in tests/test_distributions.py (#6543, thanks @t7r0n!)
  • Move type-only datetime import in tests/trial_tests/test_trial.py (#6544, thanks @t7r0n!)
  • Move type-only imports to TYPE_CHECKING in samplers/_tpe/sampler.py (#6545, thanks @yasumorishima!)
  • Move type-only imports to TYPE_CHECKING in nsgaii/_crossover.py (#6546, thanks @yasumorishima!)
  • Remove dead code: unused functions, methods, and variables (#6547, thanks @duriantaco!)
  • Fix typing import issues in scott_parzen_estimator (#6548, thanks @rpathade!)
  • fix(types): use TYPE_CHECKING for imports in samplers/_cmaes.py (#6550, thanks @Aliipou!)
  • fix(types): use TYPE_CHECKING for BaseDistribution import in _transform.py (#6552, thanks @Aliipou!)
  • refactor: move BaseDistribution import to TYPE_CHECKING in search_space/group_decomposed.py (#6553, thanks @Aliipou!)
  • Use TYPE_CHECKING for imports in importance/_ped_anova/scott_parzen_estimator.py (#6554, thanks @Aliipou!)
  • fix(types): use TYPE_CHECKING for imports in samplers/_brute_force.py (#6555, thanks @Aliipou!)
  • Move type-only imports to TYPE_CHECKING in samplers/_nsgaiii/_elite_population_selection_strategy.py (#6557, thanks @Aliipou!)
  • Move type-only imports to TYPE_CHECKING in samplers/_nsgaiii/_sampler.py (#6558, thanks @Aliipou!)
  • Move Study import to TYPE_CHECKING in _timeline.py (#6559, thanks @rpathade!)
  • Use TYPE_CHECKING in optuna/samplers/_ga/_base.py (#6560, thanks @nightcityblade!)
  • Use TYPE_CHECKING in nsgaii/_crossovers/_base.py (#6561, thanks @saivedant169!)
  • Use TYPE_CHECKING in nsgaii/_crossovers/_blxalpha.py (#6562, thanks @saivedant169!)
  • Use TYPE_CHECKING in nsgaii/_crossovers/_uniform.py (#6563, thanks @saivedant169!)
  • Mov...
Read more

v4.8.0

Choose a tag to compare

@c-bata c-bata released this 16 Mar 04:59
689c62d

This is the release note of v4.8.0.

Highlights

Support for Constant Liar Strategy to GPSampler

A constant liar strategy for efficient parallelization has been introduced to GPSampler by @sawa3030. The figures (left: v4.7.0, right: v4.8.0) show that the overlap of search points has decreased, and a wider variety of solutions are being explored. The experiment uses n_jobs = 10 and n_trials = 100. Currently, this feature supports single-objective and unconstrained optimization. Further extensions are coming in v4.9.0.

v4.7.0 v4.8.0
image60 image26

SHAP-like beeswarm plot visualization

image52

@yasumorishima introduces the new visualization to OptunaHub. Please refer to https://hub.optuna.org/visualization/plot_beeswarm/ for details.

New Features

Enhancements

  • Validate artifact_id in FileSystemArtifactStore to prevent path traversal (#6432, thanks @RinZ27!)
  • fix: correct inverted warning message in pareto front plot (#6498, thanks @aerosta!)

Bug Fixes

  • Fix shared callback state in parallel OptunaSearchCV with LightGBM (optuna/optuna-integration#260, thanks @Quant-Quasar!)
  • Fix GPSampler crash when torch default device is CUDA (#6418, thanks @VedantMadane!)
  • Fix combination between PartialFixedSampler and TPESampler with group decomposed search space (#6428)
  • Fix TPESampler with multivariate and constant_liar (#6505)

Documentation

  • Add documentation indicating that WilcoxonPruner requires scipy (#6477)
  • Remove version & language selectors in the sidebar of docs (#6482)

Examples

Tests

  • Add SamplerTestCase class in optuna.testing package (#6424)
  • Move test_before_trial and test_after_trial_* to test_trial.py and test_study.py, respectively (#6429)

Code Fixes

  • Move type-only imports to TYPE_CHECKING in _param_importances.py (#6423, thanks @dotz0ver!)
  • Use future.annotations in matplotlib/_intermediate_values (#6425, thanks @Lakshman142!)
  • Reformat files with the latest version of ruff (#6426)
  • Replace .format() with f-strings in _parallel_coordinate.py (#6431, thanks @yasumorishima!)
  • Use TYPE_CHECKING for import in pruners/_base.py (#6434, thanks @yasumorishima!)
  • Use f-strings in optuna/storages/_base.py (#6435, thanks @edwiniac!)
  • Use f-strings in _contour.py (#6436, thanks @edwiniac!)
  • Use f-strings in _intermediate_values.py (#6437, thanks @edwiniac!)
  • Use f-strings in cli.py (#6438, thanks @edwiniac!)
  • Use f-strings in optuna/testing/storages.py (#6439, thanks @edwiniac!)
  • Use f-strings in optuna/storages/journal/_storage.py (#6440, thanks @edwiniac!)
  • Use f-strings in _imports.py (#6442, thanks @edwiniac!)
  • Use f-strings in _deprecated.py (#6443, thanks @edwiniac!)
  • Use TYPE_CHECKING for import in pruners/_hyperband.py (#6447, thanks @yasumorishima!)
  • Use TYPE_CHECKING for typing-only imports in test_timeline.py (#6451, thanks @KRMed!)
  • Refactor: Use f string in multi_objective tutorial (#6455, thanks @ryota717!)
  • refactor: move type-only imports into TYPE_CHECKING in samplers/_grid.py (#6466, thanks @dhruvildarji!)
  • refactor: move BaseDistribution into TYPE_CHECKING in search_space/intersection.py (#6467, thanks @dhruvildarji!)
  • Simplify Union type alias in optuna/samplers/_cmaes.py (#6478, thanks @roli-lpci!)
  • Use f-string in _convert_positional_args.py (#6483, thanks @toroleapinc!)
  • Add acqf import inside a TYPE_CHECKING block (#6484, thanks @acabellom!)
  • Refactor __repr__ in trial/_frozen.py to use f-strings (#6485, thanks @Bhavyag1337!)
  • Use TYPE_CHECKING in pruners/_threshold.py (#6487, thanks @LuciferDono!)
  • Use f-string in tutorial/10_key_features/005_visualization.py (#6489, thanks @maheer14!)
  • Move JSONSerializable import to TYPE_CHECKING in study/study.py (#6490, thanks @yasumorishima!)
  • Use f-string and {var_name=} instead of .format and var_name={var_name} (#6494, thanks @buddy0452004!)
  • Move optuna import to TYPE_CHECKING in pruners/_patient.py (#6501, thanks @yasumorishima!)
  • Move application import to TYPE_CHECKING in pruners/_patient.py (#6502, thanks @nightcityblade!)
  • Move application import to TYPE_CHECKING in pruners/_successive_halving.py (#6503, thanks @nightcityblade!)
  • Replace .format() with f-strings in 002_configurations.py (#6506, thanks @acabellom!)
  • Fix type checking (#6507, thanks @sateeshkumarb!)

Continuous Integration

Other

Thanks to All the Contributors!

This release was made possible by the authors and the people who participated in the reviews and discussions.

@Bhavyag1337, @KRMed, @Lakshman142, @LuciferDono, @ParagEkbote, @Quant-Quasar, @RinZ27, @VedantMadane, @acabellom, @aerosta, @buddy0452004, @c-bata, @dhruvildarji, @dotz0ver, @edwiniac, @gen740, @kAIto47802, @maheer14, @nabenabe0928, @nightcityblade, @not522, @roli-lpci, @ryota717, @sateeshkumarb, @sawa3030, @toroleapinc, @y0z, @yasumorishima

v4.7.0

Choose a tag to compare

@c-bata c-bata released this 19 Jan 05:45
40703c5

This is the release note of v4.7.0.

Highlights

Two New Multi-Objective Samplers Added to OptunaHub!

hype-sampler

@hrntsm introduces two new multi-objective samplersβ€”SPEA-II (Strength Pareto Evolutionary Algorithm 2) and HypE (Hypervolume Estimation Algorithm)β€”to OptunaHub. SPEA-II is an improved multi-objective evolutionary algorithm that differs from NSGA-II in its selection mechanism. HypE is a fast, hypervolume-based evolutionary algorithm designed for many-objective optimization problems. Please refer to the following pages for more details:

PedAnovaImportanceEvaluator Now Supports Local Hyperparameter Importance Computation

The target_quantile and region_quantile arguments have been introduced to PedAnovaImportanceEvaluator. This change allows you to investigate local hyperparameter importance rather than the global one with region_quantile < 1.0. See the original paper for the technical details.

Enhancements

  • Introduce stacklevel-aware custom warnings (#6293)
  • Cache distributions to skip consistency check (#6301)
  • Add warnings when JournalStorage lock acquisition is delayed (#6361)
  • Add support for local HPI in PED-ANOVA (#6362)

Bug Fixes

  • Fix log PDF of discrete trunc log-norm distribution for TPESampler (#6258)
  • Fix coefficient in PED-ANOVA (#6358)
  • Fix GPSampler crash when default torch device is CUDA (#6397, thanks @Quant-Quasar!)

Documentation

  • Add SECURITY.md (#6317)
  • Add a note for future dev of exclusive HV (#6318)
  • Update GPSampler documentation to include D-BE optimization details (#6347, thanks @Kaichi-Irie!)
  • Revert PR #6354 to enable -W option on Sphinx build (#6373)

Examples

Tests

  • Fix TC006 violation in tests/visualization_tests/test_utils.py (#6387, thanks @jiayusu!)

Code Fixes

  • Replace .format() with f-string in _setup_studies (#6326, thanks @haitham404!)
  • Update _upload.py for TYPE_CHECKING (#6327, thanks @satyarth7srivastava!)
  • Replace .format() with f-string in progress_bar.py (#6328, thanks @Nayil97!)
  • Use f-strings in optuna/samplers/_cmaes.py (#6331, thanks @swativdusane!)
  • Replace .format() with f-string in _parallel_coordinate.py (#6333, thanks @satyarth7srivastava!)
  • Refactor/fstring storage rdb (#6336, thanks @gadmin7!)
  • Migrate to ruff from black/blackdoc/isort/flake8 (#6341)
  • Replace .format with f-strings in optuna/importance/_base (#6342, thanks @VihaanMotwani!)
  • updated _terminator_improvement.py for TYPE_CHECKING (#6343, thanks @satyarth7srivastava!)
  • Replace .format with f-string in _param_importances.py (#6345, thanks @Harshadev-24!)
  • Replace .format() with f-strings in several modules (#6348, thanks @varundevr!)
  • Replace more .format() calls with f-strings (#6349, thanks @varundevr!)
  • Replace .format with f-string in tutorial/20_recipes/004_cli.py (#6350, thanks @RektPunk!)
  • Replace .format with f-string in optuna/study/_optimize.py (#6351, thanks @RektPunk!)
  • Format optuna/ files with Ruff (#6352)
  • Refactor: Use f-string in 001_rdb.py (#6356, thanks @sotagg!)
  • Format tests/ and tutorials/ files with Ruff (#6360)
  • Remove redundant _color_supported() check (#6363)
  • Add StorageTestCase class in optuna.testing package (#6369)
  • Change string formatting in optuna/pruners/_hyperband.py (#6370, thanks @eleannapapaio!)
  • Refactor test_study.py to use f-string instead of .format() (#6372, thanks @nepersoned!)
  • Fix mypy error for np.select (#6374)
  • Change string formatting for _successive_halving.py (#6375, thanks @spenam!)
  • Fix type annotations for optuna/trial/_frozen.py (#6377, thanks @spenam!)
  • fix type annotations for optuna/study/study.py (#6378, thanks @spenam!)
  • Fix type annotations for tests/study_tests/test_study.py (#6379, thanks @spenam!)
  • Move type-only imports to TYPE_CHECKING in test_visualizations.py (#6380, thanks @Sip4818!)
  • Move type-only imports to TYPE_CHECKING in _constrained_optimization.py (#6381, thanks @Sip4818!)
  • Replace format with f-string (#6383, thanks @varundevr!)
  • Move type-only imports to TYPE_CHECKING in _multi_objective.py (#6385, thanks @Sip4818!)
  • Move FrozenTrial import under TYPE_CHECKING for _study_summary.py file (#6386, thanks @Sip4818!)
  • Move type-check imports to TYPE_CHECKING in optuna/terminator/callback.py (#6388, thanks @Sip4818!)
  • Using f-string instead of .format() (#6389, thanks @Lakshman142!)
  • Use f-strings in optuna/_experimental.py (#6390, thanks @Rohan0497!)
  • Fix invalid StorageTestCase scenarios involving trial state and values (#6391)
  • Move type-hint import inside Type-Checking block in optuna\terminator\erroreval.py (#6395, thanks @Sip4818!)
  • Move type-check imports to TYPE_CHECKING in optuna\terminator\improvement\emmr.py (#6396, thanks @Sip4818!)
  • Move typing-only imports under TYPE_CHECKING in matplotlib/_slice.py (#6399, thanks @kapishyadav!)
  • Use logger.warning instead of optuna_warn for lock-acquisition delay notifications (#6400)
  • Update string formatting in optuna/samplers/_grid.py (#6401, thanks @kapishyadav!)
  • Updating storages/_in_memory.py to use f-strings (#6404, thanks @jrings!)
  • Move type-hint imports into type-checking block in optuna\terminator\improvement\evaluator.py (#6405, thanks @Sip4818!)
  • Move type-hint imports into type-checking block in median_erroreval.py (#6408, thanks @Sip4818!)
  • Replace .format() with f-string in _rank.py (#6409, thanks @jwalith!)
  • Replace .format() with f-string in test_hyperband.py (#6411, thanks @Banjiola!)
  • Replace .format() with f-string in _fixed.py (#6412, thanks @VedantMadane!)

Continuous Integration

Other

Thanks to All the Contributors!

This release was made possible by the authors and the people who participated in the reviews and discussions.

@Alnusjaponica, @Banjiola, @Harshadev-24, @HideakiImamura, @Kaichi-Irie, @Lakshman142, @Nayil97, @ParagEkbote, @Quant-Quasar, @RektPunk, @Rohan0497, @Sip4818, @VedantMadane, @VihaanMotwani, @c-bata, @eleannapapaio, @fritshermans, @fusawa-yugo, @gadmin7, @gen740, @haitham404, @jiayusu, @jrings, @jwalith, @kAIto47802, @kapishyadav, @nabenabe0928, @nepersoned, @not522, @nzw0301, @satyarth7srivastava, @sawa3030, @sotagg, @spenam, @swativdusane, @toshihikoyanase, @varundevr, @y0z

v4.6.0

Choose a tag to compare

@y0z y0z released this 10 Nov 05:13
3da7487

This is the release note of v4.6.0.

Highlights

Optuna Dashboard LLM Integration

Optuna Dashboard is a web-based tool that helps you easily explore and visualize your Optuna optimization history. The latest release, v0.20.0, introduces LLM integration, enabling the natural language-based Trial filtering and automatic Plotly chart generation. Please refer to the release blog for more details.

image55

Further Speed Enhancements for GPSampler

GPSampler becomes significantly faster owing to parallelized multi-start acquisition function optimization via PyTorch batching, and to optimized NumPy operations.

image15

Full Support for Multi-objective and Constrained Optimization in AutoSampler

We have fully implemented sampler selection rules for multi-objective and constrained optimization in AutoSampler. For more details, please see our blog post, "AutoSampler: Full Support for Multi-Objective & Constrained Optimization."

optuna-blog-autosampler-multi-constrained

Additions of Robust Bayesian Optimization Packages

Robust Bayesian optimization methods have been added to OptunaHub. Robust Bayesian optimization enables suggesting more robust parameters against input perturbations. This is especially helpful for Sim2Real transfer scenarios.

image25

Breaking Changes

Enhancements

  • Use iterator for lazy evaluation in journal storage’s read_logs (#6144)
  • Cache pair-wise distances to speed up GPSampler (#6244)
  • Speed up LogEI implementation (#6248)
  • Speed up EHVI by optimizing tensor operation order (#6257)
  • Use the decremental approach in the hypervolume contribution calculation (#6264)
  • Use cached trials in TPESampler's sample_relative (#6265)
  • Remove find_or_raise_by_id in _set_trial_value_without_commit (#6266)
  • Speed up GPSampler by Batching Acquisition Function Evaluations (#6268, thanks @Kaichi-Irie!)
  • Use cached study direction and trial for _CachedStorage's get_best_trial (#6270)
  • Add upsert in _set_trial_attr_without_commit for PostgreSQL (#6282, thanks @jaikumarm!)
  • Add states argument to _read_trials_from_remote_storage (#6288)
  • Use cached trials for intersection search space calculation (#6291)
  • Replace np.linalg.inv with np.linalg.cholesky to speed up GPSampler for numpy>=2.0.0 (#6296)

Bug Fixes

  • Skip trial validation on copy_study (#6249)
  • Fix incremental update algorithm in _CachedStorage's _read_trials_from_remote_storage (#6310)
  • Add safety guard for exhaustive search (#6321)

Documentation

  • Add AutoSampler to the sampler comparison table in the API reference (#6260, thanks @Kaichi-Irie!)
  • Update the GPSampler document to reflect support for constrained multi-objective optimization (#6262)
  • Add a link to the metric TPE paper in the TPESampler document (#6263)
  • Update announcement (#6285)
  • Update the table of Samplers in docs (#6287, thanks @fusawa-yugo!)
  • Fix the table of samplers in the docs (#6290)

Examples

Tests

Code Fixes

  • Update target version of black from Python 3.8 to 3.9 (optuna/optuna-integration#254)
  • Move fit_kernel_params to GPRegressor (#6243)
  • Modify TYPE_CHECKING in _brute_force.py (#6259, thanks @Kaichi-Irie!)
  • Move SciPy to the lazy import section in _gp/scipy_blas_thread_patch.py (#6269, thanks @Kaichi-Irie!)
  • Make the interface of batched_lbfgsb module compatible with scipy.optimize (#6273, thanks @Kaichi-Irie!)
  • Fix type checking in optuna.study._frozen.py (#6275, thanks @GabrielRomaoG!)
  • Move typing-only imports under TYPE_CHECKING in optuna.importance.__init__ (#6278, thanks @euangoodbrand!)
  • Move typing-only imports under TYPE_CHECKING in FanovaImportanceEvaluator (#6279, thanks @euangoodbrand!)
  • Move typing-only imports under TYPE_CHECKING in /study/_optimize.py (#6280, thanks @euangoodbrand!)
  • Use TYPE_CHECKING in optuna/pruners/_nop.py (#6297, thanks @AddyM!)
  • Use TYPE_CHECKING in optuna/samplers/_random.py (#6298, thanks @AddyM!)
  • Speed up squared distance computation (#6300)
  • Refactor emmr (#6304)
  • Fix string format of optuna/distributions.py (#6306)
  • Fix string format of tests/samplers_tests/tpe_tests/test_truncnorm.py (#6307)
  • Update black target to Python 3.9 (#6308)
  • Fix string format for optuna/study/study.py (#6309, thanks @unKnownNG!)
  • Changed the old .format code to the new f string format in the test_journal.py (#6312, thanks @Zrahay!)
  • Update string formatting in visualization/_pareto_front.py (#6314, thanks @dross20!)
  • Use f-string in 001_first.py (#6315, thanks @satyarth7srivastava!)
  • Use f-strings in _intermediate_values.py (#6316, thanks @nihalsiddiqui7!)
  • Refactor .format to f-string in _percentile.py (#6323, thanks @Jongwan93!)

Continuous Integration

Other

Thanks to All the Contributors!

This release was made possible by the authors and the people who participated in the reviews and discussions.

@AddyM, @GabrielRomaoG, @Jongwan93, @Kaichi-Irie, @ParagEkbote, @Zrahay, @c-bata, @contramundum53, @dross20, @euangoodbrand, @fusawa-yugo, @gen740, @jaikumarm, @kAIto47802, @ktns, @nabenabe0928, @nihalsiddiqui7, @not522, @satyarth7srivastava, @sawa3030, @toshihikoyanase, @unKnownNG, @y0z

v4.5.0

Choose a tag to compare

@y0z y0z released this 18 Aug 06:48
d7e1c1b

This is the release note of v4.5.0.

Highlights

GPSampler for constrained multi-objective optimization

GPSampler is now able to handle multiple objective and constraints simultaneously using the newly introduced constrained LogEHVI acquisition function.

The figures below show the difference between GPSampler (LogEHVI, unconstrained) vs GPSampler (constrained LogEHVI, new feature). The 3-dimensional version of the C2DTLZ2 benchmark problem we used is a problem where some areas of the Pareto front of the original DTLZ2 problem are made infeasible by constraints. Therefore, even if constraints are not taken into account, it is possible to obtain the Pareto front. Experimental results show that both LogEHVI and constrained LogEHVI can approximate the Pareto front, but the latter has significantly fewer infeasible solutions, demonstrating its efficiency.

Optuna v4.4 (LogEHVI) Optuna v4.5 (Constrained LogEHVI)
Log EHVI Constrained LogEHVI

Significant speedup of TPESampler

TPESampler is significantly (about 5x as listed in the table below) faster! It enables a larger number of trials in each study. The speedup was achieved through a series of enhancements in constant factors.

The following table shows the speed comparison of TPESampler between v4.4.0 and v4.5.0. The experiments were conducted using multivariate=True on a search space with 3 continuous parameters and 3 numerical discrete parameters. Each row shows the runtime for each number of objectives and each column shows each number of trials to be evaluated. Each runtime is shown along with the standard error over 3 random seeds. The numbers in parentheses represent the speedup factor in comparison to v4.4.0. For example, (5.1x) means the runtime of v4.5.0 is 5.1 times faster than that of v4.4.0.

n_objectives/n_trials 500 1000 1500 2000
1 1.4 $\pm$ 0.03 (5.1x) 3.9 $\pm$ 0.07 (5.3x) 7.3 $\pm$ 0.09 (5.4x) 11.9 $\pm$ 0.10 (5.4x)
2 1.8 $\pm$ 0.01 (4.7x) 4.7 $\pm$ 0.02 (4.8x) 8.7 $\pm$ 0.03 (4.8x) 13.9 $\pm$ 0.04 (4.9x)
3 2.0 $\pm$ 0.01 (4.2x) 5.4 $\pm$ 0.03 (4.4x) 10.0 $\pm$ 0.03 (4.6x) 15.9 $\pm$ 0.03 (4.7x)
4 4.2 $\pm$ 0.11 (3.2x) 12.1 $\pm$ 0.14 (3.9x) 20.9 $\pm$ 0.23 (4.2x) 31.3 $\pm$ 0.05 (4.4x)
5 12.1 $\pm$ 0.59 (4.7x) 30.8 $\pm$ 0.16 (5.8x) 50.7 $\pm$ 0.46 (6.5x) 72.8 $\pm$ 1.13 (7.1x)

Significant speedup of plot_hypervolume_history

plot_hypervolume_history is essential to assess the performance of multi-objective optimization, but it was unbearably slow when a large number of trials are evaluated on a many-objective (The number of objectives > 3) problem. v4.5.0 addressed this issue by incrementally updating the hypervolume instead of calculating each hypervolume from scratch.

The following figure shows the elapsed times of hypervolume history plot in Optuna v4.4.0 and v4.5.0 using a four-objective problem. The x-axis represents the number of trials and the y-axis represents the elapsed times for each setup. The blue and red lines are the results of v4.4.0 and v4.5.0, respectively.

Speedup of plot_hypervolume_history

CmaEsSampler now supports 1D search space

Up until Optuna v4.4, CmaEsSampler could not handle one-dimensional space and fell back to random search. Optuna v4.5 now allows the CMA-ES algorithm to be used for one-dimensional space.

The optunahub library is available on conda-forge

Now, you can install the optunahub library via conda-forge as follows.

conda install conda-forge::optunahub
Conda-Forge

New Features

  • Add ConstrainedLogEHVI (#6198)
  • Add support for constrained multi-objective optimization in GPSampler (#6224)
  • Support 1D Search Spaces in CmaEsSampler (#6228)

Enhancements

  • Move optuna._lightgbm_tuner module (optuna/optuna-integration#233, thanks @milkcoffeen!)
  • Fix numerical issue warning on qehvi_candidates_func (optuna/optuna-integration#242, thanks @LukeGT!)
  • Calculate hypervolume in HSSP using sum of contributions (#6130)
  • Use hypervolume difference as upperbound of contribs in HSSP (#6131)
  • Refactor tell_with_warning to avoid unnecessary get_trial call (#6133)
  • Print fully qualified name of experimental function by default (#6162, thanks @ktns!)
  • Include scipy-stubs in the type-check dependencies (#6174, thanks @jorenham!)
  • Warn when GPSampler falls back to RandomSampler (#6179, thanks @sisird864!)
  • Handle slowdown of GPSampler due to L-BFGS in SciPy v1.15 (#6191)
  • Use the Newton method instead of bisect in ndtri_exp (#6194)
  • Speed up erf for TPESampler (#6200)
  • Avoid duplications in _log_gauss_mass evaluations (#6202)
  • Remove unnecessary NumPy usage (#6215)
  • Use subset comparator to judge if trials are included in search space (#6218)
  • Speed up log pdf in _BatchedTruncNormDistributions by vectorization (#6220)
  • Speed up WFG by skipping is_pareto_front and using simple Python loops (#6223)
  • Vectorize ndtri_exp (#6229)
  • Speed up plot_hypervolume_history (#6232)
  • Speed up HSSP 4D+ by using a decremental approach (#6234)
  • Use lru_cache to skip HSSP (#6240, thanks @fusawa-yugo!)
  • Add hypervolume computation for a zero size array (#6245)

Bug Fixes

  • Fix: Resolve PG17 incompatibility for ENUMS in CASE statements (#6099, thanks @vcovo!)
  • Fix ill-combination of journal and gRPC (#6175)
  • Fix a bug in constrained GPSampler (#6181)
  • Fix TPESampler with multivariate and constant_liar (#6189)

Installation

  • Remove version constraint for torch with Python 3.13 (#6233)

Documentation

  • Add missing spaces in error message about inconsistent intermediate values (optuna/optuna-integration#239, thanks @Greesb!)
  • Improve parallelization document (#6123)
  • Add FAQ for case sensitivity problem with MySQL (#6127, thanks @fusawa-yugo!)
  • Add an FAQ entry about specifying optimization parameters (#6157)
  • Update link to survey (#6169)
  • Add introduction of OptunaHub in docs (#6171, thanks @fusawa-yugo!)
  • Add GPSampler as a sampler that supports constraints (#6176, thanks @1kastner!)
  • Remove optuna-fast-fanova references from documentation (#6178)
  • Fix stale docs in GP-related modules (#6184)
  • Embed link to OptunaHub in documentation (#6192, thanks @fusawa-yugo!)
  • Update README.md (#6222, thanks @muhammadibrahim313!)
  • Add a note about unrelated changes in PR (#6226)
  • Document the default evaluator in Optuna Dashboard (#6238)

Examples

Tests

  • Fix test_log_completed_trial_skip_storage_access (#6208)

Code Fixes

  • Clean up GP-related docs (#6125)
  • Refactor return style #6136 (#6151, thanks @unKnownNG!)
  • Refactor KernelParamsTensor towards cleaner GP-related modules (#6152)
  • Rename KernelParamsTensor to GPRegressor (#6153)
  • Refactor returns in v3.0.0.d.py (#6154, thanks @dross20!)
  • Refactor acquisition function minimally (#6166)
  • Implement Type-Checking for optuna/_imports.py (#6167, thanks @AdrianStrymer!)
  • Fix type checking in optuna.artifacts._download.py (#6177, thanks @dross20!)
  • Integrate is_categorical to search space (#6182)
  • Fix type checking in optuna.artifacts._list_artifact_meta.py (#6187, thanks @dross20!)
  • Introduce the independent sampling warning template (#6188)
  • Use warning template for independent sampling in GPSampler (#6195)
  • Refactor SearchSpace in GP (#6197)
  • Refactor _truncnorm (#6201)
  • Use TYPE_CHECKING in optuna/_gp/acqf.py to avoid circular imports (#6204, thanks @CarvedCoder!)
  • Use TYPE_CHECKING in optuna/_gp/optim_mixed.py to avoid circular imports (#6205, thanks @Subodh-12!)
  • Flip the sign of constraints in GPSampler (#6213)
  • Implement NSGA-III using BaseGASampler (#6219)
  • Replace torch.newaxis with None for old PyTorch (#6237)

Continuous Integration

Other

Thanks to All the Contributors!

This release was made possible by the authors and the people who participated in the reviews and discussions.

@1kastner, @AdrianStrymer, @CarvedCoder, @Greesb, @HideakiImamura, @LukeGT, @ParagEkbote, @Subodh-12, @c-bata, @contramundum53, @dhyeyinf, @dross20, @fusaw...

Read more

v4.4.0

Choose a tag to compare

@HideakiImamura HideakiImamura released this 16 Jun 05:12
0742587

This is the release note of v4.4.0.

Highlights

In addition to new features, bug fixes, and improvements in documentation and testing, version 4.4 introduces a new tool called the Optuna MCP Server.

Optuna MCP Server

The Optuna MCP server can be accessed by any MCP client via uv β€” for instance, with Claude Desktop, simply add the following configuration to your MCP server settings file. Of course, other LLM clients like VSCode or Cline can also be used similarly. You can also access it via Docker. If you want to persist the results, you can use the β€” storage option. For details, please refer to the repository.

{
  "mcpServers": {
    … (Other MCP Servers' settings)
    "Optuna": {
      "command": "uvx",
      "args": [
        "optuna-mcp"
      ]
    }
  }
}

image3

Gaussian Process-Based Multi-objective Optimization

Optuna’s GPSampler, introduced in version 3.6, offers superior speed and performance compared to existing Bayesian optimization frameworks, particularly when handling objective functions with discrete variables. In Optuna v4.4, we have extended this GPSampler to support multi-objective optimization problems. The applications of multi-objective optimization are broad, and the new multi-objective capabilities introduced in this GPSampler are expected to find applications in fields such as material design, experimental design problems, and high-cost hyperparameter optimization.

GPSampler can be easily integrated into your program and performs well against the existing BoTorchSampler. We encourage you to try it out with your multi-objective optimization problems.

sampler = optuna.samplers.GPSampler()
study = optuna.create_study(directions=["minimize", "minimize"], sampler=sampler)

image2

New Features in OptunaHub

During the development period of Optuna v4.4, several new features were also introduced to OptunaHub, the feature-sharing platform for Optuna:

Vizier sampler performance
image1
TPE acquisition visualizer
image4

Breaking Changes

  • Update consider_prior Behavior and Remove Support for False (#6007)
  • Remove restart_strategy and inc_popsize to simplify CmaEsSampler (#6025)
  • Make all arguments of TPESampler keyword-only (#6041)

New Features

  • Add a module to preprocess solutions for hypervolume improvement calculation (#6039)
  • Add AcquisitionFuncParams for LogEHVI (#6052)
  • Support Multi-Objective Optimization GPSampler (#6069)
  • Add n_recent_trials to plot_timeline (#6110, thanks @msdsm!)

Enhancements

  • Adapt TYPE_CHECKING of samplers/_gp/sampler.py (#6059)
  • Avoid deepcopy in _tell_with_warning (#6079)
  • Add _compute_3d for hypervolume computation (#6112, thanks @shmurai!)
  • Improve performance of plot_hypervolume_history (#6115, thanks @shmurai!)
  • add deprecated/removed version specification to calls of convert_positional_args (#6117, thanks @shmurai!)
  • Optimize Study.best_trial performance by avoiding unnecessary deep copy (#6119, thanks @msdsm!)
  • Refactor and speed up HV3D (#6124)
  • Add assume_pareto for hv calculation in _calculate_weights_below_for_multi_objective (#6129)

Bug Fixes

  • Update vsbx (#6033, thanks @hrntsm!)
  • Fix request.values in OptunaStorageProxyService (#6044, thanks @hitsgub!)
  • Fix a bug in distributed optimization using NSGA-II/III (#6066, thanks @leevers!)
  • Fix: fetch all trials in BruteForceSampler for HyperbandPruner (#6107)

Documentation

Examples

Tests

  • Add float precision tests for storages (#6040)
  • Refactor test_base_gasampler.py (#6104)
  • chore: run tests for importance only with in-memory (#6109)
  • Improve test cases for n_recent_trials of plot_timeline (follow-up #6110) (#6116)
  • Performance optimization for test_study.py by removing redundancy (#6120)

Code Fixes

  • Optional mypy check (#6028)
  • Update Type-Checking for optuna/_experimental.py (#6045, thanks @ParagEkbote!)
  • Update Type-Checking for optuna/importance/_base.py (#6046, thanks @ParagEkbote!)
  • Update Type-Checking for optuna/_convert_positional_args.py (#6050, thanks @ParagEkbote!)
  • Update Type-Checking for optuna/_deprecated.py (#6051, thanks @ParagEkbote!)
  • Update Type-Checking for optuna/_gp/gp.py (#6053, thanks @ParagEkbote!)
  • Add validate eta in sbx (#6056, thanks @hrntsm!)
  • Remove CmaEsAttrKeys and _attr_keys for Simplification (#6068)
  • Replace np.isnan with math.isnan (#6080)
  • Refactor warning handling of _tell_with_warning (#6082)
  • Implement Type-Checking for optuna/distributions.py (#6086, thanks @AdrianStrymer!)
  • Update TYPE_CHECKING for optuna/_gp/gp.py (#6090, thanks @Samarthi!)
  • Support mypy 1.16.0 (#6102)
  • Emit ExperimentalWarning if heartbeat is enabled (#6106, thanks @lan496!)
  • Simplify tuple return in optuna/visualization/_terminator_improvement.py (#6139, thanks @Prashantdhaka23!)
  • Refactor return standardization in optim_mixed.py (#6140, thanks @Ajay-Satish-01!)
  • Simplify tuple return in test_trial.py (#6141, thanks @saishreyakumar!)
  • Refactor return statement style in optuna/storages/_rdb/models.py for consistency among the codebase (#6143, thanks @Shubham05122002!)

Continuous Integration

Other

Thanks to All the Contributors!

This release was made possible by the authors and the people who participated in the reviews and discussions.

@AdrianStrymer, @Ajay-Satish-01, @Alnusjaponica, @Copilot, @HideakiImamura, @ParagEkbote, @Prashantdhaka23, @Samarthi, @Shubham05122002, @SubhadityaMukherjee, @c-bata, @contramundum53, @copilot-pull-request-reviewer[bot], @fusawa-yugo, @gen740, @himkt, @hitsgub, @hrntsm, @kAIto47802, @lan496, @leevers, @milkcoffeen, @msdsm, @nabenabe0928, @not522, @nzw0301, @s...

Read more

v4.3.0

Choose a tag to compare

@y0z y0z released this 14 Apr 05:06
bc23723

This is the release note of v4.3.0.

Highlights

This has various bug fixes and improvements to the documentation and more.

Breaking Changes

Enhancements

  • Accept custom objective in LightGBMTuner (optuna/optuna-integration#203, thanks @sawa3030!)
  • Improve time complexity of IntersectionSearchSpace (#5982, thanks @GittyHarsha!)
  • Add _prev_waiting_trial_number in InMemoryStorage to improve the efficiency of _pop_waiting_trial_id (#5993, thanks @sawa3030!)
  • Add arguments of versions to convert_positional_args (#6009, thanks @fusawa-yugo!)
  • Add wait_server_ready method in GrpcStorageProxy (#6010, thanks @hitsgub!)
  • Remove warning messages for Matplotlib-based plot_contour and plot_rank (#6011)
  • Fix type checking in optuna._callbacks.py (#6030)
  • Enhance SBXCrossover (#6008, thanks @hrntsm!)

Bug Fixes

  • Convert storage into InMemoryStorage before copying to the local (optuna/optuna-integration#213)
  • Fix contour plot of matplotlib (#5892, thanks @fusawa-yugo!)
  • Fix threading lock logic (#5922)
  • Use _LazyImport for grpcio package (#5954)
  • Prevent Lock Blocking by Adding Timeout to JournalStorage (#5971, thanks @sawa3030!)
  • Fix a minor bug in GPSampler for objective that returns inf (#5995)
  • Fix a bug that a gRPC server doesn't work with JournalStorage (#6004, thanks @fusawa-yugo!)
  • Fix _pop_waiting_trial_id for finished trial (#6012)
  • Resolve the issue where BruteForceSampler fails to suggest all combinations (#5893)

Documentation

Examples

Tests

Code Fixes

  • Add BaseGASampler (#5864)
  • Fix comments in pyproject.toml (#5972)
  • Remove FirstTrialOnlyRandomSampler (#5973, thanks @mehakmander11!)
  • Remove _check_and_set_param_distribution (#5975, thanks @siddydutta!)
  • Remove testing/distributions.py (#5977, thanks @mehakmander11!)
  • Remove _StudyInfo's param_distribution in _cached_storage.py (#5978, thanks @tarunprabhu11!)
  • Introduce UpdateFinishedTrialError to raise an error when attempting to modify a finished trial (#6001, thanks @sawa3030!)
  • Deprecate consider_prior in TPESampler (#6005, thanks @sawa3030!)
  • Improve Code Readability by Following PEP8 Standards (#6006, thanks @sawa3030!)
  • Made error message for create_study's direction easier to understand optuna.study (#6021, thanks @sinano1107!)

Continuous Integration

Other

Thanks to All the Contributors!

This release was made possible by the authors and the people who participated in the reviews and discussions.

@Alnusjaponica, @GittyHarsha, @HideakiImamura, @ParagEkbote, @c-bata, @contramundum53, @ffineis, @fusawa-yugo, @gen740, @hitsgub, @hrntsm, @kAIto47802, @ktns, @mehakmander11, @nabenabe0928, @not522, @nzw0301, @porink0424, @sawa3030, @siddydutta, @sinano1107, @tarunprabhu11, @toshihikoyanase, @y0z