-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from ISE-Sustainable-AI/feature/optuna-kube-bench
Feature/optuna kube bench
- Loading branch information
Showing
39 changed files
with
1,090 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import logging | ||
from os import path | ||
from time import sleep | ||
from experiments.optuna_kubernetes.optuna_kubernetes_benchmark import OptunaKubernetesBenchmark | ||
from ml_benchmark.benchmark_runner import BenchmarkRunner | ||
from urllib.request import urlopen | ||
from ml_benchmark.utils.yml_parser import YMLParser | ||
|
||
if __name__ == "__main__": | ||
metricsIP = urlopen("https://checkip.amazonaws.com").read().decode("utf-8").strip() | ||
|
||
# read in base configuration | ||
resources = YMLParser.parse(path.join(path.dirname(__file__),"resource_definition.yml")) | ||
# TODO: XXX remove this hardcoded values | ||
to_automate = { | ||
"metricsIP": metricsIP, | ||
"dockerImageTag": "tawalaya/optuna-trial:latest", | ||
"dockerImageBuilder": "docker", | ||
#force random namespaces to reduce conflicts | ||
# "kubernetesNamespace": "optuna-study", | ||
"kubernetesContext": "admin@smile", | ||
"kubernetesMasterIP": "130.149.158.143", | ||
"prometheus_url": "http://130.149.158.143:30041", | ||
"deleteAfterRun":True, | ||
"epochs": 50, | ||
} | ||
resources.update(to_automate) | ||
|
||
repetions = 2 | ||
for trials in [6,12,18]: | ||
for cpu in range(2,8): | ||
for i in range(1,repetions+1): | ||
sleep(3) | ||
logging.info(f"Starting Run {i} with 3x{cpu} vCPUs with n_trails {trials}") | ||
try: | ||
resources["trials"] = trials | ||
resources["workerCpu"] = (cpu/2.0) | ||
resources["goal"] = f"rcpu{cpu}-{trials}-{i}" | ||
runner = BenchmarkRunner(benchmark_cls=OptunaKubernetesBenchmark, resources=resources) | ||
runner.run() | ||
sleep(7) | ||
runner = None | ||
except Exception as e: | ||
logging.warning(f'Failed Run {i} with 3x{cpu} vCPUs with n_trails {trials} - {e}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import logging | ||
from os import path | ||
from time import sleep | ||
from experiments.optuna_kubernetes.optuna_kubernetes_benchmark import OptunaKubernetesBenchmark | ||
from ml_benchmark.benchmark_runner import BenchmarkRunner | ||
from urllib.request import urlopen | ||
from ml_benchmark.utils.yml_parser import YMLParser | ||
|
||
if __name__ == "__main__": | ||
metricsIP = urlopen("https://checkip.amazonaws.com").read().decode("utf-8").strip() | ||
|
||
# read in base configuration | ||
resources = YMLParser.parse(path.join(path.dirname(__file__),"resource_definition.yml")) | ||
# TODO: XXX remove this hardcoded values | ||
to_automate = { | ||
"metricsIP": metricsIP, | ||
"dockerImageTag": "tawalaya/optuna-trial:latest", | ||
"dockerImageBuilder": "docker", | ||
#force random namespaces to reduce conflicts | ||
# "kubernetesNamespace": "optuna-study", | ||
"kubernetesContext": "admin@smile", | ||
"kubernetesMasterIP": "130.149.158.143", | ||
"prometheus_url": "http://130.149.158.143:30041", | ||
"deleteAfterRun":True, | ||
"epochs": 50, | ||
} | ||
resources.update(to_automate) | ||
|
||
repetions = 2 | ||
for i in range(1,repetions+1): | ||
for n in range(1,7): | ||
sleep(3) | ||
logging.info(f"Starting Run {i} with {n} nodes with n_trails 100") | ||
try: | ||
resources["trials"] = 100 | ||
resources["workerCount"] = n | ||
resources["goal"] = f"rnode{n}-100-{i}" | ||
runner = BenchmarkRunner(benchmark_cls=OptunaKubernetesBenchmark, resources=resources) | ||
runner.run() | ||
sleep(7) | ||
runner = None | ||
except Exception as e: | ||
logging.warning(f'Failed Run {i} with {n} nodes and n_trails 100 - {e}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
workerCpu: 3.25 | ||
workerMemory: 6 | ||
workerCount: 1 | ||
trials: 6 | ||
epochs: 5 | ||
metricsIP: auto ##urlopen("https://checkip.amazonaws.com").read().decode("utf-8").strip(), | ||
kubernetesMasterIP: minikube ##subprocess.check_output("minikube ip", shell=True).decode("utf-8").strip("\n") | ||
dockerImageTag: tawalaya/optuna-trial:latest | ||
dockerImageBuilder: docker | ||
kubernetesContext: "minikube" | ||
deleteAfterRun: True | ||
hyperparameter: | ||
learning_rate: | ||
start: 1e-4 | ||
end: 1e-2 | ||
step_size: 1e-3 | ||
weight_decay: | ||
start: 1e-6 | ||
end: 1e-4 | ||
step_size: 1e-5 | ||
# hidden_layer_config: | ||
# start: [10] | ||
# end: [100, 100, 100] | ||
# step_size: [10, 1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# generated file - do not edit | ||
learning_rate: | ||
end: 0.01 | ||
start: 0.0001 | ||
step_size: 0.001 | ||
weight_decay: | ||
end: 0.0001 | ||
start: 1.0e-06 | ||
step_size: 1.0e-05 |
Oops, something went wrong.