-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsigmod.py
153 lines (129 loc) · 6.23 KB
/
sigmod.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
import os
from deploy import Experiment
def build_real_trace_experiments():
fixed_args = dict(
output_dir = os.path.join(os.getcwd(), "results", "precomputation_real_trace"),
batch_size = 200,
redundancy_elimination_workers = 80,
replication_factor = 1,
replication_factor_max = 4,
optimizer="PrimalSimplex",
use_clarkson=False,
#profile= "dev"
)
return [Experiment(region_selector="aws", **fixed_args)]
def build_scaling_experiments():
min_replication_factor = 1
max_replication_factor = 5
fixed_args = dict(
output_dir = os.path.join(os.getcwd(), "results", "precomputation_scaling"),
batch_size = 200,
redundancy_elimination_workers = 80,
replication_factor = 0,
optimizer="PrimalSimplex",
use_clarkson=False,
#profile= "dev"
)
scaling = Experiment(region_selector="aws-eu", object_store_selector="General Purpose", **fixed_args).as_replication_factors(min_replication_factor, max_replication_factor) + \
Experiment(region_selector="aws-eu", **fixed_args).as_replication_factors(min_replication_factor, max_replication_factor) + \
Experiment(region_selector="aws", **fixed_args).as_replication_factors(min_replication_factor, max_replication_factor) + \
Experiment(region_selector="azure", **fixed_args).as_replication_factors(min_replication_factor, max_replication_factor) + \
Experiment(region_selector="azure|aws", **fixed_args).as_replication_factors(min_replication_factor, min(4, max_replication_factor))
# Order by replication factor
scaling.sort(key=lambda e: e.replication_factor)
# Also save candidates of small experiments
for e in scaling:
e.output_candidates = e.region_selector == "aws-eu"
return scaling
def build_scaling_experiments_lrs():
fixed_args = dict(
output_dir = os.path.join(os.getcwd(), "results", "precomputation_scaling_lrs"),
batch_size = 200,
redundancy_elimination_workers = 80,
#redundancy_elimination_workers = 1,
replication_factor = 0,
#optimizer="PrimalSimplex",
optimizer="lrs",
use_clarkson=False,
#profile= "dev"
)
scaling = Experiment(region_selector="aws-eu", object_store_selector="General Purpose", **fixed_args).as_replication_factors(1, 5) + \
Experiment(region_selector="aws-eu", **fixed_args).as_replication_factors(1, 5) + \
Experiment(region_selector="aws", **fixed_args).as_replication_factors(1, 2) + \
Experiment(region_selector="azure", **fixed_args).as_replication_factors(1, 2) + \
Experiment(region_selector="azure|aws", **fixed_args).as_replication_factors(1, 2)
# Order by replication factor
scaling.sort(key=lambda e: e.replication_factor)
return scaling
def build_scaling_experiment_candidates():
experiments = build_scaling_experiments_lrs()
for e in experiments:
e.output_dir = os.path.join(os.getcwd(), "results", "precomputation_scaling_small_candidates")
e.output_candidates = True
e.optimizer = "PrimalSimplex"
return experiments
def build_precomputation_batching_experiments(large=False):
fixed_args = dict(
output_dir = os.path.join(os.getcwd(), "results", "batch_size_scaling"),
redundancy_elimination_workers = 80,
region_selector="aws|azure",
object_store_selector="",
replication_factor=3,
optimizer="PrimalSimplex",
use_clarkson=False,
output_candidates=True,
#profile="dev"
)
batch_sizes = [200, 500, 1000]
if large:
fixed_args["output_dir"] = os.path.join(os.getcwd(), "results", "batch_size_scaling_large")
fixed_args["replication_factor"] = 5
return [Experiment(**fixed_args, batch_size=b) for b in batch_sizes]
def build_cpu_scaling_experiments():
fixed_args = dict(
output_dir = os.path.join(os.getcwd(), "results", "cpu_scaling"),
#replication_factor=5,
replication_factor=3,
batch_size=200,
optimizer="PrimalSimplex",
use_clarkson=False,
region_selector="aws",
object_store_selector="",
#profile="dev"
)
worker_numbers = [(20 * i)-2 for i in [4, 2, 1]]
batch_size_scaling = [Experiment(redundancy_elimination_workers=w,**fixed_args) for w in worker_numbers]
return batch_size_scaling
def build_accuracy_small_experiments():
fixed_args = dict(
output_dir = os.path.join(os.getcwd(), "results", "accuracy"),
replication_factor=2,
batch_size=200,
#optimizer="lrs",
use_clarkson=False,
#region_selector="aws",
#object_store_selector="General Purpose",
redundancy_elimination_workers=10,
#profile="dev"
)
optimizers = ["PrimalSimplex", "InteriorPoint", "lrs"]
# Full replication range and list of optimizers for aws
batch_size_scaling = [Experiment(optimizer=o, **fixed_args).as_replication_factors(1, 5) for o in optimizers]
# Replication up to 2 and lrs for the rest
max_replication_factor = 2
batch_size_scaling.append(Experiment(region_selector="aws-eu", object_store_selector="General Purpose",optimizer="lrs", **fixed_args).as_replication_factors(1, max_replication_factor))
batch_size_scaling.append(Experiment(region_selector="aws-eu",optimizer="lrs", **fixed_args).as_replication_factors(1, max_replication_factor))
batch_size_scaling.append(Experiment(region_selector="azure",optimizer="lrs", **fixed_args).as_replication_factors(1, max_replication_factor))
batch_size_scaling.append(Experiment(region_selector="azure|azure",optimizer="lrs", **fixed_args).as_replication_factors(1, max_replication_factor))
# Flatten the list of lists to a list of elements
flattened_list = [item for sublist in batch_size_scaling for item in sublist]
return flattened_list
named_experiments = {
"scaling": build_scaling_experiments,
"real_trace": build_real_trace_experiments,
#"scaling_lrs": build_scaling_experiments_lrs,
#"scaling_candidates": build_scaling_experiment_candidates,
"batch_size": build_precomputation_batching_experiments,
#"cpu_scaling": build_cpu_scaling_experiments,
#"accuracy": build_accuracy_small_experiments,
}