Skip to content

Commit

Permalink
add async_halving
Browse files Browse the repository at this point in the history
  • Loading branch information
azhou-determined committed Oct 8, 2024
1 parent 8abc798 commit a4d190f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
1 change: 0 additions & 1 deletion master/pkg/searcher/adaptive_asha.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ func makeBrackets(config expconf.AdaptiveASHAConfig) []bracket {

func newAdaptiveASHASearch(config expconf.AdaptiveASHAConfig, smallerIsBetter bool, metric string) SearchMethod {
brackets := makeBrackets(config)
fmt.Printf("Brackets: %v\n", brackets)
methods := make([]SearchMethod, 0, len(brackets))
for _, bracket := range brackets {
c := expconf.AsyncHalvingConfig{
Expand Down
4 changes: 2 additions & 2 deletions master/pkg/searcher/search_method.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ const (
RandomSearch SearchMethodType = "random"
// GridSearch is the SearchMethodType for a grid searcher.
GridSearch SearchMethodType = "grid"
// AdaptiveSearch is the SearchMethodType for an adaptive searcher.
AdaptiveSearch SearchMethodType = "adaptive"
// ASHASearch is the SearchMethodType for an ASHA searcher.
ASHASearch SearchMethodType = "asha"
// AdaptiveASHASearch is the SearchMethodType for an adaptive ASHA searcher.
Expand All @@ -68,6 +66,8 @@ func NewSearchMethod(c expconf.SearcherConfig) SearchMethod {
return newRandomSearch(*c.RawRandomConfig)
case c.RawGridConfig != nil:
return newGridSearch(*c.RawGridConfig)
case c.RawAsyncHalvingConfig != nil:
return newAsyncHalvingStoppingSearch(*c.RawAsyncHalvingConfig, c.SmallerIsBetter(), c.Metric())
case c.RawAdaptiveASHAConfig != nil:
return newAdaptiveASHASearch(*c.RawAdaptiveASHAConfig, c.SmallerIsBetter(), c.Metric())
default:
Expand Down
14 changes: 14 additions & 0 deletions schemas/expconf/v0/searcher-async-halving.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,20 @@
],
"default": null
},
"time_metric": {
"type": [
"string",
"null"
],
"default": null
},
"max_time": {
"type": [
"integer",
"null"
],
"default": null
},
"smaller_is_better": {
"type": [
"boolean",
Expand Down

0 comments on commit a4d190f

Please sign in to comment.