Skip to content

Speed up HSSP 4D+ by using a decremental approach#6234

Merged
y0z merged 3 commits intooptuna:masterfrom
nabenabe0928:enhance/speed-up-hssp-4d-or-more
Aug 6, 2025
Merged

Speed up HSSP 4D+ by using a decremental approach#6234
y0z merged 3 commits intooptuna:masterfrom
nabenabe0928:enhance/speed-up-hssp-4d-or-more

Conversation

@nabenabe0928
Copy link
Copy Markdown
Contributor

@nabenabe0928 nabenabe0928 commented Aug 4, 2025

Motivation

This PR is inspired by:

Description of the changes

  • Calculate H(S ^ {i}) instead of H(S v {i}) for 4+ objectives

@nabenabe0928 nabenabe0928 added the enhancement Change that does not break compatibility and not affect public interfaces, but improves performance. label Aug 4, 2025
@nabenabe0928
Copy link
Copy Markdown
Contributor Author

nabenabe0928 commented Aug 4, 2025

# of Objectives Master This PR
3 2.2 2.3
4 65 20
5 589 96

(The unit in the table is second. 400 Trials per study.)

Note

The tri-objective problem took 3.9 seconds with the decremental approach, so I decided to use the incremental approach for the tri-objective problem.

Benchmarking Code
import optuna


def multi_objective(trial: optuna.Trial) -> tuple[float, float, float, float, float]:
    x = trial.suggest_float("x", -5, 5)
    y = trial.suggest_float("y", -5, 5)
    return x**2 + y**2, (x - 2)**2 + (y - 2)**2, (x + 2)**2 + (y + 2)**2, (x + 2)**2 + (y - 2)**2 , (x - 2)**2 + (y + 2)**2


def objective(trial: optuna.Trial, n_objectives: int) -> tuple[float, ...]:
    values = multi_objective(trial)
    return values[:n_objectives]


n_objectives = 5
sampler = optuna.samplers.TPESampler(seed=0, multivariate=True)
study = optuna.create_study(sampler=sampler, directions=["minimize"]*n_objectives)
study.optimize(lambda trial: objective(trial, n_objectives), n_trials=400)
print((study.trials[-1].datetime_complete - study.trials[0].datetime_start).total_seconds())

@nabenabe0928
Copy link
Copy Markdown
Contributor Author

@not522 Could you review this PR?

@y0z y0z self-assigned this Aug 5, 2025
@nabenabe0928 nabenabe0928 added this to the v4.5.0 milestone Aug 5, 2025
Copy link
Copy Markdown
Member

@not522 not522 left a comment

Choose a reason for hiding this comment

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

LGTM!

@not522 not522 removed their assignment Aug 5, 2025
Copy link
Copy Markdown
Member

@y0z y0z left a comment

Choose a reason for hiding this comment

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

LGTM

@y0z y0z merged commit 5f3015e into optuna:master Aug 6, 2025
14 checks passed
@y0z y0z removed their assignment Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Change that does not break compatibility and not affect public interfaces, but improves performance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants