Skip to content

Commit

Permalink
feat: add asynchronous parallelization (#210)
Browse files Browse the repository at this point in the history
* feat: add rush parallelization

* refactor: worker_loop

* chore: remove assertion

* feat: freeze archive when rush is not available anymore

* refactor: start workers

* fix: termination in random search

* chore: print xdt

* refactor: send all hpcs at once in random search

* docs: add params and fields

* feat: store start and stop timestamps

* test: OptimInstanceSingleCrit

* docs: functions

* chore: remotes

* chore: pkgdown

* test: remove rush

* refactor: start_workers flag

* feat: option to start workers when instance is created

* feat: capture log on worker

* refactor: extra in fail

* feat: save log messages from worker

* refactor: remove capture.output

* fix: terminate

* test: workflow

* refactor: archive cache

* fix: partial argument match

* refactor: move parameter

* refactor: OptimInstanceRush

* ci: add redis

* chore: remove browser

* chore: pkgdown

* draft

* draft

* fix: nas in trafo_xs

* chore: leanify

* chore: import rush

* feat: optimize_decentralized

* fix: add callbacks to optimize_decentralized

* feat: add debug mode

* fix: debug mode

* feat: allow optimizer to control number of workers

* fix: transformation functions in random search

* feat: as_terminator

* fix: assert_terminators

* refactor: async classes

* refactor: ArchiveAsync

* chore: rename file

* refactor: archive best

* refactor: async

* chore: internal

* tests: rush

* chore: pkgdown

* refactor: async

* refactor: async

* refactor: batch

* draft

* draft

* draft

* draft

* fix: debug

* draft

* draft

* draft

* fix: pkgdown

* draft

* draft

* fix: remove deep clone from archivasync

* tests: activate

* tests: activate

* tests: activate

* tests: activate

* chore: comment

* chore: news
  • Loading branch information
be-marc authored Apr 27, 2024
1 parent 70f3f96 commit 35b5b84
Show file tree
Hide file tree
Showing 170 changed files with 5,013 additions and 1,643 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/dev-cmd-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ jobs:
with:
r-version: ${{ matrix.config.r }}

- uses: supercharge/[email protected]
with:
redis-version: 7

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/r-cmd-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ jobs:
with:
r-version: ${{ matrix.config.r }}

- uses: supercharge/[email protected]
with:
redis-version: 7

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
Expand Down
49 changes: 34 additions & 15 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ Imports:
data.table,
lgr,
methods,
mlr3misc (>= 0.11.0),
R6
mlr3misc (>= 0.15.0.9000),
R6,
rush
Suggests:
adagio,
emoa,
Expand All @@ -58,7 +59,11 @@ Suggests:
nloptr,
progressr,
rmarkdown,
redux,
testthat (>= 3.0.0)
Remotes:
mlr-org/rush,
mlr-org/mlr3misc
VignetteBuilder:
knitr
Config/testthat/edition: 3
Expand All @@ -70,27 +75,39 @@ Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
Collate:
'Archive.R'
'ArchiveBest.R'
'CallbackOptimization.R'
'ArchiveAsync.R'
'ArchiveBatch.R'
'CallbackAsync.R'
'CallbackBatch.R'
'Codomain.R'
'ContextOptimization.R'
'ContextAsync.R'
'ContextBatch.R'
'Objective.R'
'ObjectiveRFun.R'
'ObjectiveRFunDt.R'
'ObjectiveRFunMany.R'
'OptimInstance.R'
'OptimInstanceMultiCrit.R'
'OptimInstanceSingleCrit.R'
'OptimInstanceAsync.R'
'OptimInstanceAsyncMultiCrit.R'
'OptimInstanceAsyncSingleCrit.R'
'OptimInstanceBatch.R'
'OptimInstanceBatchMultiCrit.R'
'OptimInstanceBatchSingleCrit.R'
'mlr_optimizers.R'
'Optimizer.R'
'OptimizerCmaes.R'
'OptimizerDesignPoints.R'
'OptimizerFocusSearch.R'
'OptimizerGenSA.R'
'OptimizerGridSearch.R'
'OptimizerIrace.R'
'OptimizerNLoptr.R'
'OptimizerRandomSearch.R'
'OptimizerAsync.R'
'OptimizerAsyncDesignPoints.R'
'OptimizerAsyncGridSearch.R'
'OptimizerAsyncRandomSearch.R'
'OptimizerBatch.R'
'OptimizerBatchCmaes.R'
'OptimizerBatchDesignPoints.R'
'OptimizerBatchFocusSearch.R'
'OptimizerBatchGenSA.R'
'OptimizerBatchGridSearch.R'
'OptimizerBatchIrace.R'
'OptimizerBatchNLoptr.R'
'OptimizerBatchRandomSearch.R'
'Progressor.R'
'mlr_terminators.R'
'Terminator.R'
Expand All @@ -102,6 +119,7 @@ Collate:
'TerminatorRunTime.R'
'TerminatorStagnation.R'
'TerminatorStagnationBatch.R'
'as_terminator.R'
'assertions.R'
'bb_optimize.R'
'bbotk_reflections.R'
Expand All @@ -111,4 +129,5 @@ Collate:
'nds_selection.R'
'reexport.R'
'sugar.R'
'worker_loops.R'
'zzz.R'
67 changes: 51 additions & 16 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,31 +1,47 @@
# Generated by roxygen2: do not edit by hand

S3method(as.data.table,Archive)
S3method(as.data.table,ArchiveAsync)
S3method(as.data.table,ArchiveBatch)
S3method(as.data.table,DictionaryOptimizer)
S3method(as.data.table,DictionaryTerminator)
S3method(as_terminator,Terminator)
S3method(as_terminators,default)
S3method(as_terminators,list)
S3method(bb_optimize,"function")
S3method(bb_optimize,Objective)
export(Archive)
export(ArchiveBest)
export(CallbackOptimization)
export(ArchiveAsync)
export(ArchiveBatch)
export(CallbackAsync)
export(CallbackBatch)
export(Codomain)
export(ContextOptimization)
export(ContextAsync)
export(ContextBatch)
export(Objective)
export(ObjectiveRFun)
export(ObjectiveRFunDt)
export(ObjectiveRFunMany)
export(OptimInstance)
export(OptimInstanceMultiCrit)
export(OptimInstanceSingleCrit)
export(OptimInstanceAsync)
export(OptimInstanceAsyncMultiCrit)
export(OptimInstanceAsyncSingleCrit)
export(OptimInstanceBatch)
export(OptimInstanceBatchMultiCrit)
export(OptimInstanceBatchSingleCrit)
export(Optimizer)
export(OptimizerCmaes)
export(OptimizerDesignPoints)
export(OptimizerFocusSearch)
export(OptimizerGenSA)
export(OptimizerGridSearch)
export(OptimizerIrace)
export(OptimizerNLoptr)
export(OptimizerRandomSearch)
export(OptimizerAsync)
export(OptimizerAsyncDesignPoints)
export(OptimizerAsyncGridSearch)
export(OptimizerAsyncRandomSearch)
export(OptimizerBatch)
export(OptimizerBatchCmaes)
export(OptimizerBatchDesignPoints)
export(OptimizerBatchFocusSearch)
export(OptimizerBatchGenSA)
export(OptimizerBatchGridSearch)
export(OptimizerBatchIrace)
export(OptimizerBatchNLoptr)
export(OptimizerBatchRandomSearch)
export(Terminator)
export(TerminatorClockTime)
export(TerminatorCombo)
Expand All @@ -35,35 +51,54 @@ export(TerminatorPerfReached)
export(TerminatorRunTime)
export(TerminatorStagnation)
export(TerminatorStagnationBatch)
export(as_terminator)
export(as_terminators)
export(assert_archive)
export(assert_archive_async)
export(assert_archive_batch)
export(assert_instance)
export(assert_instance_async)
export(assert_instance_properties)
export(assert_optimizer)
export(assert_optimizer_async)
export(assert_optimizer_batch)
export(assert_set)
export(assert_terminable)
export(assert_terminator)
export(assert_terminators)
export(assign_result_default)
export(bb_optimize)
export(bbotk_reflections)
export(bbotk_worker_loop)
export(branin)
export(branin_wu)
export(callback_optimization)
export(callback_async)
export(callback_batch)
export(clbk)
export(clbks)
export(evaluate_queue_default)
export(is_dominated)
export(mlr_callbacks)
export(mlr_optimizers)
export(mlr_terminators)
export(nds_selection)
export(oi)
export(oi_async)
export(opt)
export(optimize_default)
export(optimize_async_default)
export(optimize_batch_default)
export(opts)
export(shrink_ps)
export(terminated_error)
export(trafo_xs)
export(transform_xdt_to_xss)
export(trm)
export(trms)
import(checkmate)
import(data.table)
import(mlr3misc)
import(paradox)
import(rush)
importFrom(R6,R6Class)
importFrom(methods,formalArgs)
importFrom(mlr3misc,clbk)
Expand Down
11 changes: 9 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# bbotk (development version)

* feat: Introduce asynchronous optimization with the `OptimizerAsync` and `OptimInstanceAsync` classes.
* BREAKING CHANGE: The `Optimizer` class is `OptimizerBatch` now.
* BREAKING CHANGE: The `OptimInstance` class and subclasses are `OptimInstanceBatch*` now.
* BREAKING CHANGE: The `CallbackOptimization` class is `CallbackBatch` now.
* BREAKING CHANGE: The `ContextOptimization` class is `ContextBatch` now.
* BREAKING CHANGE: Remove `ArchiveBest` class and `keep_evals` parameter from `OptimInstance`.

# bbotk 0.8.0

* fix: `OptimizerIrace` failed with logical parameters and dependencies.
Expand All @@ -12,7 +19,7 @@

# bbotk 0.7.2

* fix: Standalone `Tuner` and `FSelector` were rejected by `ContextOptimization`.
* fix: Standalone `Tuner` and `FSelector` were rejected by `ContextBatch`.

# bbotk 0.7.1

Expand All @@ -35,7 +42,7 @@

* fix: `OptimizerIrace` did not work with parameters with multiple dependencies.
* feat: Add new callback that backups the archive to disk to `mlr_callbacks`.
* feat: Create custom callbacks with the `callback_optimization()` function.
* feat: Create custom callbacks with the `callback_batch()` function.

# bbotk 0.5.4

Expand Down
Loading

0 comments on commit 35b5b84

Please sign in to comment.