Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
theodolite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sören Henning
theodolite
Commits
97babe40
Commit
97babe40
authored
4 years ago
by
Simon Ehrenstein
Browse files
Options
Downloads
Patches
Plain Diff
Introduce new version of benchmarking strategies
parent
55ce9ecb
No related branches found
No related tags found
1 merge request
!39
Add Support for Benchmarking Strategies
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
execution/theodolite.py
+106
-13
106 additions, 13 deletions
execution/theodolite.py
with
106 additions
and
13 deletions
execution/theodolite.py
+
106
−
13
View file @
97babe40
...
@@ -3,12 +3,13 @@
...
@@ -3,12 +3,13 @@
import
sys
import
sys
import
os
import
os
from
strategies.config
import
ExperimentConfig
from
strategies.config
import
ExperimentConfig
import
strategies.strategies.default_strategy
as
default_strategy
import
strategies.strategies.domain_restriction.lower_bound_strategy
as
lower_bound_strategy
import
strategies.strategies.step_strategy
as
step_strategy
import
strategies.strategies.domain_restriction.no_lower_bound_strategy
as
no_lower_bound_strategy
import
strategies.strategies.binary_search_strategy
as
binary_search_strategy
import
strategies.strategies.search.check_all_strategy
as
check_all_strategy
import
strategies.strategies.search.linear_search_strategy
as
linear_search_strategy
import
strategies.strategies.search.binary_search_strategy
as
binary_search_strategy
from
strategies.experiment_execution
import
ExperimentExecutor
from
strategies.experiment_execution
import
ExperimentExecutor
import
strategies.subexperiment_execution.subexperiment_executor
as
subexperiment_executor
import
strategies.subexperiment_execution.subexperiment_executor
as
subexperiment_executor
import
strategies.subexperiment_evaluation.noop_subexperiment_evaluator
as
noop_subexperiment_evaluator
import
strategies.subexperiment_evaluation.subexperiment_evaluator
as
subexperiment_evaluator
import
strategies.subexperiment_evaluation.subexperiment_evaluator
as
subexperiment_evaluator
uc
=
sys
.
argv
[
1
]
uc
=
sys
.
argv
[
1
]
...
@@ -19,18 +20,110 @@ cpu_limit=sys.argv[5] if len(sys.argv) >= 6 and sys.argv[5] else "1000m"
...
@@ -19,18 +20,110 @@ cpu_limit=sys.argv[5] if len(sys.argv) >= 6 and sys.argv[5] else "1000m"
memory_limit
=
sys
.
argv
[
6
]
if
len
(
sys
.
argv
)
>=
7
and
sys
.
argv
[
6
]
else
"
4Gi
"
memory_limit
=
sys
.
argv
[
6
]
if
len
(
sys
.
argv
)
>=
7
and
sys
.
argv
[
6
]
else
"
4Gi
"
kafka_streams_commit_interval_ms
=
sys
.
argv
[
7
]
if
len
(
sys
.
argv
)
>=
8
and
sys
.
argv
[
7
]
else
100
kafka_streams_commit_interval_ms
=
sys
.
argv
[
7
]
if
len
(
sys
.
argv
)
>=
8
and
sys
.
argv
[
7
]
else
100
execution_minutes
=
sys
.
argv
[
8
]
if
len
(
sys
.
argv
)
>=
9
and
sys
.
argv
[
8
]
else
5
execution_minutes
=
sys
.
argv
[
8
]
if
len
(
sys
.
argv
)
>=
9
and
sys
.
argv
[
8
]
else
5
benchmark_strategy
=
sys
.
argv
[
9
]
if
len
(
sys
.
argv
)
>=
10
and
sys
.
argv
[
9
]
else
"
default
"
domain_restriction
=
bool
(
sys
.
argv
[
9
])
if
len
(
sys
.
argv
)
>=
10
and
sys
.
argv
[
9
]
==
"
restrict-domain
"
else
False
search_strategy
=
sys
.
argv
[
10
]
if
len
(
sys
.
argv
)
>=
11
and
(
sys
.
argv
[
10
]
==
"
linear-search
"
or
sys
.
argv
[
10
]
==
"
binary-search
"
)
else
"
default
"
print
(
f
"
Chosen benchmarking strategy:
{
benchmark_strategy
}
"
)
print
(
f
"
Domain restriction of search space activated:
{
domain_restriction
}
"
)
print
(
f
"
Chosen search strategy:
{
search_strategy
}
"
)
if
benchmark_strategy
==
"
step
"
:
# use h3
print
(
f
"
Going to execute at most
{
len
(
dim_values
)
+
len
(
replicas
)
-
1
}
subexperiments in total..
"
)
if
domain_restriction
:
experiment_config
=
ExperimentConfig
(
uc
,
dim_values
,
replicas
,
partitions
,
cpu_limit
,
memory_limit
,
kafka_streams_commit_interval_ms
,
execution_minutes
,
step_strategy
,
subexperiment_executor
,
subexperiment_evaluator
)
# use h1 & h3
elif
benchmark_strategy
==
"
binary-search
"
:
if
search_strategy
==
"
linear-search
"
:
experiment_config
=
ExperimentConfig
(
uc
,
dim_values
,
replicas
,
partitions
,
cpu_limit
,
memory_limit
,
kafka_streams_commit_interval_ms
,
execution_minutes
,
binary_search_strategy
,
subexperiment_executor
,
subexperiment_evaluator
)
print
(
f
"
Going to execute at most
{
len
(
dim_values
)
+
len
(
replicas
)
-
1
}
subexperiments in total..
"
)
experiment_config
=
ExperimentConfig
(
use_case
=
uc
,
dim_values
=
dim_values
,
replicass
=
replicas
,
partitions
=
partitions
,
cpu_limit
=
cpu_limit
,
memory_limit
=
memory_limit
,
kafka_streams_commit_interval_ms
=
kafka_streams_commit_interval_ms
,
execution_minutes
=
execution_minutes
,
domain_restriction_strategy
=
lower_bound_strategy
,
search_strategy
=
linear_search_strategy
,
subexperiment_executor
=
subexperiment_executor
,
subexperiment_evaluator
=
subexperiment_evaluator
)
# use h2 & h3
elif
search_strategy
==
"
binary-search
"
:
experiment_config
=
ExperimentConfig
(
use_case
=
uc
,
dim_values
=
dim_values
,
replicass
=
replicas
,
partitions
=
partitions
,
cpu_limit
=
cpu_limit
,
memory_limit
=
memory_limit
,
kafka_streams_commit_interval_ms
=
kafka_streams_commit_interval_ms
,
execution_minutes
=
execution_minutes
,
domain_restriction_strategy
=
lower_bound_strategy
,
search_strategy
=
binary_search_strategy
,
subexperiment_executor
=
subexperiment_executor
,
subexperiment_evaluator
=
subexperiment_evaluator
)
# use h0 & h3
else
:
print
(
f
"
Going to execute
{
len
(
dim_values
)
*
len
(
replicas
)
}
subexperiments in total..
"
)
experiment_config
=
ExperimentConfig
(
use_case
=
uc
,
dim_values
=
dim_values
,
replicass
=
replicas
,
partitions
=
partitions
,
cpu_limit
=
cpu_limit
,
memory_limit
=
memory_limit
,
kafka_streams_commit_interval_ms
=
kafka_streams_commit_interval_ms
,
execution_minutes
=
execution_minutes
,
domain_restriction_strategy
=
lower_bound_strategy
,
search_strategy
=
check_all_strategy
,
subexperiment_executor
=
subexperiment_executor
,
subexperiment_evaluator
=
subexperiment_evaluator
)
# not use h3
else
:
else
:
print
(
f
"
Going to execute
{
len
(
dim_values
)
*
len
(
replicas
)
}
subexperiments in total..
"
)
# use h1 & !h3
experiment_config
=
ExperimentConfig
(
uc
,
dim_values
,
replicas
,
partitions
,
cpu_limit
,
memory_limit
,
kafka_streams_commit_interval_ms
,
execution_minutes
,
default_strategy
,
subexperiment_executor
,
noop_subexperiment_evaluator
)
if
search_strategy
==
"
linear-search
"
:
print
(
f
"
Going to execute at most
{
len
(
dim_values
)
+
len
(
replicas
)
-
1
}
subexperiments in total..
"
)
experiment_config
=
ExperimentConfig
(
use_case
=
uc
,
dim_values
=
dim_values
,
replicass
=
replicas
,
partitions
=
partitions
,
cpu_limit
=
cpu_limit
,
memory_limit
=
memory_limit
,
kafka_streams_commit_interval_ms
=
kafka_streams_commit_interval_ms
,
execution_minutes
=
execution_minutes
,
domain_restriction_strategy
=
no_lower_bound_strategy
,
search_strategy
=
linear_search_strategy
,
subexperiment_executor
=
subexperiment_executor
,
subexperiment_evaluator
=
subexperiment_evaluator
)
# use h2 & !h3
elif
search_strategy
==
"
binary-search
"
:
experiment_config
=
ExperimentConfig
(
use_case
=
uc
,
dim_values
=
dim_values
,
replicass
=
replicas
,
partitions
=
partitions
,
cpu_limit
=
cpu_limit
,
memory_limit
=
memory_limit
,
kafka_streams_commit_interval_ms
=
kafka_streams_commit_interval_ms
,
execution_minutes
=
execution_minutes
,
domain_restriction_strategy
=
no_lower_bound_strategy
,
search_strategy
=
binary_search_strategy
,
subexperiment_executor
=
subexperiment_executor
,
subexperiment_evaluator
=
subexperiment_evaluator
)
# use h0 & !h3
else
:
print
(
f
"
Going to execute
{
len
(
dim_values
)
*
len
(
replicas
)
}
subexperiments in total..
"
)
experiment_config
=
ExperimentConfig
(
use_case
=
uc
,
dim_values
=
dim_values
,
replicass
=
replicas
,
partitions
=
partitions
,
cpu_limit
=
cpu_limit
,
memory_limit
=
memory_limit
,
kafka_streams_commit_interval_ms
=
kafka_streams_commit_interval_ms
,
execution_minutes
=
execution_minutes
,
domain_restriction_strategy
=
no_lower_bound_strategy
,
search_strategy
=
check_all_strategy
,
subexperiment_executor
=
subexperiment_executor
,
subexperiment_evaluator
=
subexperiment_evaluator
)
executor
=
ExperimentExecutor
(
experiment_config
)
executor
=
ExperimentExecutor
(
experiment_config
)
executor
.
execute
()
executor
.
execute
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment