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
Add a caching mechanism to make NSGAIIMultiObjectiveSampler
faster.
#1257
Conversation
NSGAIIMultiObjectiveSampler
faster.NSGAIIMultiObjectiveSampler
faster.
Codecov Report
@@ Coverage Diff @@
## master #1257 +/- ##
==========================================
+ Coverage 88.00% 88.16% +0.16%
==========================================
Files 97 98 +1
Lines 7301 7410 +109
==========================================
+ Hits 6425 6533 +108
- Misses 876 877 +1
Continue to review full report at Codecov.
|
Benchmark ResultElapsed timeOptimization PerformanceThe results are exactly the same before and after applying this PR. Commands$ pip3 install --user git+https://github.com/optuna/optuna@9b3eccfc1a
$ kurobako solver --name 'NSGA-II@master' command python3 nsga2.py > solver-master.json
$ kurobako studies --problems $(kurobako problem zdt 1) --solvers $(cat solver-master.json) --repeats 1 --budget 1000 --seed 0 | kurobako run > result-master.json
$ pip3 install --user git+https://github.com/sile/optuna@aa8b578
$ kurobako solver --name 'NSGA-II@pr1257' command python3 nsga2.py > solver-pr1257.json
$ kurobako studies --problems $(kurobako problem zdt 1) --solvers $(cat solver-pr1257.json) --repeats 1 --budget 1000 --seed 0 | kurobako run > result-pr1257.json
$ cat result-*.json | kurobako plot curve --metric solver-elapsed-time
$ cat result-*.json | kurobako plot pareto-front --ymin 1 --ymax 7 |
NSGAIIMultiObjectiveSampler
faster.NSGAIIMultiObjectiveSampler
faster.
This pull request has not seen any recent activity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for creating this PR. The speed-up is impressive and the contest looks almost LGTM except for one concern.
Co-authored-by: Yusuke Tsuzuku <ytsmiling@users.noreply.github.com>
Fixed the CI failure. PTAL 🙇 > @ytsmiling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The current implementation of
NSGAIIMultiObjectiveSampler
is unnecessarily slow because it calculates the latest population from scratch each time when therelative_sample
method is called.This PR makes it faster by storing caches of populations to the study system attributes and eliminating the need of the redundant recalculation.
TODO